From 3136ecb066a9f51bcdc795b0b940851c851f5d27 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 6 Sep 2009 17:58:05 +0200 Subject: tools wrapper: fix building Remove the build tools only after the wrapper is built. Use the corect C compiler to build the tools wrapper. Use the correct log level. --- scripts/build/internals.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index 093636ae..144cb873 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -8,9 +8,6 @@ do_finish() { CT_DoStep INFO "Cleaning-up the toolchain's directory" - CT_DoLog EXTRA "Removing access to the build system tools" - CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools" - if [ "${CT_BARE_METAL}" != "y" ]; then CT_DoLog EXTRA "Installing the populate helper" sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \ @@ -58,11 +55,11 @@ do_finish() { if [ "${CT_DEBUG_CT}" = "y" ]; then _t="" # If debugging crosstool-NG, don't strip the wrapper fi - CT_DoExecLog "${HOST_CC}" \ - -Wall -Wextra -Wunreachable-code -Werror \ - -O3 -static ${_t} \ - "${CT_LIB_DIR}/scripts/wrapper.c" \ - -o ".${CT_TARGET}-wrapper" + CT_DoExecLog DEBUG "${CT_HOST}-gcc" \ + -Wall -Wextra -Wunreachable-code -Werror \ + -O3 -static ${_t} \ + "${CT_LIB_DIR}/scripts/wrapper.c" \ + -o ".${CT_TARGET}-wrapper" ;; esac @@ -82,6 +79,9 @@ do_finish() { CT_Popd fi + CT_DoLog EXTRA "Removing access to the build system tools" + CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools" + # Remove the generated documentation files if [ "${CT_REMOVE_DOCS}" = "y" ]; then CT_DoLog EXTRA "Removing installed documentation" -- cgit v1.2.3 From 26b3a17f58e9af55a36d1455c2a61ca4f22225b3 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 12 Sep 2009 00:11:12 +0200 Subject: libc/eglibc: fix download Fix the test to check if download is forced. --- scripts/build/libc/eglibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/build') diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh index 245cda86..340a02f2 100644 --- a/scripts/build/libc/eglibc.sh +++ b/scripts/build/libc/eglibc.sh @@ -54,7 +54,7 @@ do_libc_get() { -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_linuxthreads}" \ -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_localedef}" \ -a -f "${CT_LOCAL_TARBALLS_DIR}/${eglibc_ports}" \ - "${CT_FORCE_DOWNLOAD}" != "y" \ + -a "${CT_FORCE_DOWNLOAD}" != "y" \ ]; then CT_DoLog DEBUG "Got 'eglibc-${CT_LIBC_VERSION}' from local storage" for file in ${eglibc} ${eglibc_linuxthreads} ${eglibc_localedef} ${eglibc_ports}; do -- cgit v1.2.3 From 414f639105293d3df3ec5cfc6f32edcd0f0b558f Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 12 Sep 2009 10:16:28 +0200 Subject: comp-libs/cloog: new versions have the version number in the dir name For CLooG/PPL 0.15.3, the directory name was simply cloog-ppl. For any later versions, the driectory name does have the version, such as cloog-ppl-0.15.4. --- scripts/build/companion_libs/cloog.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/build') diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh index 0e6d74fb..fae3f72d 100644 --- a/scripts/build/companion_libs/cloog.sh +++ b/scripts/build/companion_libs/cloog.sh @@ -18,8 +18,17 @@ do_cloog_get() { # Extract CLooG do_cloog_extract() { + local _t + CT_Extract "cloog-ppl-${CT_CLOOG_VERSION}" - CT_Pushd "${CT_SRC_DIR}/cloog-ppl" + + # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!) + # while versions 0.15.4 onward do have the version in the dirname. + case "${CT_CLOOG_VERSION}" in + 0.15.3) _t="";; + *) _t="-${CT_CLOOG_VERSION}";; + esac + CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}" CT_Patch "cloog-ppl-${CT_CLOOG_VERSION}" nochdir CT_Popd } -- cgit v1.2.3 From 028b9d1c98e2c96745f5c2ae5089076a17b96667 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 13 Sep 2009 12:25:33 +0200 Subject: comp-libs/cloog: fix building For CLooG/PPL 0.15.3, the directory name was simply cloog-ppl. For any later versions, the driectory name does have the version, such as cloog-ppl-0.15.4. --- scripts/build/companion_libs/cloog.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'scripts/build') diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh index fae3f72d..f6eb68a3 100644 --- a/scripts/build/companion_libs/cloog.sh +++ b/scripts/build/companion_libs/cloog.sh @@ -34,22 +34,31 @@ do_cloog_extract() { } do_cloog() { + local _t + + # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!) + # while versions 0.15.4 onward do have the version in the dirname. + case "${CT_CLOOG_VERSION}" in + 0.15.3) _t="";; + *) _t="-${CT_CLOOG_VERSION}";; + esac + mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl" cd "${CT_BUILD_DIR}/build-cloog-ppl" CT_DoStep INFO "Installing CLooG/ppl" CT_DoLog EXTRA "Configuring CLooG/ppl" - CFLAGS="${CT_CFLAGS_FOR_HOST}" \ - CT_DoExecLog ALL \ - "${CT_SRC_DIR}/cloog-ppl/configure" \ - --build=${CT_BUILD} \ - --host=${CT_HOST} \ - --prefix="${CT_PREFIX_DIR}" \ - --with-gmp="${CT_PREFIX_DIR}" \ - --with-ppl="${CT_PREFIX_DIR}" \ - --enable-shared \ - --disable-static \ + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/cloog-ppl${_t}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_HOST} \ + --prefix="${CT_PREFIX_DIR}" \ + --with-gmp="${CT_PREFIX_DIR}" \ + --with-ppl="${CT_PREFIX_DIR}" \ + --enable-shared \ + --disable-static \ --with-bits=gmp CT_DoLog EXTRA "Building CLooG/ppl" -- cgit v1.2.3 From b586e9ce7214b85e875ca608ea4bd7db1c4fe4e2 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 2 Oct 2009 00:04:24 +0200 Subject: libc/glibc: remove dead code The option to retrieve snapshots is already handled by the generic 'specific date' and 'use latest' entries. No need for a special case, as there's no code for it. --- config/libc/glibc.in | 10 ---------- scripts/build/libc/glibc.sh | 2 -- 2 files changed, 12 deletions(-) (limited to 'scripts/build') diff --git a/config/libc/glibc.in b/config/libc/glibc.in index 97d21c3e..3da40753 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -128,14 +128,4 @@ config LIBC_GLIBC_CVS_date endif # LIBC_GLIBC_CVS -#config LIBC_GLIBC_SNAPSHOT -# bool -# prompt "Use latest nightly snapshot" -# help -# See the help for the entry "Released tarball", above. -# -# If you can live with a moving code-base, say 'Y' here. -# If you want your toolchain to really be reproducible, look at the -# choice entry "Released tarball from FTP", above. - endchoice diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index a83fb253..2573da68 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -47,8 +47,6 @@ do_libc_get() { "glibc-${version}-branch${date:+:}${date}" \ "glibc-${addon}-cvs-${CT_LIBC_VERSION}" done -# elif [ "${CT_LIBC_GLIBC_SNAPSHOT}" = "y" ]; then -# : # Not yet handled... fi return 0 -- cgit v1.2.3 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 --- docs/known-issues.txt | 6 ++++-- docs/overview.txt | 16 ++++++++++++++++ scripts/build/libc/glibc.sh | 8 ++++---- 3 files changed, 24 insertions(+), 6 deletions(-) (limited to 'scripts/build') diff --git a/docs/known-issues.txt b/docs/known-issues.txt index 3c7eaab5..757939f2 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 3b100a18..8d9a6f04 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 a83fb253..0f60bd13 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 v1.2.3 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 --- scripts/build/libc/eglibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/build') diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh index 340a02f2..e2bd37b5 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 v1.2.3 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. --- scripts/build/debug/300-gdb.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/build') diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 9207ca7b..d9f2439f 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 v1.2.3 From d0c5d174bf933509d09656f050941bc465e25357 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 3 Oct 2009 18:19:39 +0200 Subject: libc/glibc: don't use legacy snapshots glibc snapshots have not been updated for about the past 5 months. Consider them to be deprecated, now. --- config/libc/glibc.in | 12 ------------ scripts/build/libc/glibc.sh | 12 ------------ 2 files changed, 24 deletions(-) (limited to 'scripts/build') diff --git a/config/libc/glibc.in b/config/libc/glibc.in index 3da40753..777657c2 100644 --- a/config/libc/glibc.in +++ b/config/libc/glibc.in @@ -49,21 +49,10 @@ config LIBC_V_2_3_6 prompt "2.3.6 (OBSOLETE)" depends on OBSOLETE -config LIBC_V_LATEST - bool - prompt "'latest' snapshot (EXPERIMENTAL)" - depends on EXPERIMENTAL - -config LIBC_V_date - bool - prompt " (EXPERIMENTAL)" - depends on EXPERIMENTAL - endchoice config LIBC_VERSION string - prompt "Enter date (YYYYMMDD)" if LIBC_V_date # Don't remove next line # CT_INSERT_VERSION_STRING_BELOW default "2.9" if LIBC_V_2_9 @@ -74,7 +63,6 @@ config LIBC_VERSION default "2.5.1" if LIBC_V_2_5_1 default "2.5" if LIBC_V_2_5 default "2.3.6" if LIBC_V_2_3_6 - default "latest" if LIBC_V_LATEST config LIBC_GLIBC_2_8_or_later bool diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 2573da68..8476bf8c 100644 --- a/scripts/build/libc/glibc.sh +++ b/scripts/build/libc/glibc.sh @@ -292,12 +292,6 @@ do_libc_start_files() { # Add some default CC args glibc_version_major=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^([[:digit:]]+).*/\1/') glibc_version_minor=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^[[:digit:]]+[\.-_]([[:digit:]]+).*/\1/') - # In case we're using a snapshot, fake a >=2.6 version. - if [ "${CT_LIBC_V_LATEST}" = "y" \ - -o "${CT_LIBC_V_date}" = "y" ]; then - glibc_version_major=3 - glibc_version_minor=0 - fi if [ ${glibc_version_major} -eq 2 -a ${glibc_version_minor} -ge 6 \ -o ${glibc_version_major} -gt 2 ]; then # Don't use -pipe: configure chokes on it for glibc >= 2.6. @@ -407,12 +401,6 @@ do_libc() { # Add some default CC args glibc_version_major=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^([[:digit:]]+).*/\1/') glibc_version_minor=$(echo ${CT_LIBC_VERSION} |sed -r -e 's/^[[:digit:]]+[\.-_]([[:digit:]]+).*/\1/') - # In case we're using a snapshot, fake a >=2.6 version. - if [ "${CT_LIBC_V_LATEST}" = "y" \ - -o "${CT_LIBC_V_date}" = "y" ]; then - glibc_version_major=3 - glibc_version_minor=0 - fi if [ ${glibc_version_major} -eq 2 -a ${glibc_version_minor} -ge 6 \ -o ${glibc_version_major} -gt 2 ]; then # Don't use -pipe: configure chokes on it for glibc >= 2.6. -- cgit v1.2.3