Dynamically switch between system and Chromium's libc++ by glibc version. Restore jumbo.

This commit is contained in:
Mikhail Novosyolov 2018-10-17 15:19:11 +03:00
parent 4a57b79d9d
commit f6d2bc0cc9

View file

@ -352,6 +352,22 @@ cmp $FILE $FILE.orig && exit 1
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/node
# If system glibc is too old, use Chromium's built-in libc++, otherwise use system libc++.
# Shell does not or may not understand not integer values correctly,
# so remove the dot by sed to make the value of the glibc version an integer.
glibc_version="$(rpm -q --queryformat "%{VERSION}" glibc | sed -e 's/\.//g')"
# -lt means 'less than'
# glibc 2.27 is used as a stop point, because today (17.10.2018) Chromium
# is built with system glibc 2.27 in ALT Sisyphus,
# ROSA has glibc 2.25, and chromium 69 is unbuildable with it
if [ "$glibc_version" -lt 227 ]
then use_custom_libcxx='true'
else use_custom_libcxx='false'
fi
export use_custom_libcxx
echo "DEBUG: use_custom_libcxx = ${use_custom_libcxx}"
%define use_custom_libcxx %(echo ${use_custom_libcxx})
%build
%define use_gold true
%if 0%{clang}
@ -417,24 +433,10 @@ CFLAGS="$CFLAGS -Wno-error=pointer-to-int-cast -Wno-error=int-to-pointer-cast"
CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-variable -Wno-error=strict-overflow -Wno-error=deprecated-declarations"
%endif
# If system glibc is too old, use Chromium's built-in libc++, otherwise use system libc++.
# Shell does not or may not understand not integer values correctly,
# so remove the dot by sed to make the value of the glibc version an integer.
glibc_version="$(rpm -q --queryformat "%{VERSION}" glibc | sed -e 's/\.//g')"
# -lt means 'less than'
# glibc 2.27 is used as a stop point, because today (17.10.2018) Chromium
# is built with system glibc 2.27 in ALT Sisyphus,
# ROSA has glibc 2.25, and chromium 69 is unbuildable with it
if [ "$glibc_version" -lt 227 ]
then use_custom_libcxx='true'
else use_custom_libcxx='false'
fi
echo "DEBUG: use_custom_libcxx = ${use_custom_libcxx}"
# v NO TABS IN HERE!
%define gn_config use_sysroot=false \
system_libdir="%{_lib}" \
use_custom_libcxx="${use_custom_libcxx}" \
use_custom_libcxx="%{use_custom_libcxx}" \
icu_use_data_file=true \
enable_nacl=false \
optimize_webui=true \