From: Paul M. <le...@li...> - 2007-07-11 23:53:37
|
On Sat, Jul 07, 2007 at 02:26:56PM +0200, Manuel Lauss wrote: > Manuel Lauss wrote: > > Paul Mundt wrote: > >> On Mon, Mar 19, 2007 at 09:27:57AM +0100, Manuel Lauss wrote: > >>> Also, these exports need to be removed from sh_ksyms.c, they give > >>> "undefined reference" errors: > >>> __sdivsi3_i4i __udiv_qrnnd_16 __udivsi3_i4i > >>> > >> Ok, so removing these seems to be have created fallout all over the > >> place. Apparently it's just your GCC4 that seems to have problems with > >> these symbols, whereas the other ones really seem to want them. It looks > >> like we're going to have to narrow it down to the exact release in which > >> they vanished (I would guess 4.1.2, since 4.1.1 still wants them). > >> > >> akpm also suggests he has a 3.4.5 toolchain that needs these, which is > >> also very unusual. Do you have a tarball of your compiler somewhere so > >> it's easier to debug? > > > > __udiv_qrnnd_16 was introduced by this GCC PR: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28014 > > > > I'll test 4.2.0 next. > > Confirmed, 4.2.0 does not complain about undefined references. > > So maybe those defines should be made dependent on gcc >= 4.2 ? > Although that wouldn't solve akpm's Problem with 3.4.. > Ok, so apparently I'm an idiot and should have just read the lib1funcs.S from the beginning ;-) These symbols are all FP users, so if they're legitimately emitted for the kernel, that's a problem. It looks like some people have papered around this by inlining integer equivalents in arch/<foo>/lib, but it's more indicative of CFLAGS brain-damage. I tried reproducing the problem with akpm's compiler, and the end result was that -m4-nofpu wasn't being specified on account of -m4a-nofpu not being available (and CONFIG_CPU_SH4A cflags trumps CONFIG_CPU_SH4). As soon as that was fixed up, these were no longer emitted by the compiler. So the answer seems to be to just leave them out of the kernel and possibly throw up an entry on the wiki explaining all of this so we don't have the same thing happen next year after having forgotten the rationale again. -- diff --git a/arch/sh/Makefile b/arch/sh/Makefile index c7a8e1f..77fecc6 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -35,12 +35,12 @@ endif endif cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) -cflags-$(CONFIG_CPU_SH2A) := $(call cc-option,-m2a,) \ +cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ $(call cc-option,-m2a-nofpu,) cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,) cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ $(call cc-option,-mno-implicit-fp,-m4-nofpu) -cflags-$(CONFIG_CPU_SH4A) := $(call cc-option,-m4a,) \ +cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ $(call cc-option,-m4a-nofpu,) cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb |