* [U-Boot-Users] Build error on strcmp()
@ 2007-08-14 11:29 Shinya Kuribayashi
2007-08-20 12:07 ` Martin Krause
0 siblings, 1 reply; 3+ messages in thread
From: Shinya Kuribayashi @ 2007-08-14 11:29 UTC (permalink / raw)
To: u-boot
> commit 8092fef4c29b395958bb649647da7e3775731517
> Author: Martin Krause <Martin.Krause@tqs.de>
> Date: Tue Dec 12 14:26:01 2006 +0100
>
> Add functions to list of exported functions
>
> Additionally export the following fuctions (to make trab_config build again):
> - simple_strtol()
> - strcmp()
>
> Also bump the ABI version to reflect this change
>
> Signed-off-by: Martin Krause <martin.krause@tqs.de>
This breaks my MIPS build:
common/libcommon.a(exports.o)(.text+0xdc): In function `jumptable_init':
/home/skuribay/bootloader/u-boot/u-boot.git/common/exports.c:32: undefined reference to `strcmp'
make: *** [u-boot] Error 1
We MIPS have arch-specific strcmp defined in <asm/string.h>.
Since strcmp is inlined, we couldn't refer them by function pointer.
The nm of lib_generic/string.o is like this:
U _gp_disp
U malloc
00000610 T memchr
00000520 T memcmp
00000474 T memcpy
000004a4 T memmove
00000448 T memset
00000000 T strcat
00000084 T strchr
00000198 T strdup
000000c0 T strlen
00000038 T strncat
0000015c T strnlen
00000270 T strpbrk
000000e4 T strrchr
00000380 T strsep
00000210 T strspn
00000550 T strstr
000003ec T strswab
000002c0 T strtok
00000004 C ___strtok
I think all architectures which have __HAVE_ARCH_STRCMP defined will
encounter this error. What is the proper workaround?
Thanks,
Shinya Kuribayashi
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] Build error on strcmp()
2007-08-14 11:29 [U-Boot-Users] Build error on strcmp() Shinya Kuribayashi
@ 2007-08-20 12:07 ` Martin Krause
2007-08-21 3:33 ` Shinya Kuribayashi
0 siblings, 1 reply; 3+ messages in thread
From: Martin Krause @ 2007-08-20 12:07 UTC (permalink / raw)
To: u-boot
Hi Shinya Kuribayashi,
sorry for the late response, I was on vacation ...
shinya.kuribayashi at necel.com wrote on Tuesday, August 14, 2007 1:29 PM:
> > commit 8092fef4c29b395958bb649647da7e3775731517
> > Author: Martin Krause <Martin.Krause@tqs.de>
> > Date: Tue Dec 12 14:26:01 2006 +0100
> >
> > Add functions to list of exported functions
> >
> > Additionally export the following fuctions (to make trab_config
> > build again):
> > - simple_strtol()
> > - strcmp()
> >
> > Also bump the ABI version to reflect this change
> >
> > Signed-off-by: Martin Krause <martin.krause@tqs.de>
>
> This breaks my MIPS build:
Oh, sorry about that!
> common/libcommon.a(exports.o)(.text+0xdc): In function
> `jumptable_init':
> /home/skuribay/bootloader/u-boot/u-boot.git/common/exports.c:32:
> undefined reference to `strcmp' make: *** [u-boot] Error 1
>
> We MIPS have arch-specific strcmp defined in <asm/string.h>.
> Since strcmp is inlined, we couldn't refer them by function pointer.
> The nm of lib_generic/string.o is like this:
>
> U _gp_disp
> U malloc
> 00000610 T memchr
> 00000520 T memcmp
> 00000474 T memcpy
> 000004a4 T memmove
> 00000448 T memset
> 00000000 T strcat
> 00000084 T strchr
> 00000198 T strdup
> 000000c0 T strlen
> 00000038 T strncat
> 0000015c T strnlen
> 00000270 T strpbrk
> 000000e4 T strrchr
> 00000380 T strsep
> 00000210 T strspn
> 00000550 T strstr
> 000003ec T strswab
> 000002c0 T strtok
> 00000004 C ___strtok
>
> I think all architectures which have __HAVE_ARCH_STRCMP defined will
> encounter this error. What is the proper workaround?
Sorry, I'm no linker expert - so no idea :(
Best Regards,
Martin Krause
--
TQ-Systems GmbH
Muehlstrasse 2, Gut Delling, D-82229 Seefeld
Amtsgericht Muenchen, HRB 105 018, UST-IdNr. DE 811 607 913
Geschaeftsfuehrer: Dipl.-Ing. (FH) Detlef Schneider, Dipl.-Ing. (FH) Ruediger Stahl
http://www.tq-group.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot-Users] Build error on strcmp()
2007-08-20 12:07 ` Martin Krause
@ 2007-08-21 3:33 ` Shinya Kuribayashi
0 siblings, 0 replies; 3+ messages in thread
From: Shinya Kuribayashi @ 2007-08-21 3:33 UTC (permalink / raw)
To: u-boot
Dear Martin Krause,
>> common/libcommon.a(exports.o)(.text+0xdc): In function
>> `jumptable_init':
>> /home/skuribay/bootloader/u-boot/u-boot.git/common/exports.c:32:
>> undefined reference to `strcmp' make: *** [u-boot] Error 1
>>
>> We MIPS have arch-specific strcmp defined in <asm/string.h>.
>> Since strcmp is inlined, we couldn't refer them by function pointer.
>> The nm of lib_generic/string.o is like this:
>>
>> U _gp_disp
>> U malloc
>> 00000610 T memchr
>> 00000520 T memcmp
>> 00000474 T memcpy
>> 000004a4 T memmove
>> 00000448 T memset
>> 00000000 T strcat
>> 00000084 T strchr
>> 00000198 T strdup
>> 000000c0 T strlen
>> 00000038 T strncat
>> 0000015c T strnlen
>> 00000270 T strpbrk
>> 000000e4 T strrchr
>> 00000380 T strsep
>> 00000210 T strspn
>> 00000550 T strstr
>> 000003ec T strswab
>> 000002c0 T strtok
>> 00000004 C ___strtok
>>
>> I think all architectures which have __HAVE_ARCH_STRCMP defined will
>> encounter this error. What is the proper workaround?
>
> Sorry, I'm no linker expert - so no idea :(
You don't have to be an expert.
I just wanted to show you MIPS string.o doesn't incorporate strcmp.
Ok, I looked closely the other architectures' string libraries, and
found *only* MIPS plays the inlined card.
I also found there is good note in <asm/string.h> of i386 and ARM:
> /*
> * We don't do inline string functions, since the
> * optimised inline asm versions are not small.
> */
So we MIPS might need to change strcmp from optimized asm version into
object version. Of course other inlined string funcs, too. I will post
the patch later.
Thanks,
Shinya Kuribayashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-21 3:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14 11:29 [U-Boot-Users] Build error on strcmp() Shinya Kuribayashi
2007-08-20 12:07 ` Martin Krause
2007-08-21 3:33 ` Shinya Kuribayashi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox