Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 340773 - cross-sparc64/glibc-2.11.2: unable to detect __thread support in toolchain
Summary: cross-sparc64/glibc-2.11.2: unable to detect __thread support in toolchain
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: Sparc64 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-12 23:12 UTC by Alex Buell
Modified: 2011-05-19 21:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
info (cross-sparc64-unknown-linux-gnu-info.log,15.57 KB, text/plain)
2010-10-12 23:12 UTC, Alex Buell
Details
glibc build log (cross-sparc64-unknown-linux-gnu-glibc.log,3.61 KB, text/plain)
2010-10-12 23:13 UTC, Alex Buell
Details
debug info as requested (glibc_output,469.95 KB, text/plain)
2010-10-14 08:38 UTC, Alex Buell
Details
new error (cross-sparc64-unknown-linux-gnu-info.log,15.57 KB, text/plain)
2010-10-14 21:41 UTC, Alex Buell
Details
new error (cross-sparc64-unknown-linux-gnu-glibc.log,15.53 KB, text/plain)
2010-10-14 21:41 UTC, Alex Buell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buell 2010-10-12 23:12:17 UTC
Crossdev fails to build cross-compiler toolchain for sparc64 on i686. The error is: 

>> Unpacking source...
 * Checking gcc for __thread support ...
 [ !! ]

 * Could not find a gcc that supports the __thread directive!
 * Please update your binutils/gcc and try again.
 * ERROR: cross-sparc64-unknown-linux-gnu/glibc-2.11.2 failed:
 *   No __thread support in gcc!
 *
Comment 1 Alex Buell 2010-10-12 23:12:49 UTC
Created attachment 250401 [details]
info
Comment 2 Alex Buell 2010-10-12 23:13:12 UTC
Created attachment 250403 [details]
glibc build log
Comment 3 Alex Buell 2010-10-12 23:13:40 UTC
 # crossdev -S sparc64
--------------------------------------------------------------------------------
 * crossdev version:      20101011
 * Host Portage ARCH:     x86
 * Target Portage ARCH:   sparc
 * Target System:         sparc64-unknown-linux-gnu
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[stable]
 * gcc:                   gcc-[stable]
 * headers:               linux-headers-[stable]
 * libc:                  glibc-[stable]

 * PORTDIR_OVERLAY:       /var/lib/layman/thebuell
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  
 * Forcing the latest versions of {binutils,gcc}-config/gnuconfig ...     [ ok ]
 * Log: /var/log/portage/cross-sparc64-unknown-linux-gnu-binutils.log
 * Emerging cross-binutils ...                                            [ ok ]
 * Log: /var/log/portage/cross-sparc64-unknown-linux-gnu-linux-headers-quick.log
 * Emerging cross-linux-headers-quick ...                                 [ ok ]
 * Log: /var/log/portage/cross-sparc64-unknown-linux-gnu-glibc-headers.log
 * Emerging cross-glibc-headers ...                                       [ ok ]
 * Log: /var/log/portage/cross-sparc64-unknown-linux-gnu-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                          [ ok ]
 * Log: /var/log/portage/cross-sparc64-unknown-linux-gnu-linux-headers.log
 * Emerging cross-linux-headers ...                                       [ ok ]
 * Log: /var/log/portage/cross-sparc64-unknown-linux-gnu-glibc.log
 * Emerging cross-glibc ...

 * glibc failed :(
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-sparc64-unknown-linux-gnu-info.log
 * /var/log/portage/cross-sparc64-unknown-linux-gnu-glibc.log
Comment 4 SpanKY gentoo-dev 2010-10-14 01:37:29 UTC
run `emerge --debug cross-sparc64-unknown-linux-gnu/glibc` and post the output as an attachment
Comment 5 Alex Buell 2010-10-14 08:38:35 UTC
Created attachment 250539 [details]
debug info as requested
Comment 6 SpanKY gentoo-dev 2010-10-14 17:43:13 UTC
dropping this bit of code from glibc will probably fix things:

        sparc)
            # 2.3.6 should have tls support on sparc64
            # when using newer binutils
            case ${CTARGET/-*} in
                sparc64*) return 1 ;;
                *) return 0 ;;
            esac
        ;;
Comment 7 Alex Buell 2010-10-14 19:55:08 UTC
I'll try that out and let you know what happens. If it works, will a patch be making its way into portage? 
Comment 8 SpanKY gentoo-dev 2010-10-14 20:07:07 UTC
not until the history of the code in question is found.  i dont recall adding it, just propagating it.
Comment 9 Alex Buell 2010-10-14 20:19:29 UTC
which file (In reply to comment #6)
> dropping this bit of code from glibc will probably fix things:
> 
>         sparc)
>             # 2.3.6 should have tls support on sparc64
>             # when using newer binutils
>             case ${CTARGET/-*} in
>                 sparc64*) return 1 ;;
>                 *) return 0 ;;
>             esac
>         ;;
> 

In which file can I find this particular fragment? I can't find it even though I've grepped the contents of glibc and also looked at its ebuild :(
Comment 10 Alex Buell 2010-10-14 21:17:24 UTC
Found the file in question; it's in /usr/portage/sys-libs/glibc/files/eblits/common.eblit, sorry. Now to redact that code and see if it helps.
Comment 11 Alex Buell 2010-10-14 21:29:01 UTC
I've now got past that problem now it's thrown up another problem; seems sparc64-unknown-linux-gnu-gcc needs -mlong-double-128 support to build this glibc. 

Agghhhhh... ;)

Do I need to rebuild sparc64 stage1 gcc to include support for this? 
Comment 12 Alex Buell 2010-10-14 21:41:34 UTC
Created attachment 250621 [details]
new error
Comment 13 Alex Buell 2010-10-14 21:41:53 UTC
Created attachment 250623 [details]
new error
Comment 14 SpanKY gentoo-dev 2010-10-14 22:04:50 UTC
i have no idea.  i dont really use or are interested in sparc.  this is really an area you'll need to investigate and report back.
Comment 15 Alex Buell 2010-10-14 23:09:14 UTC
OK, will do. 
Comment 16 SpanKY gentoo-dev 2011-03-10 06:50:36 UTC
first added here with little documentation:

http://sources.gentoo.org/sys-libs/glibc/glibc-2.3.4.20050125-r1.ebuild?&r1=1.14&r2=1.15

then refined here:

http://sources.gentoo.org/sys-libs/glibc/glibc-2.3.5.ebuild?r1=1.3&r2=1.4

so it seems that it's just a test that was never dropped as sparc64 isnt heavily tested ...

http://sources.gentoo.org/sys-libs/glibc/files/eblits/common.eblit?r1=1.13&r2=1.14
Comment 17 Alex Buell 2011-05-19 21:18:41 UTC
Success, with 2.11.2 going stable on x86, glibc now builds OK for my i686 cross compilers hosted on SPARC. Unfortunately building stage2 now barfs. Will find the relevant bug for that and add to it.