From 443f51a2dcaec99457e5797758c65e5c6c1d3664 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 2 Oct 2009 22:10:38 +0200 Subject: libc/glibc: fix building for seemingly native toolchains Build glibc with -O2 as a fix/workaround to building seemingly-native toolchains. See: - docs/overview.txt - docs/known-issues.txt - http://sourceware.org/ml/crossgcc/2009-09/msg00055.html diff --git a/docs/known-issues.txt b/docs/known-issues.txt index 3c7eaab..757939f 100644 --- a/docs/known-issues.txt +++ b/docs/known-issues.txt @@ -51,8 +51,10 @@ Fix: None known. Workaround: - If this happens for you, stick with glibc-2.6.1 for now. - Or investigate! :-) + It seems that using -O2 in the CFLAGS fixes the problem. It has been + confirmed in the following threads: + http://sourceware.org/ml/crossgcc/2009-09/msg00055.html (for glibc) + http://sourceware.org/ml/crossgcc/2009-10/msg00001.html (for eglibc) -------------------------------- Symptoms: diff --git a/docs/overview.txt b/docs/overview.txt index 3b100a1..8d9a6f0 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -28,6 +28,7 @@ Running crosstool-NG Tools wrapper Using the toolchain Toolchain types + Seemingly-native toolchains Internals Makefile front-end Kconfig parser @@ -590,6 +591,21 @@ anyway!) were all being hashed out, Canada had three national political parties. http://en.wikipedia.org/wiki/Cross_compiler +Seemingly-native toolchains | +----------------------------+ + +Seemingly-native toolchains are toolchains that target the same architecture +as the one it is built on, and on which it will run, but the machine tuple +may be different (eg i686 vs. i386, or x86_64-unknown-linux-gnu vs. +x86_64-pc-linux-gnu). This also applies if the target architecture is of the +same kind (eg. x86 vs. x86_64, or ppc vs. ppc64). + +Such toolchain is tricky to build, as the configure scripts may incorrectly +assume that files (headers and libs) from the build (or host) machine can be +used by the cross-compiler it is going to build. The problem seems to arise +only with glibc (and eglibc?) starting with version 2.7. + + _____________ / Internals / diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index a83fb25..0f60bd1 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -180,7 +180,7 @@ do_libc_headers() { libc_cv_ppc_machine=yes \ CT_DoExecLog ALL \ - make CFLAGS="-O -DBOOTSTRAP_GCC" \ + make CFLAGS="-O2 -DBOOTSTRAP_GCC" \ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ PARALLELMFLAGS="${PARALLELMFLAGS}" \ sysdeps/gnu/errlist.c @@ -197,7 +197,7 @@ do_libc_headers() { CT_DoExecLog ALL \ make cross-compiling=yes \ install_root=${CT_SYSROOT_DIR} \ - CFLAGS="-O -DBOOTSTRAP_GCC" \ + CFLAGS="-O2 -DBOOTSTRAP_GCC" \ ${LIBC_SYSROOT_ARG} \ OBJDUMP_FOR_HOST="${CT_TARGET}-objdump" \ PARALLELMFLAGS="${PARALLELMFLAGS}" \ @@ -325,7 +325,7 @@ do_libc_start_files() { # Please see the comment for the configure step in do_libc(). BUILD_CC="${CT_BUILD}-gcc" \ - CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O " \ + CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O2" \ CC="${cross_cc} ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \ AR=${CT_TARGET}-ar \ RANLIB=${CT_TARGET}-ranlib \ @@ -457,7 +457,7 @@ do_libc() { # silly messages. GNU folks again, he? BUILD_CC="${CT_BUILD}-gcc" \ - CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \ + CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O2" \ CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \ AR=${CT_TARGET}-ar \ RANLIB=${CT_TARGET}-ranlib \ -- cgit v0.10.2-6-g49f6 From 399a88364fc3ae6555d90a8ccb47feb6d2efaf53 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 2 Oct 2009 22:10:17 +0200 Subject: libc/eglibc: fix building for seemingly native toolchains Build eglibc with -O2 as a fix/workaround to building seemingly-native toolchains (see docs/overview.txt). See: - docs/overview.txt - docs/known-issues.txt - http://sourceware.org/ml/crossgcc/2009-10/msg00001.html diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh index 340a02f..e2bd37b 100644 --- a/scripts/build/libc/eglibc.sh +++ b/scripts/build/libc/eglibc.sh @@ -252,7 +252,7 @@ do_libc() { CT_DoLog DEBUG "Extra CC args passed : '${extra_cc_args}'" BUILD_CC="${CT_BUILD}-gcc" \ - CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O" \ + CFLAGS="${CT_TARGET_CFLAGS} ${CT_LIBC_GLIBC_EXTRA_CFLAGS} -O2" \ CC="${CT_TARGET}-gcc ${CT_LIBC_EXTRA_CC_ARGS} ${extra_cc_args}" \ AR=${CT_TARGET}-ar \ RANLIB=${CT_TARGET}-ranlib \ -- cgit v0.10.2-6-g49f6 From 947df3a503aa3c0dc8b6ad3cfa37f5f8b076e984 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 3 Oct 2009 16:53:05 +0200 Subject: sample: update the i686-nptl-linux-gnu sample Update this sample, now it seems to correctly build again. diff --git a/samples/i686-nptl-linux-gnu/crosstool.config b/samples/i686-nptl-linux-gnu/crosstool.config index 993ecf0..517c46d 100644 --- a/samples/i686-nptl-linux-gnu/crosstool.config +++ b/samples/i686-nptl-linux-gnu/crosstool.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# crosstool-NG version: hg_default@1525_c1ee688c24da -# Fri Sep 11 16:36:56 2009 +# crosstool-NG version: hg_default@1552_6ee673ab382e +# Sat Oct 3 16:22:40 2009 # # @@ -162,35 +162,34 @@ CT_BUILD_SUFFIX="" # CT_BARE_METAL is not set CT_KERNEL_SUPPORTS_SHARED_LIBS=y CT_KERNEL="linux" -CT_KERNEL_VERSION="2.6.29" +CT_KERNEL_VERSION="2.6.31.1" # CT_KERNEL_bare_metal is not set CT_KERNEL_linux=y CT_KERNEL_LINUX_INSTALL=y CT_KERNEL_LINUX_INSTALL_CHECK=y -# CT_KERNEL_V_2_6_18_8 is not set -# CT_KERNEL_V_2_6_19_7 is not set -# CT_KERNEL_V_2_6_20_21 is not set -# CT_KERNEL_V_2_6_21_7 is not set -# CT_KERNEL_V_2_6_22_19 is not set -# CT_KERNEL_V_2_6_23_17 is not set -# CT_KERNEL_V_2_6_24_7 is not set -# CT_KERNEL_V_2_6_25_20 is not set -# CT_KERNEL_V_2_6_26_8 is not set -# CT_KERNEL_V_2_6_27_31 is not set -# CT_KERNEL_V_2_6_28_10 is not set -CT_KERNEL_V_2_6_29=y -# CT_KERNEL_V_2_6_29_1 is not set -# CT_KERNEL_V_2_6_29_2 is not set -# CT_KERNEL_V_2_6_29_3 is not set -# CT_KERNEL_V_2_6_29_4 is not set -# CT_KERNEL_V_2_6_29_5 is not set -# CT_KERNEL_V_2_6_29_6 is not set -# CT_KERNEL_V_2_6_30 is not set -# CT_KERNEL_V_2_6_30_1 is not set -# CT_KERNEL_V_2_6_30_2 is not set -# CT_KERNEL_V_2_6_30_3 is not set -# CT_KERNEL_V_2_6_30_4 is not set +CT_KERNEL_V_2_6_31_1=y +# CT_KERNEL_V_2_6_31 is not set +# CT_KERNEL_V_3_6_30_8 is not set +# CT_KERNEL_V_3_6_30_7 is not set +# CT_KERNEL_V_2_6_30_6 is not set # CT_KERNEL_V_2_6_30_5 is not set +# CT_KERNEL_V_2_6_30_4 is not set +# CT_KERNEL_V_2_6_30_3 is not set +# CT_KERNEL_V_2_6_30_2 is not set +# CT_KERNEL_V_2_6_30_1 is not set +# CT_KERNEL_V_2_6_30 is not set +# CT_KERNEL_V_2_6_29_6 is not set +# CT_KERNEL_V_2_6_28_10 is not set +# CT_KERNEL_V_2_6_27_35 is not set +# CT_KERNEL_V_2_6_26_8 is not set +# CT_KERNEL_V_2_6_25_20 is not set +# CT_KERNEL_V_2_6_24_7 is not set +# CT_KERNEL_V_2_6_23_17 is not set +# CT_KERNEL_V_2_6_22_19 is not set +# CT_KERNEL_V_2_6_21_7 is not set +# CT_KERNEL_V_2_6_20_21 is not set +# CT_KERNEL_V_2_6_19_7 is not set +# CT_KERNEL_V_2_6_18_8 is not set # CT_KERNEL_V_select is not set CT_KERNEL_LINUX_VERBOSITY_0=y # CT_KERNEL_LINUX_VERBOSITY_1 is not set @@ -213,25 +212,25 @@ CT_ARCH_BINFMT_ELF=y # GNU binutils # CT_BINUTILS_VERSION="2.19.1" -# CT_BINUTILS_V_2_14 is not set -# CT_BINUTILS_V_2_15 is not set -# CT_BINUTILS_V_2_16_1 is not set -# CT_BINUTILS_V_2_17 is not set -# CT_BINUTILS_V_2_18 is not set -# CT_BINUTILS_V_2_18_50_0_4 is not set -# CT_BINUTILS_V_2_18_50_0_6 is not set -# CT_BINUTILS_V_2_18_50_0_7 is not set -# CT_BINUTILS_V_2_18_50_0_8 is not set -# CT_BINUTILS_V_2_18_50_0_9 is not set -# CT_BINUTILS_V_2_18_90 is not set -# CT_BINUTILS_V_2_18_91 is not set -# CT_BINUTILS_V_2_18_92 is not set -# CT_BINUTILS_V_2_18_93 is not set -# CT_BINUTILS_V_2_19 is not set -CT_BINUTILS_V_2_19_1=y -# CT_BINUTILS_V_2_19_50_0_1 is not set -# CT_BINUTILS_V_2_19_51_0_1 is not set # CT_BINUTILS_V_2_19_51_0_2 is not set +# CT_BINUTILS_V_2_19_51_0_1 is not set +# CT_BINUTILS_V_2_19_50_0_1 is not set +CT_BINUTILS_V_2_19_1=y +# CT_BINUTILS_V_2_19 is not set +# CT_BINUTILS_V_2_18_93 is not set +# CT_BINUTILS_V_2_18_92 is not set +# CT_BINUTILS_V_2_18_91 is not set +# CT_BINUTILS_V_2_18_90 is not set +# CT_BINUTILS_V_2_18_50_0_9 is not set +# CT_BINUTILS_V_2_18_50_0_8 is not set +# CT_BINUTILS_V_2_18_50_0_7 is not set +# CT_BINUTILS_V_2_18_50_0_6 is not set +# CT_BINUTILS_V_2_18_50_0_4 is not set +# CT_BINUTILS_V_2_18 is not set +# CT_BINUTILS_V_2_17 is not set +# CT_BINUTILS_V_2_16_1 is not set +# CT_BINUTILS_V_2_15 is not set +# CT_BINUTILS_V_2_14 is not set CT_BINUTILS_EXTRA_CONFIG="" CT_BINUTILS_FOR_TARGET=y CT_BINUTILS_FOR_TARGET_IBERTY=y @@ -243,29 +242,29 @@ CT_BINUTILS_FOR_TARGET_BFD=y CT_CC="gcc" CT_CC_VERSION="4.3.2" CT_CC_gcc=y -# CT_CC_V_3_2_3 is not set -# CT_CC_V_3_3_6 is not set -# CT_CC_V_3_4_6 is not set -# CT_CC_V_4_0_0 is not set -# CT_CC_V_4_0_1 is not set -# CT_CC_V_4_0_2 is not set -# CT_CC_V_4_0_3 is not set -# CT_CC_V_4_0_4 is not set -# CT_CC_V_4_1_0 is not set -# CT_CC_V_4_1_1 is not set -# CT_CC_V_4_1_2 is not set -# CT_CC_V_4_2_0 is not set -# CT_CC_V_4_2_1 is not set -# CT_CC_V_4_2_2 is not set -# CT_CC_V_4_2_3 is not set -# CT_CC_V_4_2_4 is not set -# CT_CC_V_4_3_0 is not set -# CT_CC_V_4_3_1 is not set -CT_CC_V_4_3_2=y -# CT_CC_V_4_3_3 is not set -# CT_CC_V_4_3_4 is not set -# CT_CC_V_4_4_0 is not set # CT_CC_V_4_4_1 is not set +# CT_CC_V_4_4_0 is not set +# CT_CC_V_4_3_4 is not set +# CT_CC_V_4_3_3 is not set +CT_CC_V_4_3_2=y +# CT_CC_V_4_3_1 is not set +# CT_CC_V_4_3_0 is not set +# CT_CC_V_4_2_4 is not set +# CT_CC_V_4_2_3 is not set +# CT_CC_V_4_2_2 is not set +# CT_CC_V_4_2_1 is not set +# CT_CC_V_4_2_0 is not set +# CT_CC_V_4_1_2 is not set +# CT_CC_V_4_1_1 is not set +# CT_CC_V_4_1_0 is not set +# CT_CC_V_4_0_4 is not set +# CT_CC_V_4_0_3 is not set +# CT_CC_V_4_0_2 is not set +# CT_CC_V_4_0_1 is not set +# CT_CC_V_4_0_0 is not set +# CT_CC_V_3_4_6 is not set +# CT_CC_V_3_3_6 is not set +# CT_CC_V_3_2_3 is not set CT_CC_GCC_4_3_or_later=y # CT_CC_GCC_4_4_or_later is not set CT_CC_CXA_ATEXIT=y @@ -301,14 +300,14 @@ CT_LIBC_VERSION="2.9" CT_LIBC_glibc=y # CT_LIBC_newlib is not set # CT_LIBC_uClibc is not set -# CT_LIBC_V_2_3_6 is not set -# CT_LIBC_V_2_5 is not set -# CT_LIBC_V_2_5_1 is not set -# CT_LIBC_V_2_6 is not set -# CT_LIBC_V_2_6_1 is not set -# CT_LIBC_V_2_7 is not set -# CT_LIBC_V_2_8 is not set CT_LIBC_V_2_9=y +# CT_LIBC_V_2_8 is not set +# CT_LIBC_V_2_7 is not set +# CT_LIBC_V_2_6_1 is not set +# CT_LIBC_V_2_6 is not set +# CT_LIBC_V_2_5_1 is not set +# CT_LIBC_V_2_5 is not set +# CT_LIBC_V_2_3_6 is not set # CT_LIBC_V_LATEST is not set # CT_LIBC_V_date is not set CT_LIBC_GLIBC_2_8_or_later=y @@ -327,7 +326,7 @@ CT_LIBC_ADDONS_LIST="" # CT_LIBC_GLIBC_KERNEL_VERSION_NONE is not set CT_LIBC_GLIBC_KERNEL_VERSION_AS_HEADERS=y # CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN is not set -CT_LIBC_GLIBC_MIN_KERNEL="2.6.29" +CT_LIBC_GLIBC_MIN_KERNEL="2.6.31.1" # # Common C library options @@ -343,17 +342,17 @@ CT_THREADS_NPTL=y # Debug facilities # CT_DEBUG_dmalloc=y -# CT_DMALLOC_V_5_4_3 is not set CT_DMALLOC_V_5_5_2=y +# CT_DMALLOC_V_5_4_3 is not set CT_DMALLOC_VERSION="5.5.2" CT_DEBUG_duma=y CT_DUMA_A=y CT_DUMA_SO=y -# CT_DUMA_V_2_5_1 is not set -# CT_DUMA_V_2_5_8 is not set -# CT_DUMA_V_2_5_12 is not set -CT_DUMA_V_2_5_14=y # CT_DUMA_V_2_5_15 is not set +CT_DUMA_V_2_5_14=y +# CT_DUMA_V_2_5_12 is not set +# CT_DUMA_V_2_5_8 is not set +# CT_DUMA_V_2_5_1 is not set CT_DUMA_VERSION="2_5_14" CT_DEBUG_gdb=y CT_GDB_CROSS=y @@ -363,42 +362,42 @@ CT_GDB_NATIVE=y CT_GDB_NATIVE_USE_GMP_MPFR=y CT_GDB_GDBSERVER=y CT_GDB_GDBSERVER_STATIC=y -# CT_GDB_V_6_4 is not set -# CT_GDB_V_6_5 is not set -# CT_GDB_V_6_6 is not set -# CT_GDB_V_6_7 is not set -# CT_GDB_V_6_7_1 is not set CT_GDB_V_6_8=y +# CT_GDB_V_6_7_1 is not set +# CT_GDB_V_6_7 is not set +# CT_GDB_V_6_6 is not set +# CT_GDB_V_6_5 is not set +# CT_GDB_V_6_4 is not set # CT_GDB_V_snapshot is not set CT_GDB_VERSION="6.8" # # Native gdb needs a native ncurses library # -# CT_NCURSES_V_5_6 is not set CT_NCURSES_V_5_7=y +# CT_NCURSES_V_5_6 is not set CT_NCURSES_VERSION="5.7" CT_DEBUG_ltrace=y -# CT_LTRACE_V_0_4 is not set -CT_LTRACE_V_0_5=y -# CT_LTRACE_V_0_5_1 is not set # CT_LTRACE_V_0_5_2 is not set +# CT_LTRACE_V_0_5_1 is not set +CT_LTRACE_V_0_5=y +# CT_LTRACE_V_0_4 is not set CT_LTRACE_VERSION="0.5" CT_DEBUG_strace=y -# CT_STRACE_V_4_5 is not set -# CT_STRACE_V_4_5_14 is not set -# CT_STRACE_V_4_5_15 is not set -# CT_STRACE_V_4_5_16 is not set -CT_STRACE_V_4_5_17=y # CT_STRACE_V_4_5_18 is not set +CT_STRACE_V_4_5_17=y +# CT_STRACE_V_4_5_16 is not set +# CT_STRACE_V_4_5_15 is not set +# CT_STRACE_V_4_5_14 is not set +# CT_STRACE_V_4_5 is not set CT_STRACE_VERSION="4.5.17" # # Tools facilities # CT_TOOL_libelf=y -CT_LIBELF_V_0_8_10=y # CT_LIBELF_V_0_8_11 is not set +CT_LIBELF_V_0_8_10=y CT_LIBELF_VERSION="0.8.10" CT_TOOL_sstrip=y CT_SSTRIP_BUILDROOT=y @@ -410,15 +409,15 @@ CT_SSTRIP_FROM="buildroot" # CT_WRAPPER_NEEDED=y CT_GMP_MPFR=y -# CT_GMP_V_4_2_2 is not set -CT_GMP_V_4_2_4=y -# CT_GMP_V_4_3_0 is not set # CT_GMP_V_4_3_1 is not set +# CT_GMP_V_4_3_0 is not set +CT_GMP_V_4_2_4=y +# CT_GMP_V_4_2_2 is not set CT_GMP_VERSION="4.2.4" -# CT_MPFR_V_2_3_1 is not set -# CT_MPFR_V_2_3_2 is not set -# CT_MPFR_V_2_4_0 is not set CT_MPFR_V_2_4_1=y +# CT_MPFR_V_2_4_0 is not set +# CT_MPFR_V_2_3_2 is not set +# CT_MPFR_V_2_3_1 is not set CT_MPFR_VERSION="2.4.1" # CT_PPL_CLOOG_MPC is not set -- cgit v0.10.2-6-g49f6 From c3b2d932d8d4dd5b89de505a724f3fc42600e456 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 3 Oct 2009 17:09:18 +0200 Subject: debug/gdb: cleanup (remove) the static ncurses build ncurses is built solely for the sake of building a native gdb. The user should not rely on this library to build his/her userland, but should rather build his/her own. So we remove it from the sysroot after we successfully build the native gdb. diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 9207ca7..d9f2439 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -265,6 +265,10 @@ do_debug_gdb_build() { unset ac_cv_func_strncmp_works + CT_DoLog EXTRA "Cleaning up ncurses" + cd "${CT_BUILD_DIR}/build-ncurses" + CT_DoExecLog ALL make DESTDIR="${CT_SYSROOT_DIR}" uninstall + CT_EndStep # native gdb build fi -- cgit v0.10.2-6-g49f6 From 1e1f247accfb508c7094294627f6f0b765b2da18 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 3 Oct 2009 17:23:17 +0200 Subject: doc: update documentation, mostly eye-candy diff --git a/README b/README index 4fe8d88..560d3d0 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ TABLE OF CONTENT / ________________/ - GETTING STARTED - - PARTICIPATING + - CONTRIBUTING - Sending a bug report - Sending patches - CREDITS @@ -22,6 +22,7 @@ You can find a (terse and WIP) documentation in docs/overview.txt. You can also point your browser to http://ymorin.is-a-geek.org/projects/crosstool + CONTRIBUTING / ____________/ @@ -87,11 +88,13 @@ Here's a typical hacking session: Note: replace' (at) ' above with a plain '@'. + CREDITS / _______/ The people that helped are listed in docs/CREDITS. Many thanks to them! :-) + KNOWN ISSUES / ____________/ diff --git a/docs/overview.txt b/docs/overview.txt index 8d9a6f0..61b4cba 100644 --- a/docs/overview.txt +++ b/docs/overview.txt @@ -27,6 +27,7 @@ Running crosstool-NG Note on // jobs Tools wrapper Using the toolchain + The 'populate' script Toolchain types Seemingly-native toolchains Internals @@ -155,11 +156,9 @@ Stay in the directory holding the sources, and run: See below for complete usage. -Now, provided you checked-out the code, you can send me your interesting changes -by running: - svn diff - -and mailing me the result! :-P +Now, provided you used a clone of the repository, you can send me your changes. +See the file README, at the top of crosstool-NG source, for how to submit +changees. Preparing for packaging | ------------------------+ -- cgit v0.10.2-6-g49f6