diff --git a/build/unix/build-toolchain/build-gcc.py b/build/unix/build-toolchain/build-gcc.py index 3be28a2c5fd..11fba6f6d62 100755 --- a/build/unix/build-toolchain/build-gcc.py +++ b/build/unix/build-toolchain/build-gcc.py @@ -64,6 +64,7 @@ def build_glibc_aux(stage_dir, inst_dir): "--enable-add-ons=nptl", "--without-selinux", "--enable-kernel=2.6.18", + "--libdir=%s/lib64" % inst_dir, "--prefix=%s" % inst_dir]) def build_one_stage(env, stage_dir, is_stage_one): @@ -104,10 +105,23 @@ def build_one_stage_aux(stage_dir, is_stage_one): "--disable-bootstrap"] if is_stage_one: gcc_configure_args.append("--enable-languages=c") + gcc_configure_args.append("--disable-multilib") + # We build the stage1 gcc without shared libraries. Otherwise its + # libgcc.so would depend on the system libc.so, which causes problems + # when it tries to use that libgcc.so and the libc we are about to + # build. + gcc_configure_args.append("--disable-shared") else: gcc_configure_args.append("--enable-languages=c,c++") build_package(gcc_source_dir, gcc_build_dir, gcc_configure_args) + + if is_stage_one: + # The glibc build system uses -lgcc_eh, but at least in this setup + # libgcc.a has all it needs. + d = tool_inst_dir + "/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/" + os.symlink(d + "libgcc.a", d + "libgcc_eh.a") + build_glibc({"CC" : tool_inst_dir + "/bin/gcc", "CXX" : tool_inst_dir + "/bin/g++"}, stage_dir, tool_inst_dir) diff --git a/build/unix/build-toolchain/glibc-deterministic.patch b/build/unix/build-toolchain/glibc-deterministic.patch new file mode 100644 index 00000000000..01f5295e914 --- /dev/null +++ b/build/unix/build-toolchain/glibc-deterministic.patch @@ -0,0 +1,36 @@ +diff -ru a/configure.in b/configure.in +--- a/configure.in 2011-01-17 23:34:07.000000000 -0500 ++++ b/configure.in 2012-01-25 20:40:27.919485606 -0500 +@@ -2230,6 +2230,7 @@ + fi + AC_SUBST(old_glibc_headers) + ++libc_cv_slibdir=${prefix}/lib64 + AC_SUBST(libc_cv_slibdir) + AC_SUBST(libc_cv_localedir) + AC_SUBST(libc_cv_sysconfdir) +diff -ru a/csu/Makefile b/csu/Makefile +--- a/csu/Makefile 2011-01-17 23:34:07.000000000 -0500 ++++ b/csu/Makefile 2012-01-23 13:58:28.957792633 -0500 +@@ -234,8 +234,7 @@ + if [ -z "$$os" ]; then \ + os=Linux; \ + fi; \ +- printf '"Compiled on a %s %s system on %s.\\n"\n' \ +- "$$os" "$$version" "`date +%Y-%m-%d`";; \ ++ ;; \ + *) ;; \ + esac; \ + files="$(all-Banner-files)"; \ +diff -ru a/nscd/nscd_stat.c b/nscd/nscd_stat.c +--- a/nscd/nscd_stat.c 2011-01-17 23:34:07.000000000 -0500 ++++ b/nscd/nscd_stat.c 2012-01-23 15:54:45.231607606 -0500 +@@ -38,7 +38,7 @@ + + + /* We use this to make sure the receiver is the same. */ +-static const char compilation[21] = __DATE__ " " __TIME__; ++static const char compilation[21] = "don't need this"; + + /* Statistic data for one database. */ + struct dbstat