diff mbox

Blackfin Buildroot toolchain issue

Message ID 20150317161320.50559502@free-electrons.com
State Not Applicable
Headers show

Commit Message

Thomas Petazzoni March 17, 2015, 3:13 p.m. UTC
Dear Gustavo Zacarias,

On Tue, 17 Mar 2015 12:08:16 -0300, Gustavo Zacarias wrote:

> There's this as well:
> https://bugs.busybox.net/show_bug.cgi?id=7921
> Which basically boils down to uclibc NPTL requiring TLS.
> I'll check for space savings to see if it makes sense for it to even be
> an option.

I think it might make sense to keep it a blind option so that we don't
do --enable-tls on architectures that don't have TLS support at all (if
that even exists).

I have something like that in one of my branches:

commit 2ea50f3887747d6b72d6b133806d8b3ff995fe4a
Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date:   Wed Mar 11 23:05:00 2015 +0100

    gcc: make TLS option a blind option
    
    The current BR2_GCC_ENABLE_TLS option can lead users to create a
    non-working configuration: if they choose uClibc with NPTL and disable
    TLS support. This is bug #7921.
    
    Since TLS support is really an internal thing, it doesn't make a lot
    of sense to have a visible option for this. Therefore, this commit
    turns it to a blind option: TLS support is enabled in the compiler if
    glibc, eglibc or uClibc NPTL are used, and is disabled otherwise.
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>



Thomas

Comments

Gustavo Zacarias March 17, 2015, 5:55 p.m. UTC | #1
On 03/17/2015 12:13 PM, Thomas Petazzoni wrote:

> Dear Gustavo Zacarias,
> 
> On Tue, 17 Mar 2015 12:08:16 -0300, Gustavo Zacarias wrote:
> 
>> There's this as well:
>> https://bugs.busybox.net/show_bug.cgi?id=7921
>> Which basically boils down to uclibc NPTL requiring TLS.
>> I'll check for space savings to see if it makes sense for it to even be
>> an option.
> 
> I think it might make sense to keep it a blind option so that we don't
> do --enable-tls on architectures that don't have TLS support at all (if
> that even exists).

If blackfin supports it, everyone does ;)

>  config BR2_GCC_ENABLE_TLS
> -       bool "Enable compiler tls support" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
> +       bool
>         default y
>         depends on BR2_PTHREADS_NATIVE || BR2_TOOLCHAIN_BUILDROOT_EGLIBC || BR2_TOOLCHAIN_BUILDROOT_GLIBC
> -       help
> -         Enable the compiler to generate code for accessing
> -         thread local storage variables

Makes sense, the previous conditions were flawed as blackfin showed us,
no nptl but tls was there just fine.
Regards.
Waldemar Brodkorb March 17, 2015, 9:34 p.m. UTC | #2
Hi,
Gustavo Zacarias wrote,

> On 03/17/2015 12:13 PM, Thomas Petazzoni wrote:
> 
> > Dear Gustavo Zacarias,
> > 
> > On Tue, 17 Mar 2015 12:08:16 -0300, Gustavo Zacarias wrote:
> > 
> >> There's this as well:
> >> https://bugs.busybox.net/show_bug.cgi?id=7921
> >> Which basically boils down to uclibc NPTL requiring TLS.
> >> I'll check for space savings to see if it makes sense for it to even be
> >> an option.
> > 
> > I think it might make sense to keep it a blind option so that we don't
> > do --enable-tls on architectures that don't have TLS support at all (if
> > that even exists).
> 
> If blackfin supports it, everyone does ;)

My opinion on this is, that there are systems supporting threads
with uClibc, which do not have TLS support. Linuxthreads.old does
not make use of TLS. When you build for coldfire or ARM noMMU, tls 
is not available and it should be disabled while configuring gcc.

I am wondering why Blackfin enables TLS without any NPTL support.

best regards
 Waldemar
Thomas Petazzoni March 17, 2015, 9:55 p.m. UTC | #3
Dear Waldemar Brodkorb,

On Tue, 17 Mar 2015 22:34:03 +0100, Waldemar Brodkorb wrote:

> My opinion on this is, that there are systems supporting threads
> with uClibc, which do not have TLS support. Linuxthreads.old does
> not make use of TLS. When you build for coldfire or ARM noMMU, tls 
> is not available and it should be disabled while configuring gcc.

Sure, but we don't have to make this an option. The plan is to enable
TLS only when available.

Best regards,

Thomas
Waldemar Brodkorb March 17, 2015, 11 p.m. UTC | #4
Hi,
Thomas Petazzoni wrote,

> Dear Waldemar Brodkorb,
> 
> On Tue, 17 Mar 2015 22:34:03 +0100, Waldemar Brodkorb wrote:
> 
> > My opinion on this is, that there are systems supporting threads
> > with uClibc, which do not have TLS support. Linuxthreads.old does
> > not make use of TLS. When you build for coldfire or ARM noMMU, tls 
> > is not available and it should be disabled while configuring gcc.
> 
> Sure, but we don't have to make this an option. The plan is to enable
> TLS only when available.

Yeah, that would be very good.

best regards
 Waldemar
diff mbox

Patch

diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index 1a5281c..120d4d8 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -109,12 +109,9 @@  config BR2_TOOLCHAIN_BUILDROOT_CXX
          your target system.
 
 config BR2_GCC_ENABLE_TLS
-       bool "Enable compiler tls support" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
+       bool
        default y
        depends on BR2_PTHREADS_NATIVE || BR2_TOOLCHAIN_BUILDROOT_EGLIBC || BR2_TOOLCHAIN_BUILDROOT_GLIBC
-       help
-         Enable the compiler to generate code for accessing
-         thread local storage variables
 
 config BR2_GCC_ENABLE_LTO
        bool "Enable compiler link-time-optimization support"