mailing list of musl libc
 help / color / mirror / code / Atom feed
* undefined reference to `raise' with musl static toolchain
@ 2018-05-08 12:44 Thomas Petazzoni
  2018-05-08 13:28 ` Alexander Monakov
  2018-05-08 16:22 ` Markus Wichmann
  0 siblings, 2 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2018-05-08 12:44 UTC (permalink / raw)
  To: musl

Hello,

When building an ARM Cortex-A8 toolchain with Buildroot, using the musl
C library, and its --disable-shared option (to build a static only
toolchain), building some simple programs fail:

thomas@windsurf:~/projets/buildroot (master)$ cat foo.c 
int main(void) { mktime(); return 0; }
$ ./output/host/bin/arm-linux-gcc -o foo foo.c
foo.c: In function ‘main’:
foo.c:1:18: warning: implicit declaration of function ‘mktime’ [-Wimplicit-function-declaration]
 int main(void) { mktime(); return 0; }
                  ^~~~~~
/home/thomas/projets/buildroot/output/host/lib/gcc/arm-buildroot-linux-musleabihf/6.4.0/libgcc.a(_dvmd_lnx.o): In function `__aeabi_idiv0':
/home/thomas/projets/buildroot/output/build/host-gcc-final-6.4.0/build/arm-buildroot-linux-musleabihf/libgcc/../../../libgcc/config/arm/lib1funcs.S:1354: undefined reference to `raise'
collect2: error: ld returned 1 exit status

Does that ring any bell ?

It can be reproduced using the following Buildroot defconfig:

BR2_arm=y
BR2_cortex_a8=y
BR2_STATIC_LIBS=y
BR2_TOOLCHAIN_BUILDROOT_MUSL=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_TARGET_ROOTFS_TAR is not set

And then using the cross-compiler to build that simple program calling
mktime().

Any idea ?

Note: this is reported in the Buildroot bug tracker as
https://bugs.busybox.net/show_bug.cgi?id=10996.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-05-11 21:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08 12:44 undefined reference to `raise' with musl static toolchain Thomas Petazzoni
2018-05-08 13:28 ` Alexander Monakov
2018-05-08 16:22 ` Markus Wichmann
2018-05-08 16:34   ` Rich Felker
2018-05-09  9:29     ` Thomas Petazzoni
2018-05-09 13:44       ` Thomas Petazzoni
2018-05-09 15:24         ` Szabolcs Nagy
2018-05-09 17:28           ` Rich Felker
2018-05-11 15:59           ` Thomas Petazzoni
2018-05-11 16:05             ` Rich Felker
2018-05-11 21:28               ` Thomas Petazzoni

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).