Bug 1427339 - Configure binutils and gcc --with-sysroot=/. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 25 Dec 2017 10:32:57 +0900
changeset 449857 f1a65f4c4d3d5274565cc4682d71fb80ab770c83
parent 449856 840a6e04bcea7d87e362adf14a37b7c17e20f043
child 449858 d20521b7b865edfde71eb6120ff595689f4d6e1b
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, 1427316
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 - Configure binutils and gcc --with-sysroot=/. r=gps The system binutils and gcc are built with that option on Debian, but not on CentOS. That makes no practical difference, except for the fact that when building GCC, we use our own-built binutils (as per bug 1427316), but use the system GCC. And a GCC built with --with-sysroot=/ doesn't work with a binutils built without. However, a GCC built without --with-sysroot=/ works fine with a binutils built with it. So this change is compatible with building our GCC on both CentOS and Debian.
build/unix/build-gcc/build-gcc.sh
--- a/build/unix/build-gcc/build-gcc.sh
+++ b/build/unix/build-gcc/build-gcc.sh
@@ -92,32 +92,32 @@ apply_patch() {
 }
 
 build_binutils() {
   # if binutils_configure_flags is not set at all, give it the default value
   if [ -z "${binutils_configure_flags+xxx}" ];
   then
     # gold is disabled because we don't use it on automation, and also we ran into
     # some issues with it using this script in build-clang.py.
-    binutils_configure_flags="--disable-gold --enable-plugins --disable-nls"
+    binutils_configure_flags="--disable-gold --enable-plugins --disable-nls --with-sysroot=/"
   fi
 
   mkdir $root_dir/binutils-objdir
   pushd $root_dir/binutils-objdir
   ../binutils-$binutils_version/configure --prefix=${prefix-/tools/gcc}/ $binutils_configure_flags
   make $make_flags
   make install $make_flags DESTDIR=$root_dir
   export PATH=$root_dir/${prefix-/tools/gcc}/bin:$PATH
   popd
 }
 
 build_gcc() {
   mkdir $root_dir/gcc-objdir
   pushd $root_dir/gcc-objdir
-  ../gcc-$gcc_version/configure --prefix=${prefix-/tools/gcc} --enable-languages=c,c++  --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro --disable-initfini-array
+  ../gcc-$gcc_version/configure --prefix=${prefix-/tools/gcc} --enable-languages=c,c++  --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro --disable-initfini-array --with-sysroot=/
   make $make_flags
   make $make_flags install DESTDIR=$root_dir
 
   cd $root_dir/tools
   ln -s gcc gcc/bin/cc
   tar caf $root_dir/gcc.tar.xz gcc/
   popd
 }