summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2017-10-30 09:13:32 +0000
committer Eric Hameleers <alien@slackware.com>2017-10-30 09:13:32 +0000
commit42b8729fbc9e8d20d7dba7022f7695ed1e6d8872 (patch)
tree5d679a5220e13206041a5d8dd54870657855add9
parentff90b907343a2ee36e6d1fcf4bceb89d6b843bf8 (diff)
downloadasb-42b8729fbc9e8d20d7dba7022f7695ed1e6d8872.tar.gz
asb-42b8729fbc9e8d20d7dba7022f7695ed1e6d8872.tar.xz
chromium: make clang compiler work on 32bit
-rwxr-xr-xchromium/build/chromium.SlackBuild66
1 files changed, 40 insertions, 26 deletions
diff --git a/chromium/build/chromium.SlackBuild b/chromium/build/chromium.SlackBuild
index 24e63e49..306ef0fa 100755
--- a/chromium/build/chromium.SlackBuild
+++ b/chromium/build/chromium.SlackBuild
@@ -34,6 +34,7 @@
# - libtinfo (provides symlinks required by downloaded clang);
# - ninja;
# - nodejs;
+# - gcc >= 5.4.0 unless you compile using clang
# - Internet access (for downloading the nacl/pnacl toolchain bins)
# Needs:
# Changelog:
@@ -330,11 +331,16 @@ fi
USE_FFMPEG=${USE_FFMPEG:-shared} # other option is "static"
# You can build without NaCl (native client) if you set USE_NACL to "0",
-# but you'll lose some Chrome functionality like using in-browser applications:
+# but you'll lose some Chrome functionality like using in-browser applications.
+# Note that NaCl is only supported on 64bit, and will be obsoleted in 2018
+# in favor of WebAssembly:
USE_NACL=${USE_NACL:-1}
# Use the clang compiler. Results in faster build and smaller binaries.
-# I default this to "1" (on) because gcc support is getting stale:
+# This default to "1" (on) because gcc support is getting stale
+# and the gcc of Slackware 14.2 is already too old.
+# This script will compile google's modified clang from source, so that 32bit
+# can be supported (Google offers only 64bit pre-built clang for download0:
USE_CLANG=${USE_CLANG:-1}
# If you don't want to enable support for Widevine CDM
@@ -529,14 +535,23 @@ cat $SRCDIR/patches/chromium_glibc226.patch | patch -p1 --verbose \
cat $SRCDIR/patches/crc32c-string-view-check.patch \
| patch -p1 --verbose -d third_party/crc32c/src \
2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
-## Enable VAAPI hardware decoding on Linux platform:
-#cat $SRCDIR/patches/chromium_vaapi.patch | patch -p1 --verbose \
-# 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# When compiling google's clang on 32bit Slackware use 'i586' in the triplet.
+# I am a python noob so this is clumsy, better implementation is welcome :-)
+cp $SRCDIR/patches/clang.toolchains.i586.triple.diff .
+cat $SRCDIR/patches/chromium_32bit_triplet.patch | patch -p0 --verbose \
+ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
+# When compiling google's clang, use the system cmake
+# (prebuilt binary from google is only available as 64bit):
+cat $SRCDIR/patches/chromium_use_system_cmake.patch | patch -p0 --verbose \
+ 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
# Don't crap out when gzip does not support '--rsyncable' (Slackware < 14.2):
if ! gzip --help |grep -q rsyncable ; then
cat $SRCDIR/patches/chromium_no_rsyncable.patch | patch -p1 --verbose \
2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
fi
+## Enable VAAPI hardware decoding on Linux platform:
+#cat $SRCDIR/patches/chromium_vaapi.patch | patch -p1 --verbose \
+# 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log
# Also needed for Slackware <= 14.2:
if [ $(LC_ALL=C gcc -dumpversion |cut -d. -f1) -eq 4 ]; then
@@ -581,18 +596,6 @@ if [ "x$SRCEXT" = "x-dev" ]; then
-i chrome/common/chrome_paths_linux.cc
fi
-if [ "$USE_CLANG" = "1" ]; then
- # use_clang=true uses clang instead of gcc. Does not work on 32bit though.
- # clang_use_chrome_plugins=true fails with clang 3.5 - disable for now.
- export CC="clang"
- export CXX="clang++"
-else
- export CC="gcc"
- export CXX="g++"
-fi
-export AS=as
-export AR=ar
-
chown -R root:root .
chmod -R u+w,go+r-w,a+X-s .
@@ -610,7 +613,7 @@ export -n CFLAGS="$SLKCFLAGS -Wno-unused-local-typedefs"
export PATH="$TMP/tmp-$PRGNAM/privatebin:$PATH"
_chromium_conf=(
- "clang_use_chrome_plugins=${do_clang}"
+ "clang_use_chrome_plugins=false"
'enable_hangout_services_extension=true'
'enable_hidpi=true'
"enable_hotwording=${do_hotword}"
@@ -720,29 +723,27 @@ cat <<EOF >chrome/test/data/webui_test_resources.grd
EOF
fi
-# Download the NaCL and clang toolchains:
+# Download the NaCL toolchains:
if [ ${USE_NACL} -eq 1 ]; then
# We do not need arm_trusted on x86:
echo "-- Downloading NaCL toolchains."
python2 build/download_nacl_toolchains.py --packages nacl_x86_newlib,pnacl_newlib,pnacl_translator sync --extract \
2>&1 | tee $OUTPUT/nacl_dl-${PRGNAM}.log
fi
+# Download and compile google's clang sources if needed
+# (clang is required for building NaCl):
if [ ${USE_CLANG} -eq 1 -o ${USE_NACL} -eq 1 ]; then
- ## Download clang from Google, required for building NaCL.
- ## Also required when building for ARCH="x86_64" using clang:
- #echo "-- Downloading clang toolchains."
- #python2 tools/clang/scripts/update.py \
- # 2>&1 | tee $OUTPUT/clang_dl-${PRGNAM}.log
# Build clang from source instead of downloading:
echo "-- Building google's clang toolchain."
python2 tools/clang/scripts/update.py \
- --force-local-build --gcc-toolchain /usr --without-android \
+ --force-local-build --gcc-toolchain=/usr --without-android \
2>&1 | tee $OUTPUT/clang_build-${PRGNAM}.log
fi
# Generate the ninja build files:
echo "-- Bootstrapping 'gn'."
-python2 tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${_chromium_conf[*]}" \
+python2 tools/gn/bootstrap/bootstrap.py \
+ -v --gn-gen-args "${_chromium_conf[*]}" \
2>&1 | tee $OUTPUT/gyp-${PRGNAM}.log
echo "-- Generating ninja build files."
out/Release/gn gen out/Release -v --args="${_chromium_conf[*]}" \
@@ -750,6 +751,19 @@ out/Release/gn gen out/Release -v --args="${_chromium_conf[*]}" \
# Compile everything:
echo "-- Compiling the lot."
+
+if [ "$USE_CLANG" = "1" ]; then
+ # clang_use_chrome_plugins=true fails with clang 3.5 - disable for now.
+ export CC="clang"
+ export CXX="clang++"
+else
+ # Be careful not to override CC and CXX (may have been set by gcc5):
+ export CC=${CC:-"gcc"}
+ export CXX=${CXX:-"g++"}
+fi
+export AS=as
+export AR=ar
+
LC_ALL=C \
ninja -C out/Release \
pdf chrome chrome_sandbox chromedriver widevinecdmadapter clearkeycdm \