From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12813 Path: news.gmane.org!.POSTED!not-for-mail From: Thomas Petazzoni Newsgroups: gmane.linux.lib.musl.general Subject: undefined reference to `raise' with musl static toolchain Date: Tue, 8 May 2018 14:44:17 +0200 Organization: Bootlin (formerly Free Electrons) Message-ID: <20180508144417.216cefa5@windsurf.home> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525784618 22590 195.159.176.226 (8 May 2018 13:03:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 May 2018 13:03:38 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12829-gllmg-musl=m.gmane.org@lists.openwall.com Tue May 08 15:03:34 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fG2HF-0005nx-My for gllmg-musl@m.gmane.org; Tue, 08 May 2018 15:03:33 +0200 Original-Received: (qmail 3468 invoked by uid 550); 8 May 2018 13:05:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5215 invoked from network); 8 May 2018 12:44:29 -0000 X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:12813 Archived-At: 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=20 int main(void) { mktime(); return 0; } $ ./output/host/bin/arm-linux-gcc -o foo foo.c foo.c: In function =E2=80=98main=E2=80=99: foo.c:1:18: warning: implicit declaration of function =E2=80=98mktime=E2=80= =99 [-Wimplicit-function-declaration] int main(void) { mktime(); return 0; } ^~~~~~ /home/thomas/projets/buildroot/output/host/lib/gcc/arm-buildroot-linux-musl= eabihf/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:13= 54: 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=3Dy BR2_cortex_a8=3Dy BR2_STATIC_LIBS=3Dy BR2_TOOLCHAIN_BUILDROOT_MUSL=3Dy BR2_TOOLCHAIN_BUILDROOT_CXX=3Dy BR2_INIT_NONE=3Dy BR2_SYSTEM_BIN_SH_NONE=3Dy # 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=3D10996. Best regards, Thomas --=20 Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com