Bug 1427339 - Make mozconfig.stdcxx work with both CentOS and Debian-built GCCs. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 29 Dec 2017 15:16:45 +0900
changeset 449858 d20521b7b865edfde71eb6120ff595689f4d6e1b
parent 449857 f1a65f4c4d3d5274565cc4682d71fb80ab770c83
child 449859 0894fbaddc88e7f6b9cd6bb5f9cad6cf81254ecc
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1427339
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1427339 - Make mozconfig.stdcxx work with both CentOS and Debian-built GCCs. r=gps
build/unix/mozconfig.stdcxx
--- a/build/unix/mozconfig.stdcxx
+++ b/build/unix/mozconfig.stdcxx
@@ -1,15 +1,19 @@
 # Avoid dependency on libstdc++ 4.7
 export MOZ_STDCXX_COMPAT=1
 
 TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 
-if [ -f "$TOOLTOOL_DIR/gcc/lib/libstdc++.so" ]; then
+# Depending whether GCC was built on a RedHat-based or a Debian-based system,
+# the directory containing 32-bits libraries can be either (respectively)
+# lib or lib32. The directory for 64-bits libraries is always lib64.
+if [ -f "$TOOLTOOL_DIR/gcc/lib64/libstdc++.so" ]; then
   # We put both 32-bits and 64-bits library path in LD_LIBRARY_PATH: ld.so
   # will prefer the files in the 32-bits path when loading 32-bits executables,
   # and the files in the 64-bits path when loading 64-bits executables.
-  LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/gcc/lib
+  # We also put both possible 32-bits library paths.
+  LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/gcc/lib32:$TOOLTOOL_DIR/gcc/lib
 elif [ -f "$TOOLTOOL_DIR/clang/lib/libstdc++.so" ]; then
   LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/clang/lib
 fi
 
 mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"