Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 214765 - >=kernel-2.6.25 won't compile with current sparc toolchain
Summary: >=kernel-2.6.25 won't compile with current sparc toolchain
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Sparc64 Linux
: High normal (vote)
Assignee: Sparc Porters
URL: http://gcc.gnu.org/ml/gcc-help/2008-0...
Whiteboard:
Keywords:
: 245576 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-25 19:07 UTC by Raúl Porcel (RETIRED)
Modified: 2008-12-26 15:30 UTC (History)
8 users (show)

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


Attachments
sparc-biarch.dpatch (sparc-biarch.dpatch,2.51 KB, text/plain)
2008-03-25 21:23 UTC, Raúl Porcel (RETIRED)
Details
sparc-gcc.c (sparc-gcc.c,1.20 KB, text/plain)
2008-04-18 14:42 UTC, Raúl Porcel (RETIRED)
Details
patches to create profile 2008/experimental/multilib (gentoo-sparc-multilib-profile.tar.bz2,5.08 KB, application/octet-stream)
2008-05-16 20:44 UTC, Friedrich Oslage (RETIRED)
Details
gcc-4.3.2-r1 build.log (build.log.bz2,18.42 KB, application/octet-stream)
2008-12-26 14:07 UTC, Friedrich Oslage (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raúl Porcel (RETIRED) gentoo-dev 2008-03-25 19:07:57 UTC
http://marc.info/?l=linux-sparc&m=120638895101756

@toolchain: what we do?
Comment 1 Ferris McCormick (RETIRED) gentoo-dev 2008-03-25 19:18:38 UTC
For me, there seems to be a new "feature" with vanilla-sources-2.6.25_rcx which forces
make CROSS_COMPILE="/usr/bin/sparc64-unknown-linux-gnu-" ...
Comment 2 SpanKY gentoo-dev 2008-03-25 20:04:34 UTC
Ferris: there's no need to specify the full path

i dont really track sparc so i dont really know what the exact background is here, so i'm guessing ...

for the most common sparc case:
- userland is 32bit
- kernel is 64bit
- linux-2.6.25+ will not build with a 32bit toolchain anymore
- sparc systems require kgcc64 ebuild
- anyone building a sparc 64bit kernel needs to do (just like on mips) `make CROSS_COMPILE=sparc64-unknown-linux-gnu-`

that summary OK ?

or you guys/LKML could investigate changing the sparc makefile like so (obviously this is a hand typed example; expand for your needs):
-KBUILD_CFLAGS += -msome-magic-flag
+KBUILD_CFLAGS += $(call cc-option,-msome-magic-flag)
this assumes that your active `gcc` toolchain will of course be able to compile the kernel normally ...
Comment 3 Ferris McCormick (RETIRED) gentoo-dev 2008-03-25 20:29:34 UTC
Probably correct.  I just happened to notice that the makefile could no longer find the cross compiler.  So far as I know, the kernel would never build in 32-bit mode.
Comment 4 SpanKY gentoo-dev 2008-03-25 20:32:53 UTC
so the older kernels would automatically default to some sparc64-...- prefix ?

in other words, how is it working today for people ?
Comment 5 Raúl Porcel (RETIRED) gentoo-dev 2008-03-25 20:35:05 UTC
Some more info:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=54cd6ddec77b75e6926d73d263aec72255b24030
^^ This is the commit that broke it.

Regarding what you proposed, Mike, it already does that as of this commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=966d905634de4433cea465fdcea19503c4ae260f

You may be interested in what sparc kernel maintainer said here: http://marc.info/?l=linux-sparc&m=120640230127788&w=2
Comment 6 Ferris McCormick (RETIRED) gentoo-dev 2008-03-25 20:38:47 UTC
It worked for me until I did a rev bump to vanilla-sources-2.6.26_rc6 to see if I could find a kernel anywhere beyond 2.6.19 which did not panic at boot time.  And, in fact:

Linux polylepis 2.6.25-rc6 #3 SMP Tue Mar 25 19:29:22 UTC 2008 sparc64 sun4u TI UltraSparc III (Cheetah) GNU/Linux
Comment 7 Ferris McCormick (RETIRED) gentoo-dev 2008-03-25 20:40:10 UTC
(In reply to comment #5)
> Some more info:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=54cd6ddec77b75e6926d73d263aec72255b24030
> ^^ This is the commit that broke it.
> 
> Regarding what you proposed, Mike, it already does that as of this commit:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=966d905634de4433cea465fdcea19503c4ae260f
> 
> You may be interested in what sparc kernel maintainer said here:
> http://marc.info/?l=linux-sparc&m=120640230127788&w=2
> 

Actually, I agree that there is no reason at all not to let normal gcc accept '-m64' etc.
Comment 8 SpanKY gentoo-dev 2008-03-25 20:42:10 UTC
wrt the default sparc compiler supporting sparc64, that's really been up to the sparc team to maintain ... we've really only changed sparc related stuff as the sparc guys ask

i dont recall ever digging deeply into sparc internals, so you guys will have to make some suggestions

debian is about the only other sparc distribution worth a damn that i know of
Comment 9 Raúl Porcel (RETIRED) gentoo-dev 2008-03-25 21:23:25 UTC
Created attachment 147314 [details]
sparc-biarch.dpatch

This is what debian does, looks easy, doesn't it?
Comment 10 SpanKY gentoo-dev 2008-03-26 04:25:01 UTC
looks like when the sparc maintainer said "get out of the stone age", they actually meant "apply a bunch of changes which arent in upstream"

could you drop an e-mail to the gcc-help@gcc.gnu.org mailing list on the topic asking for more info ?  you dont need to subscribe to post ...
Comment 11 Raúl Porcel (RETIRED) gentoo-dev 2008-04-09 16:46:18 UTC
http://gcc.gnu.org/ml/gcc-help/2008-04/msg00121.html
Comment 12 SpanKY gentoo-dev 2008-04-10 04:34:35 UTC
thanks ... btw, you only need to specify the full path in CROSS_COMPILE only when the binary isnt in your PATH
Comment 13 Raúl Porcel (RETIRED) gentoo-dev 2008-04-10 18:07:50 UTC
(In reply to comment #12)
> btw, you only need to specify the full path in CROSS_COMPILE only
> when the binary isnt in your PATH
> 

I know, i just copied it from fmccor's post and didn't notice :)
Comment 14 Raúl Porcel (RETIRED) gentoo-dev 2008-04-18 14:42:31 UTC
Created attachment 150174 [details]
sparc-gcc.c

No answer so far.

I was googling for some info, and noticed that debian has the two compilers as well. However they seem to use a wrapper for using the 32bits or the 64 bits one. I'm attaching the wrapper included in the gcc package(gcc-defaults).
Comment 15 SpanKY gentoo-dev 2008-04-18 18:47:58 UTC
well that makes the guys' response on lkml even more stupid
Comment 16 Raúl Porcel (RETIRED) gentoo-dev 2008-05-01 11:03:20 UTC
So...what we do? Still no answer, what do you think about implementing something like attachment 150174 [details]?
Comment 17 Friedrich Oslage (RETIRED) gentoo-dev 2008-05-12 21:21:24 UTC
> looks like when the sparc maintainer said "get out of the stone age", they
> actually meant "apply a bunch of changes which arent in upstream"
they are in upstream now, he commited them 8 days ago:
http://gcc.gnu.org/ml/gcc-patches/2008-05/msg00204.html

this means with gcc 4.3.1 all we need to do to get a sparc-unknown-linux-gnu- that can do -m64 and defaults to -m32 is:
configure --host=sparc-unknown-linux-gnu --enable--targets=all


> I was googling for some info, and noticed that debian has the two compilers as
> well. However they seem to use a wrapper for using the 32bits or the 64 bits
> one.
lenny(testing) and sid(unstable) actually use multilib with "lib" for 32bit libs and "lib64" for 64bit libs. exactly what upstream gcc 4.3.1 does(or will do, it's not released afaik)
Comment 18 Friedrich Oslage (RETIRED) gentoo-dev 2008-05-16 20:44:37 UTC
Created attachment 153367 [details]
patches to create profile 2008/experimental/multilib

I backported the patch to 4.3.0 and wrote some patches to create a multilib profile, looks really good.

In my opinion introducing a multilib profile and introducing a wrapper for non-multilib profiles would be the best action.
Comment 19 Raúl Porcel (RETIRED) gentoo-dev 2008-06-09 10:54:22 UTC
Thoughts, Mike?
Comment 20 Raúl Porcel (RETIRED) gentoo-dev 2008-11-06 09:35:43 UTC
*** Bug 245576 has been marked as a duplicate of this bug. ***
Comment 21 SpanKY gentoo-dev 2008-12-07 19:58:36 UTC
sorry for the delay ... added the patch to cvs for 4.3.2-r1

this is the last one i received via e-mail ... assuming it's up to date ...

http://sources.gentoo.org/gentoo/src/patchsets/gcc/4.3.2/gentoo/80_all_sparc-biarch.patch?rev=1.1
Comment 22 Friedrich Oslage (RETIRED) gentoo-dev 2008-12-26 14:06:32 UTC
With revision 1.2 of this patch gcc-4.3.2-r1 doesn't compile on sparc.
I'll attach a full build.log in a few moments.

While revision 1.1 was fine, 1.2 removes the defines for GLIBC_DYNAMIC_LINKER* which don't seem to be in gcc/config/linux.h (at least grep can't find them).

Can you change gcc-4.3.2-patches-1.3.tar.bz2 to include revision 1.1 of the patch?
Comment 23 Friedrich Oslage (RETIRED) gentoo-dev 2008-12-26 14:07:15 UTC
Created attachment 176437 [details]
gcc-4.3.2-r1 build.log
Comment 24 SpanKY gentoo-dev 2008-12-26 14:45:50 UTC
yeah, i got a little overzealous, sorry about that

fixed now
Comment 25 Friedrich Oslage (RETIRED) gentoo-dev 2008-12-26 15:30:32 UTC
np, thanks for the quick fix, works fine now :)

to all those guys cc'ed:
If you want to try this read http://dev.gentoo.org/~bluebird/sparc-multilib/ but beware: it's experimental. It will still take some time until we announce it as stable on the gentoo-sparc mailing list ;)