Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-08 Thread Paul Mackerras
Kumar Gala writes: We'll hopefully this thread might spark either an explanation for why we aren't just linking libgcc in a statement that says we should and we can remove the code that implements libgcc functionality. I've just reviewed the code in the 32-bit and 64-bit PowerPC versions

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Scott Wood
On Fri, May 02, 2008 at 09:21:08AM -0500, Kumar Gala wrote: GCC 4.4.x looks to be adding support for generating out-of-line register saves/restores based on: http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01678.html This breaks the kernel build as we'd have to link with libgcc to get the

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Kumar Gala
On May 2, 2008, at 10:07 AM, Scott Wood wrote: On Fri, May 02, 2008 at 09:21:08AM -0500, Kumar Gala wrote: GCC 4.4.x looks to be adding support for generating out-of-line register saves/restores based on: http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01678.html This breaks the kernel build

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Segher Boessenkool
If someone using cutting edge toolchains for ppc64 could test and make sure if we enable CONFIG_CC_OPTIMIZE_FOR_SIZE things work that would be nice. Current linus tree + some more stuff + this patch, ppc64_defconfig, powerpc64-linux-gcc (GCC) 4.4.0 20080429 (experimental), builds just fine.

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Segher Boessenkool
brokenrecord Why don't we just link with libgcc? /brokenrecord Its something of a PITA to do that in the kernel at this point since we've duplicated libgcc functionality in it. I'm sure there are some historical reasons this wasn't done to start with. That's the same as saying that it

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Kumar Gala
On May 2, 2008, at 12:33 PM, Segher Boessenkool wrote: If someone using cutting edge toolchains for ppc64 could test and make sure if we enable CONFIG_CC_OPTIMIZE_FOR_SIZE things work that would be nice. Current linus tree + some more stuff + this patch, ppc64_defconfig,

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Kumar Gala
On May 2, 2008, at 12:34 PM, Segher Boessenkool wrote: brokenrecord Why don't we just link with libgcc? /brokenrecord Its something of a PITA to do that in the kernel at this point since we've duplicated libgcc functionality in it. I'm sure there are some historical reasons this wasn't

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Scott Wood
Kumar Gala wrote: On May 2, 2008, at 12:34 PM, Segher Boessenkool wrote: brokenrecord Why don't we just link with libgcc? /brokenrecord Its something of a PITA to do that in the kernel at this point since we've duplicated libgcc functionality in it. I'm sure there are some historical

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread David Miller
From: Kumar Gala [EMAIL PROTECTED] Date: Fri, 2 May 2008 16:34:13 -0500 We'll hopefully this thread might spark either an explanation for why we aren't just linking libgcc in a statement that says we should and we can remove the code that implements libgcc functionality. How would

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Scott Wood
David Miller wrote: If you link in libgcc, all of a sudden you have a whole new class of potential problems, don't do it. All it takes is one of these libgcc libcalls the kernel actually references, needing something else in libc, to make this exercise futile. What in libgcc references libc,

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread David Miller
From: Scott Wood [EMAIL PROTECTED] Date: Fri, 02 May 2008 16:45:45 -0500 David Miller wrote: If you link in libgcc, all of a sudden you have a whole new class of potential problems, don't do it. All it takes is one of these libgcc libcalls the kernel actually references, needing

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Scott Wood
David Miller wrote: The problem only occurs once you reference a function that references libc stuff, and those guys are just lucky so far. Yeah, lucky they don't need to reinvent the wheel every time the GCC/libgcc interface changes. :-) If GCC generates a call to a libgcc function that

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread David Miller
From: Scott Wood [EMAIL PROTECTED] Date: Fri, 02 May 2008 17:16:07 -0500 If GCC generates a call to a libgcc function that calls a libc function, I'd consider that a pretty serious bug, given that said libc function is likely to consist of GCC-generated code, which could call the same

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Scott Wood
David Miller wrote: From: Scott Wood [EMAIL PROTECTED] Date: Fri, 02 May 2008 17:16:07 -0500 If GCC generates a call to a libgcc function that calls a libc function, I'd consider that a pretty serious bug, given that said libc function is likely to consist of GCC-generated code, which could

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread David Miller
From: Scott Wood [EMAIL PROTECTED] Date: Fri, 02 May 2008 17:38:21 -0500 David Miller wrote: The kernel is a special environment. Therefore even if you start linking with libgcc, it is inevitable that you will need some changed local version for some of those routines in the kernel.

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Benjamin Herrenschmidt
On Fri, 2008-05-02 at 16:34 -0500, Kumar Gala wrote: On May 2, 2008, at 12:34 PM, Segher Boessenkool wrote: brokenrecord Why don't we just link with libgcc? /brokenrecord Its something of a PITA to do that in the kernel at this point since we've duplicated libgcc functionality in

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Benjamin Herrenschmidt
On Fri, 2008-05-02 at 14:42 -0700, David Miller wrote: From: Kumar Gala [EMAIL PROTECTED] Date: Fri, 2 May 2008 16:34:13 -0500 We'll hopefully this thread might spark either an explanation for why we aren't just linking libgcc in a statement that says we should and we can remove the

Re: [PATCH] [POWERPC] Fix kernel builds with newer gcc versions and -Os

2008-05-02 Thread Segher Boessenkool
What in libgcc references libc, and why isn't this a problem for Linux/ARM, Linux/SH, U-boot, and the many other libc-less programs that use libgcc? The problem only occurs once you reference a function that references libc stuff, and those guys are just lucky so far. The only calls to the