From: Manuel L. <ma...@ro...> - 2007-03-19 11:02:53
|
Hi Paul, On Mon, Mar 19, 2007 at 05:33:30PM +0900, Paul Mundt wrote: > On Mon, Mar 19, 2007 at 09:27:57AM +0100, Manuel Lauss wrote: > > When I build linux with GCC-4.x and enable CONFIG_CC_OPTIMIZE_FOR_SIZE > > linking fails with this error: > > > > LD .tmp_vmlinux1 > > kernel/built-in.o: In function '__cmpxchg_called_with_bad_pointer' > > make[1]: *** [.tmp_vmlinux1] Error 1 > > make: *** [_all] Error 2 > > > > I tracked it to kernel/rtmutex.c, line 88: > > > > #define rt_mutex_cmpxchg(l,c,n) (cmpxchg(&l->owner, c, n) == c) > > > > Apparently the "size" input value passed to cmpxchg is > > neither 4, 2 or 1 (tried a few others too but not sizeof(struct task_struct)). > > Probably a compiler bug? (gcc-4.1.2, Gentoo) > > > Have you tried 8? This was a problem before in another path.. no change. I'll see if I can find out the exact number somehow... > Is CC_OPTIMIZE_FOR_SIZE the only thing you've set? You can try and avoid > the __HAVE_ARCH_CMPXCHG in the gcc4 case if you want to fix it up, but I > haven't hit this directly yet, so I'm hesitant to pull it in general for > something that looks like a single compiler issue. Yes; no funky debug options. Simply removing CC_OPTIMIZE_FOR_SIZE creates a booting kernel. > > Also, these exports need to be removed from sh_ksyms.c, they give > > "undefined reference" errors: > > __sdivsi3_i4i __udiv_qrnnd_16 __udivsi3_i4i > > > Interesting. We'll kill those then. I'd also like to be rid of > __udivdi3_* while we're at it, can you verify whether that causes you > problems or not? I removed all from __udivsi3 to __movstrSI16, no problems with GCC3 and 4. Thanks, -- Manuel Lauss |