diff mbox

cc/gcc: fix gcc 4.8 build for C library without threads support

Message ID 309df93f4354c80e05c9.1388743085@i7sb.local
State Accepted
Commit 6bf3336283c2
Headers show

Commit Message

Niels Penneman Jan. 3, 2014, 9:58 a.m. UTC
# HG changeset patch
# User Niels Penneman <niels@penneman.org>
# Date 1388743068 -3600
#      Fri Jan 03 10:57:48 2014 +0100
# Node ID 309df93f4354c80e05c950ded710d111c50d7b26
# Parent  8e2077dfc250877b2182f31cac97bd1292e01026
cc/gcc: fix gcc 4.8 build for C library without threads support
Signed-off-by: Niels Penneman <niels@penneman.org>


--
For unsubscribe information see http://sourceware.org/lists.html#faq

Comments

Yann E. MORIN Jan. 3, 2014, 11:30 a.m. UTC | #1
Niels, All,

Your patch:
    cc/gcc: fix gcc 4.8 build for C library without threads support

has been applied as: #6bf3336283c2
    http://crosstool-ng.org/hg/crosstool-ng/rev/6bf3336283c2

Thank you!

Regards,
Yann E. MORIN.



--
For unsubscribe information see http://sourceware.org/lists.html#faq
Yann E. MORIN Jan. 3, 2014, 11:39 a.m. UTC | #2
Niels, All,

On 2014-01-03 10:58 +0100, Niels Penneman spake thusly:
> # HG changeset patch
> # User Niels Penneman <niels@penneman.org>
> # Date 1388743068 -3600
> #      Fri Jan 03 10:57:48 2014 +0100
> # Node ID 309df93f4354c80e05c950ded710d111c50d7b26
> # Parent  8e2077dfc250877b2182f31cac97bd1292e01026
> cc/gcc: fix gcc 4.8 build for C library without threads support
> Signed-off-by: Niels Penneman <niels@penneman.org>

Usually, we add an empty line after the subject. This scheme is canon
for DVCS (Hg, git) to separate the 'subject' from the 'body' of the
commit log, and display them correctly. That's a minor nit, I've fixed
it here.

Also, for this patch, the change is not obvious, so would have needed a
bit of explanations in the commit log, eg.:

    cc/gcc: fix gcc 4.8 build for C library without threads support

    libatomic calls the pthread primitives, which are not present if
    the C library lacks threads support, and the build breaks.

    In this case, just disable the build of libatomic.

    Signed-off-by: you@there

I had to look at libatomic to understand why it would not build without
threads. Granted, that was kind of easy, but not obvious.

In a commit log that fixes a problem, you have to explain:
  - what breaks
  - why it breaks
  - how you fixed it

Anyway, I've applied it nonetheless.

Thank you! :-)

Regards,
Yann E. MORIN.

> diff -r 8e2077dfc250 -r 309df93f4354 scripts/build/cc/gcc.sh
> --- a/scripts/build/cc/gcc.sh	Fri Jan 03 00:13:15 2014 +0100
> +++ b/scripts/build/cc/gcc.sh	Fri Jan 03 10:57:48 2014 +0100
> @@ -643,6 +643,11 @@
>      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
> 
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>
diff mbox

Patch

diff -r 8e2077dfc250 -r 309df93f4354 scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh	Fri Jan 03 00:13:15 2014 +0100
+++ b/scripts/build/cc/gcc.sh	Fri Jan 03 10:57:48 2014 +0100
@@ -643,6 +643,11 @@ 
     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