From 1838bb1f15ce7704f91f652f4d4c0887b876a786 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 31 Jan 2011 19:52:18 +0100 Subject: libc/glibc: add option to force unwind We make it an option, as not all combinations of architectures vs. compiler vs. glibc/eglibc exhibit the issue. Mostly visible on old glibc versions, it seems... This is a missing part from the glibc/eglibc merger... :-/ Signed-off-by: "Yann E. MORIN" diff --git a/config/libc/glibc-eglibc.in-common b/config/libc/glibc-eglibc.in-common index 7e4f267..a901e58 100644 --- a/config/libc/glibc-eglibc.in-common +++ b/config/libc/glibc-eglibc.in-common @@ -77,6 +77,21 @@ config LIBC_OLDEST_ABI If this option is not set, (e)glibc will choose for you. +config LIBC_GLIBC_FORCE_UNWIND + bool + prompt "Force unwind support (READ HELP!)" + default n + help + If your toolchain fails building while building the C library + start files, or the complete C library, with a message like: + configure: error: forced unwind support is required + + then you may try setting this to 'y'. Otherwise, leave it to 'n'. + + The issue seems to be related to building NPTL on old versions + of glibc (and possibly eglibc as well) on some architectures + (seen on s390, s390x and x86_64). + config LIBC_GLIBC_USE_PORTS bool prompt "Use the ports addon" diff --git a/scripts/build/libc/glibc-eglibc.sh-common b/scripts/build/libc/glibc-eglibc.sh-common index 9919015..c03fa11 100644 --- a/scripts/build/libc/glibc-eglibc.sh-common +++ b/scripts/build/libc/glibc-eglibc.sh-common @@ -29,6 +29,15 @@ do_libc_start_files() { CT_DoLog DEBUG "Using ar for target: '${cross_ar}'" CT_DoLog DEBUG "Using ranlib for target: '${cross_ranlib}'" + touch config.cache + if [ "${CT_LIBC_GLIBC_FORCE_UNWIND}" = "y" ]; then + echo "libc_cv_forced_unwind=yes" >>config.cache + echo "libc_cv_c_cleanup=yes" >>config.cache + fi + + # Pre-seed the configparms file with values from the config option + printf "${CT_LIBC_GLIBC_CONFIGPARMS}\n" > configparms + BUILD_CC="${CT_BUILD}-gcc" \ CC=${cross_cc} \ CXX=${cross_cxx} \ @@ -40,6 +49,7 @@ do_libc_start_files() { --with-headers="${CT_HEADERS_DIR}" \ --build="${CT_BUILD}" \ --host="${CT_TARGET}" \ + --cache-file="$(pwd)/config.cache" \ --disable-profile \ --without-gd \ --without-cvs \ @@ -173,6 +183,12 @@ do_libc() { extra_cc_args="${extra_cc_args} ${CT_ARCH_ENDIAN_OPT}" + touch config.cache + if [ "${CT_LIBC_GLIBC_FORCE_UNWIND}" = "y" ]; then + echo "libc_cv_forced_unwind=yes" >>config.cache + echo "libc_cv_c_cleanup=yes" >>config.cache + fi + # Pre-seed the configparms file with values from the config option printf "${CT_LIBC_GLIBC_CONFIGPARMS}\n" > configparms @@ -194,7 +210,7 @@ do_libc() { # Should this change in a future eglibc release, we'd better # directly mangle the generated scripts _after_ they get built, # or even after they get installed... eglibc is such a sucker... - echo "ac_cv_path_BASH_SHELL=/bin/bash" >config.cache + echo "ac_cv_path_BASH_SHELL=/bin/bash" >>config.cache # Configure with --prefix the way we want it on the target... # There are a whole lot of settings here. You'll probably want @@ -214,10 +230,10 @@ do_libc() { --prefix=/usr \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ + --cache-file="$(pwd)/config.cache" \ --without-cvs \ --disable-profile \ --without-gd \ - --cache-file=config.cache \ --with-headers="${CT_HEADERS_DIR}" \ "${extra_config[@]}" \ ${CT_LIBC_GLIBC_EXTRA_CONFIG} -- cgit v0.10.2-6-g49f6