From: Paul M. <le...@li...> - 2007-03-19 08:36:31
|
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.. 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. You may also want to check with gcc-4.2.x. > 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? |