SH4 build failure - The return of `-lc'
Yann E. MORIN
yann.morin.1998@anciens.enib.fr
Wed Aug 11 08:23:00 GMT 2010
Arnaud, All,
On Wednesday 11 August 2010 002812 Arnaud Lacombe wrote:
> Speaking about that, I'd be interested to have some details about the
> `cc_core_pass_2' step.
> In particular, why do we need libgcc to be built ?
- NPTL requires TLS (Thread Local Storage)
- TLS is partly handled by gcc, partly by libc
- gcc handles TLS in libgcc_s
- libgcc_s requires proper crt{1,i,n}.o and dummy lib{c,m}.so for the target
So, gcc depends on lib C, and lib C depends on gcc. Chicken-n-egg problem.
So we have this convoluted sequence:
- kernel headers
- binutils
- cc-core-1
-> bare cross-compiler with no TLS, no nothing
- libc-headers
-> headers + start-files, no fancy stuff
- cc-core-2
-> bare cross-compiler with TLS
- libc
-> full libc with TLS+NPTL
- cc
-> full compiler, with multiple languages, TLS...
Old glibc-s with NPTL also required a final step after the full cc, and
once/when we get rid of those old versions, the libc-finish can go.
> There does not seem to be any details about it
> in docs/.
If you can beat me at putting the above into proper documentation,
then that'd be great! :-)
> The
> closest answer I can get so far is "Merge the NPTL stuff. [...]", from
> May 2007, which is... enlightening ;-)
Well, I hope the commit messages have been improving over time! :-)
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software Designer | \ / CAMPAIGN | ^ |
| --==< O_o >==-- '------------.-------: X AGAINST | /e\ There is no |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL | """ conspiracy. |
'------------------------------'-------'------------------'--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list