Have the glibc build use the cross-objdump, rather than the host one.
On some distros (eg. Fedora), the native objdump can not interpret objects not for the native system, and thus fail.
This commit adds a new patch against glibc-2.7 that introduces OBJDUMP_FOR_HOST, wich, if set, overides the detected objdump.
Note: bizarely enough, glibc already has code to detect the cross-objdump, but that does not work for an unknown reason... :-(
/trunk/patches/glibc/2.7/220-objdump_for_host.patch | 13 13 0 0 +++++++++
/trunk/scripts/build/libc_glibc.sh | 37 21 16 0 +++++++++++++++------------
2 files changed, 34 insertions(+), 16 deletions(-)
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/glibc/2.7/220-objdump_for_host.patch Thu Jul 31 09:08:33 2008 +0000
1.3 @@ -0,0 +1,13 @@
1.4 +diff -durN glibc-2.7.orig/Makerules glibc-2.7/Makerules
1.5 +--- glibc-2.7.orig/Makerules 2007-08-26 04:18:03.000000000 +0200
1.6 ++++ glibc-2.7/Makerules 2008-07-28 15:17:27.000000000 +0200
1.7 +@@ -1203,6 +1203,9 @@
1.8 + # The include magic above causes those files to use this variable for flags.
1.9 + CPPFLAGS-nonlib = -DNOT_IN_libc=1
1.10 +
1.11 ++ifneq ($(OBJDUMP_FOR_HOST),)
1.12 ++OBJDUMP = $(OBJDUMP_FOR_HOST)
1.13 ++endif
1.14 +
1.15 + ifeq ($(versioning),yes)
1.16 + # Generate normalized lists of symbols, versions, and data sizes.
2.1 --- a/scripts/build/libc_glibc.sh Tue Jul 29 17:34:45 2008 +0000
2.2 +++ b/scripts/build/libc_glibc.sh Thu Jul 31 09:08:33 2008 +0000
2.3 @@ -122,9 +122,10 @@
2.4 # Note: BOOTSTRAP_GCC is used by:
2.5 # patches/glibc-2.3.5/glibc-mips-bootstrap-gcc-header-install.patch
2.6
2.7 - libc_cv_ppc_machine=yes \
2.8 - CT_DoExecLog ALL \
2.9 - make CFLAGS="-O -DBOOTSTRAP_GCC" \
2.10 + libc_cv_ppc_machine=yes \
2.11 + CT_DoExecLog ALL \
2.12 + make CFLAGS="-O -DBOOTSTRAP_GCC" \
2.13 + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
2.14 sysdeps/gnu/errlist.c
2.15 mkdir -p stdio-common
2.16
2.17 @@ -135,12 +136,13 @@
2.18 CT_DoExecLog ALL touch stdio-common/errlist-compat.c
2.19 fi
2.20 # Note: BOOTSTRAP_GCC (see above)
2.21 - libc_cv_ppc_machine=yes \
2.22 - CT_DoExecLog ALL \
2.23 - make cross-compiling=yes \
2.24 - install_root=${CT_SYSROOT_DIR} \
2.25 - CFLAGS="-O -DBOOTSTRAP_GCC" \
2.26 - ${LIBC_SYSROOT_ARG} \
2.27 + libc_cv_ppc_machine=yes \
2.28 + CT_DoExecLog ALL \
2.29 + make cross-compiling=yes \
2.30 + install_root=${CT_SYSROOT_DIR} \
2.31 + CFLAGS="-O -DBOOTSTRAP_GCC" \
2.32 + ${LIBC_SYSROOT_ARG} \
2.33 + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
2.34 install-headers
2.35
2.36 # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
2.37 @@ -287,7 +289,7 @@
2.38 #TODO: should check whether slibdir has been set in configparms to */lib64
2.39 # and copy the startfiles into the appropriate libdir.
2.40 CT_DoLog EXTRA "Building C library start files"
2.41 - CT_DoExecLog ALL make csu/subdir_lib
2.42 + CT_DoExecLog ALL make OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" csu/subdir_lib
2.43
2.44 CT_DoLog EXTRA "Installing C library start files"
2.45 if [ "${CT_USE_SYSROOT}" = "y" ]; then
2.46 @@ -441,13 +443,15 @@
2.47 # Note: LD and RANLIB needed by glibc-2.1.3's c_stub directory, at least on macosx
2.48 # No need for PARALLELMFLAGS here, Makefile already reads this environment variable
2.49 CT_DoLog EXTRA "Building C library"
2.50 - CT_DoExecLog ALL make LD=${CT_TARGET}-ld \
2.51 - RANLIB=${CT_TARGET}-ranlib \
2.52 + CT_DoExecLog ALL make LD=${CT_TARGET}-ld \
2.53 + RANLIB=${CT_TARGET}-ranlib \
2.54 + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
2.55 ${GLIBC_INITIAL_BUILD_RULE}
2.56
2.57 CT_DoLog EXTRA "Installing C library"
2.58 - CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \
2.59 - ${LIBC_SYSROOT_ARG} \
2.60 + CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \
2.61 + ${LIBC_SYSROOT_ARG} \
2.62 + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
2.63 ${GLIBC_INITIAL_INSTALL_RULE}
2.64
2.65 # This doesn't seem to work when building a crosscompiler,
2.66 @@ -503,8 +507,9 @@
2.67 CT_DoLog EXTRA "Installing missing C library components"
2.68 # note: should do full install and then fix linker scripts, but this is faster
2.69 for t in bin rootsbin sbin data others; do
2.70 - CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \
2.71 - ${LIBC_SYSROOT_ARG} \
2.72 + CT_DoExecLog ALL make install_root="${CT_SYSROOT_DIR}" \
2.73 + ${LIBC_SYSROOT_ARG} \
2.74 + OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \
2.75 install-${t}
2.76 done
2.77