diff mbox

Fix gcc 4.8 build for C library without threads support

Message ID 52B80285.7070602@penneman.org
State Accepted
Headers show

Commit Message

Niels Penneman Dec. 23, 2013, 9:29 a.m. UTC
When building a toolchain with GCC 4.8 and a C library without threads
support, the configure phase for the final compiler will fail because
"libatomic requires pthreads support". When thread support is disabled
in the C library, libatomic should not be built.


--
diff mbox

Patch

diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index 9042dc0..623872e 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -643,6 +643,11 @@  do_cc_backend() {
     if [ -n "${CT_CC_ENABLE_CXX_FLAGS}" ]; then
         extra_config+=("--enable-cxx-flags=${CT_CC_ENABLE_CXX_FLAGS}")
     fi
+    if [ "${CT_CC_GCC_4_8_or_later}" = "y" ]; then
+        if [ "${CT_THREADS}" = "none" ]; then
+            extra_config+=(--disable-libatomic)
+        fi
+    fi
     if [ "${CT_CC_GCC_LIBMUDFLAP}" = "y" ]; then
         extra_config+=(--enable-libmudflap)
     else