summaryrefslogtreecommitdiff
blob: da7ea1cf202bced710dcead64560272be71e017b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Fix HOST_OS detection in build_ffpeg.sh
https://bugs.gentoo.org/show_bug.cgi?id=491466

Enable gold linker
https://bugs.gentoo.org/show_bug.cgi?id=491850

--- a/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh
+++ b/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh
@@ -75,7 +75,7 @@
 LIBAVUTIL_VERSION_MAJOR=52
 
 case $(uname -sm) in
-  Linux\ i386)
+  Linux\ i?86)
     HOST_OS=linux
     HOST_ARCH=ia32
     JOBS=$(grep processor /proc/cpuinfo | wc -l)
@@ -85,6 +85,11 @@
     HOST_ARCH=x64
     JOBS=$(grep processor /proc/cpuinfo | wc -l)
     ;;
+  Linux\ arm*)
+    HOST_OS=linux
+    HOST_ARCH=arm
+    JOBS=$(grep processor /proc/cpuinfo | wc -l)
+    ;;
   Darwin\ i386)
     HOST_OS=mac
     HOST_ARCH=ia32
@@ -117,14 +122,6 @@
 echo "LD          = $(ld --version | head -n1)"
 echo
 
-# As of this writing gold 2.20.1-system.20100303 is unable to link FFmpeg.
-if ld --version | grep -q gold; then
-  echo "gold is unable to link FFmpeg"
-  echo
-  echo "Switch /usr/bin/ld to the regular binutils ld and try again"
-  exit 1
-fi
-
 # We want to use a sufficiently recent version of yasm on Windows.
 if [[ "$TARGET_OS" == "win" || "$TARGET_OS" == "win-vs2013" ]]; then
   if !(which yasm 2>&1 > /dev/null); then
@@ -292,14 +289,16 @@
     add_flag_common --extra-cflags=-m32
     add_flag_common --extra-ldflags=-m32
   elif [ "$TARGET_ARCH" = "arm" ]; then
-    # This if-statement essentially is for chroot tegra2.
-    add_flag_common --enable-cross-compile
+    if [ "$HOST_ARCH" != "arm" ]; then
+      # This if-statement essentially is for chroot tegra2.
+      add_flag_common --enable-cross-compile
 
-    # Location is for CrOS chroot. If you want to use this, enter chroot
-    # and copy ffmpeg to a location that is reachable.
-    add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
-    add_flag_common --target-os=linux
-    add_flag_common --arch=arm
+      # Location is for CrOS chroot. If you want to use this, enter chroot
+      # and copy ffmpeg to a location that is reachable.
+      add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
+      add_flag_common --target-os=linux
+      add_flag_common --arch=arm
+    fi
 
     # TODO(ihf): ARM compile flags are tricky. The final options
     # overriding everything live in chroot /build/*/etc/make.conf
@@ -322,11 +321,13 @@
     # NOTE: softfp/hardfp selected at gyp time.
     add_flag_common --extra-cflags=-mfloat-abi=hard
   elif [ "$TARGET_ARCH" = "arm-neon" ]; then
-    # This if-statement is for chroot arm-generic.
-    add_flag_common --enable-cross-compile
-    add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
-    add_flag_common --target-os=linux
-    add_flag_common --arch=arm
+    if [ "$HOST_ARCH" != "arm" ]; then
+      # This if-statement is for chroot arm-generic.
+      add_flag_common --enable-cross-compile
+      add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi-
+      add_flag_common --target-os=linux
+      add_flag_common --arch=arm
+    fi
     add_flag_common --enable-armv6
     add_flag_common --enable-armv6t2
     add_flag_common --enable-vfp