Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 323445 - cross-sparcv8/glibc: impossible to build for sparc32
Summary: cross-sparcv8/glibc: impossible to build for sparc32
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: Sparc Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 16:27 UTC by Quentin Casasnovas
Modified: 2016-01-16 08:19 UTC (History)
1 user (show)

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


Attachments
Proposed patch to add the feature to common.eblit (glibc-cross-sparcv8-enable.patch,1.49 KB, patch)
2010-06-10 16:28 UTC, Quentin Casasnovas
Details | Diff
gcc-stage1 build.log with sparcv8 target (cross-sparcv8-unknown-linux-gnu-gcc-stage1.log,287.08 KB, text/plain)
2010-06-20 12:01 UTC, Quentin Casasnovas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quentin Casasnovas 2010-06-10 16:27:35 UTC
No way to use crossdev for building a cross toolchain sparcv8 compliant: the glibc is built using the sparcv8plus ABI. 

People on #gentoo-sparc told me that sparc32 is not supported anymore in gentoo but, sparcv8 ABI is used in leon VHDL open source processors, which are more and more used in the embedded word. The support for those processors has been included upstream in linux kernel 2.6.33 so it may be a good idea to at least leave a way to build a cross toolchain for that ABI.



Reproducible: Always

Steps to Reproduce:
1. ABI="sparc32" crossdev -t sparc 
2. sparc-unknown-linux-gnu-gcc -mcpu=v8 hello_world.c -o hello_world
3. file hello_world

Actual Results:  
hello_world: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (used shared libs), for GNU/Linux 2.6.18, stripped

Expected Results:  
hello_world: ELF 32-bit MSB executable, SPARC, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
Comment 1 Quentin Casasnovas 2010-06-10 16:28:59 UTC
Created attachment 234873 [details, diff]
Proposed patch to add the feature to common.eblit

I don't know at all if it's the right way to proceed, but at least it permits me to create a cross toolchain that is able to cross compile for leon3 processors using sparcv8 ABI.
Comment 2 SpanKY gentoo-dev 2010-06-20 03:02:51 UTC
Comment on attachment 234873 [details, diff]
Proposed patch to add the feature to common.eblit

i dont want to introduce yet another magic ABI value.  the current CHOST munging done by sparc is crap imo (and always has been), but it predates me so ive left it alone.

if you want to support a sparcv8 target, then use a CHOST of sparcv8-...

perhaps we should take the current magic sparc crap in glibc and only do the munging when the CHOST matches sparc-*.  if it doesnt match that, we assume the user is doing something sane ...
Comment 3 Quentin Casasnovas 2010-06-20 11:58:07 UTC
(In reply to comment #2)
> (From update of attachment 234873 [details, diff])
> i dont want to introduce yet another magic ABI value.  the current CHOST
> munging done by sparc is crap imo (and always has been), but it predates me so
> ive left it alone.
> 
> if you want to support a sparcv8 target, then use a CHOST of sparcv8-...
> 
> perhaps we should take the current magic sparc crap in glibc and only do the
> munging when the CHOST matches sparc-*.  if it doesnt match that, we assume the
> user is doing something sane ...
> 

Yep you're right that would be a better way, but if I'm not wrong, when trying to 
$ crossdev -t sparcv8-...
gcc-stage1 doesn't compile. That's why in the first place I proposed that dirty quirck, maybe the good thing to do would be to fix that compile issue with gcc-stage1, and everything would be good.

I'll paste here the build.log as soon as I've reproduced the error, but if I remember well, it was a configure error, where gcc complains that it doesn't know the target sparcv8.
If this is the case, would you accept a patch that change the target from sparcv8 or sparc32 to sparc when compiling gcc ?
Comment 4 Quentin Casasnovas 2010-06-20 12:01:20 UTC
Created attachment 236039 [details]
gcc-stage1 build.log with sparcv8 target
Comment 5 SpanKY gentoo-dev 2016-01-16 08:19:24 UTC
i've finally sat down, absorbed this code, and rewrote it.  i think the result should work now -- we do not force sparcv9+ for sparc-* tuples unless your -mcpu settings match.  for sparcv7/sparcv8 builds, you probably shouldn't be using something like -mcpu=ultrasparc3, so this should be fine.

please let us know if it still fails for you.

http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f8a59c05ff00ddafbfbfffecdac6e71cf175fbd