* [U-Boot] "raise" not defined, when compiler uses its own div0
@ 2009-08-11 6:20 Ulf Samuelsson
2009-08-11 8:14 ` Gaye Abdoulaye Walsimou
2009-08-11 8:47 ` Wolfgang Denk
0 siblings, 2 replies; 9+ messages in thread
From: Ulf Samuelsson @ 2009-08-11 6:20 UTC (permalink / raw)
To: u-boot
When trying to build U-Boot under Buildroot and OpenEmbedded,
I run into a problem:
When linking u-boot the linker seems to use the div0 from
the C compiler libgcc instead of the u-boot div0.
gcc div0 for ARM contains a call to "raise" which is not defined
in libgcc.a (someone said it was part of glibc),
so the linking process fails due to no "raise" symbol
gcc/config/arm/lib1funcs.asm contains:
FUNC_START div0
tmfd sp!, {r1, lr}
mov r0, #SIGFPE
bl SYM(raise) __PLT__
...
The problem can be fixed by patching the C compiler:
+ bl SYM(raise) __PLT__
+ bl SYM(_div0) __PLT__
------
What I'd like to know: Is there a way to fix this in u-boot?
Tried creating a "raise" function in libarm/board.c
void raise(void)
{
hang();
}
which did not work.
I later saw that raise needs a parameter,
but it complained that raise is not found,
and not that the parameters is wrong.
Is board.c not included in the link?
Anyone else got this problem?
BR
Ulf Samuelsson
^ permalink raw reply [flat|nested] 9+ messages in thread* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-11 6:20 [U-Boot] "raise" not defined, when compiler uses its own div0 Ulf Samuelsson @ 2009-08-11 8:14 ` Gaye Abdoulaye Walsimou 2009-08-11 8:48 ` Wolfgang Denk 2009-08-11 8:47 ` Wolfgang Denk 1 sibling, 1 reply; 9+ messages in thread From: Gaye Abdoulaye Walsimou @ 2009-08-11 8:14 UTC (permalink / raw) To: u-boot Ulf Samuelsson wrote: > When trying to build U-Boot under Buildroot and OpenEmbedded, > I run into a problem: > > When linking u-boot the linker seems to use the div0 from > the C compiler libgcc instead of the u-boot div0. > Yes i had the same problem with a home made toolchain (eglibc-2.10, gcc-4.4.1| gcc-4.3.4 | gcc-4.3.3 | gcc-4.3.2) with smdk2410 board. It seems to be same with this thread http://lists.denx.de/pipermail/u-boot/2009-August/058349.html with codesourcery's toolchain. However, I have tested u-boot-arm repository which includes a controversial :-) "ARM: Don't include libgcc anymore" (70163a381f1a5c93fcc181365cdb092566d8c5c5) without compile errors. Regards ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-11 8:14 ` Gaye Abdoulaye Walsimou @ 2009-08-11 8:48 ` Wolfgang Denk 0 siblings, 0 replies; 9+ messages in thread From: Wolfgang Denk @ 2009-08-11 8:48 UTC (permalink / raw) To: u-boot Dear Gaye Abdoulaye Walsimou, In message <4A81285B.8010908@walsimou.com> you wrote: > > However, I have tested u-boot-arm repository which includes a > controversial :-) "ARM: Don't include libgcc anymore" > (70163a381f1a5c93fcc181365cdb092566d8c5c5) without compile errors. It's not controversial. It has been formally NAKed and rejected. It is not needed as working fixes are already available in mainline. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You said you didn't want to use CGI.pm, but methinks you are needlessly reinventing the wheel, one spoke at a time. Either you are masochistic, or you just haven't seen enough of what CGI.pm can do for you. -- Randal L. Schwartz in <8cyb81rg81.fsf@gadget.cscaper.com> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-11 6:20 [U-Boot] "raise" not defined, when compiler uses its own div0 Ulf Samuelsson 2009-08-11 8:14 ` Gaye Abdoulaye Walsimou @ 2009-08-11 8:47 ` Wolfgang Denk 2009-08-11 21:48 ` Ulf Samuelsson 1 sibling, 1 reply; 9+ messages in thread From: Wolfgang Denk @ 2009-08-11 8:47 UTC (permalink / raw) To: u-boot Dear Ulf Samuelsson, In message <4A810DBC.50805@atmel.com> you wrote: > When trying to build U-Boot under Buildroot and OpenEmbedded, These probably count to the tool chains with "broken" ARM cross compilers. > When linking u-boot the linker seems to use the div0 from > the C compiler libgcc instead of the u-boot div0. Try setting USE_PRIVATE_LIBGCC=yes in your envrionment, like USE_PRIVATE_LIBGCC=yes make ... Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Quote from the Boss... "I didn't say it was your fault. I said I was going to blame it on you." ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-11 8:47 ` Wolfgang Denk @ 2009-08-11 21:48 ` Ulf Samuelsson 2009-08-11 21:58 ` Wolfgang Denk 0 siblings, 1 reply; 9+ messages in thread From: Ulf Samuelsson @ 2009-08-11 21:48 UTC (permalink / raw) To: u-boot Wolfgang Denk skrev: > Dear Ulf Samuelsson, > > In message <4A810DBC.50805@atmel.com> you wrote: >> When trying to build U-Boot under Buildroot and OpenEmbedded, > > These probably count to the tool chains with "broken" ARM cross > compilers. Maybe, Buildroot is even more broken, if you try to use an external toolchain and I would be surprised if openembedded is better. In the end, noone wants to mess around with one compiler per application so it is better if a small fix to u-boot can be applied. > >> When linking u-boot the linker seems to use the div0 from >> the C compiler libgcc instead of the u-boot div0. > > Try setting USE_PRIVATE_LIBGCC=yes in your envrionment, like > > USE_PRIVATE_LIBGCC=yes make ... I have done two fixes to make it build with openembedded. 1) Define "raise" in libarm/board.c which calls hang. 2) Changes mapi to "-mapi=aapcs-linux" in cpu/arm926ej-s/config.mk Some toolchains want to keep apcs-gnu I guess. > > Best regards, > > Wolfgang Denk > BR Ulf Samuelsson ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-11 21:48 ` Ulf Samuelsson @ 2009-08-11 21:58 ` Wolfgang Denk 2009-08-12 6:22 ` Ulf Samuelsson 0 siblings, 1 reply; 9+ messages in thread From: Wolfgang Denk @ 2009-08-11 21:58 UTC (permalink / raw) To: u-boot Dear Ulf Samuelsson, In message <4A81E724.3070205@atmel.com> you wrote: > > > Try setting USE_PRIVATE_LIBGCC=yes in your envrionment, like > > > > USE_PRIVATE_LIBGCC=yes make ... > > I have done two fixes to make it build with openembedded. > 1) Define "raise" in libarm/board.c which calls hang. Did you use "USE_PRIVATE_LIBGCC=yes", and it still needed raise(), or did you implement that workaround instead of using "USE_PRIVATE_LIBGCC=yes". Normally no raise() should be needed when using USE_PRIVATE_LIBGCC=yes > 2) Changes mapi to "-mapi=aapcs-linux" in cpu/arm926ej-s/config.mk > Some toolchains want to keep apcs-gnu I guess. I wonder why we enforce a specific API at all - would it not be better to use the toolchain provided default settings? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Single tasking: Just Say No. ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-11 21:58 ` Wolfgang Denk @ 2009-08-12 6:22 ` Ulf Samuelsson 2009-08-12 12:04 ` Wolfgang Denk 0 siblings, 1 reply; 9+ messages in thread From: Ulf Samuelsson @ 2009-08-12 6:22 UTC (permalink / raw) To: u-boot Sent: Tuesday, August 11, 2009 11:58 PM Subject: Re: [U-Boot] "raise" not defined, when compiler uses its own div0 > Dear Ulf Samuelsson, > > In message <4A81E724.3070205@atmel.com> you wrote: >> >> > Try setting USE_PRIVATE_LIBGCC=yes in your envrionment, like >> > >> > USE_PRIVATE_LIBGCC=yes make ... >> >> I have done two fixes to make it build with openembedded. >> 1) Define "raise" in libarm/board.c which calls hang. > > Did you use "USE_PRIVATE_LIBGCC=yes", and it still needed raise(), > or did you implement that workaround instead of using > "USE_PRIVATE_LIBGCC=yes". > > Normally no raise() should be needed when using USE_PRIVATE_LIBGCC=yes Instead, since I think it is ugly. If I build u-boot from the u-boot dir outside the buildsystem, it also means a lot of typing - If I remember to do it... Why not make it a default mode? Then there is no problem anywhere and the patch is not needed. >> 2) Changes mapi to "-mapi=aapcs-linux" in cpu/arm926ej-s/config.mk >> Some toolchains want to keep apcs-gnu I guess. > > I wonder why we enforce a specific API at all - would it not be better > to use the toolchain provided default settings? I tried that, but that did not work with openembedded. ' I suspect that the openembedded libraries are built with -mapi-aapcs-linux. -mapi=apcs-gnu is not a problem with buildroot. A similar thing: For ARM, "-msoftfloat" is enforced, and I think that should be removed. AFAIK there are no floating point stuff in u-boot, and why then enforce something which might or might not work for an arbitrary toolchain. Is there any toolchain that will not work, if -msoftfloat is removed? > > Best regards, > > Wolfgang Denk > > -- > DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de > Single tasking: Just Say No. > Best Regards Ulf Samuelsson ulf at atmel.com Atmel Nordic AB Mail: Box 2033, 174 02 Sundbyberg, Sweden Visit: Kavalleriv?gen 24, 174 58 Sundbyberg, Sweden Phone +46 (8) 441 54 22 Fax +46 (8) 441 54 29 GSM +46 (706) 22 44 57 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-12 6:22 ` Ulf Samuelsson @ 2009-08-12 12:04 ` Wolfgang Denk 2009-08-13 4:55 ` Mike Frysinger 0 siblings, 1 reply; 9+ messages in thread From: Wolfgang Denk @ 2009-08-12 12:04 UTC (permalink / raw) To: u-boot Dear "Ulf Samuelsson", In message <E26FF1FBF0834320AC6F19CE783C7E69@aeglos> you wrote: > > If I build u-boot from the u-boot dir outside the buildsystem, > it also means a lot of typing - If I remember to do it... > > Why not make it a default mode? Because the default mode is to assume you are using a "good" tool chain. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de He had quite a powerful intellect, but it was as powerful like a locomotive, and ran on rails and was therefore almost impossible to steer. - Terry Pratchett, _Lords and Ladies_ ^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] "raise" not defined, when compiler uses its own div0 2009-08-12 12:04 ` Wolfgang Denk @ 2009-08-13 4:55 ` Mike Frysinger 0 siblings, 0 replies; 9+ messages in thread From: Mike Frysinger @ 2009-08-13 4:55 UTC (permalink / raw) To: u-boot On Wednesday 12 August 2009 08:04:40 Wolfgang Denk wrote: > Ulf Samuelsson wrote: > > If I build u-boot from the u-boot dir outside the buildsystem, > > it also means a lot of typing - If I remember to do it... > > > > Why not make it a default mode? > > Because the default mode is to assume you are using a "good" tool > chain. considering these "broken" toolchains are merely following upstream gcc behavior, the definition of "good" will quickly become synonymous with "old" if it hasnt already. while the situation does blow, might as well accept reality and make the local one the default. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20090813/cef3ed45/attachment.pgp ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-08-13 4:55 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-08-11 6:20 [U-Boot] "raise" not defined, when compiler uses its own div0 Ulf Samuelsson 2009-08-11 8:14 ` Gaye Abdoulaye Walsimou 2009-08-11 8:48 ` Wolfgang Denk 2009-08-11 8:47 ` Wolfgang Denk 2009-08-11 21:48 ` Ulf Samuelsson 2009-08-11 21:58 ` Wolfgang Denk 2009-08-12 6:22 ` Ulf Samuelsson 2009-08-12 12:04 ` Wolfgang Denk 2009-08-13 4:55 ` Mike Frysinger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox