Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 25 Aug 2015 13:32:37 +0200
From: Szabolcs Nagy <>
To: Nitin Singh <>
Subject: Re: musl-gcc not working after installing

* Nitin Singh <> [2015-08-25 15:27:20 +0530]:
> I have linux installed in armv6 android phone in chrooted environment.
> I have installed musl-libc from source for building static binary for
> android. Here are the commands, I ran for building & installing in
> debian ::
> ./configure --disable-shared
> make
> make install
> cat > hello.c <<EOF
> #include <stdio.h>
> int main()
> {   printf("hello, world!\n");
> return 0;
> }
> /usr/local/musl/bin/musl-gcc hello.c
> ./a.out

if you add -v, you should see

.. --start-group -lgcc -lgcc_eh -lc --end-group ..

which means all dependencies between libgcc and libc are resolved

i think gcc does not do the --start-group/--end-group without
explicit -static, so only musl-gcc -static hello.c would work.

> It shows this error ::
> /usr/lib/gcc/arm-linux-gnueabi/4.6/libgcc.a(_dvmd_lnx.o): In function
>    `__aeabi_ldiv0':
> (.text+0x8): undefined reference to `raise'
> collect2: ld returned 1 exit status

raise is in libc, referenced from libgcc
__aebi_ldiv0 is in libgcc, referenced from libc

with static linking, undefined symbol resolution
happens in the order the libraries are listed on
the command line (so you need -lgcc -lc -lgcc -lc or
the --*-group linker flags to resolve circular deps)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.