Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 Aug 2012 14:24:17 +0200
From: John Spencer <maillist-musl@...fooze.de>
To: musl@...ts.openwall.com
CC: Richard Pennington <rich@...nware.com>
Subject: Re: build musl with clang

On 08/23/2012 09:53 AM, agent wrote:
>
> if i use musl's ld-musl (as far as i can notice it is just symlink to 
> libc.so) i get a segfault. gdb says:
>
> (gdb) r
> Starting program: /home/agent/dev/musl/musl-0.9.4_clang/lib/t.out
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7f9d73a in find_sym () from /lib/ld-musl-i386.so.1
> (gdb) where
> #0  0xb7f9d73a in find_sym () from /lib/ld-musl-i386.so.1
>
> btw, exactly the same things happen when i try it with gcc (4.6.3 from 
> ubuntu).

this sounds as if the binary uses gnu hash as opposed to sysv hash. did 
you use ./configure ?
see FAQ in http://wiki.musl-libc.org


>
> if i compile statically with gcc the program works fine, but with 
> clang it even does not compile (i mean link):
>
> /opt/musl-clang/lib/libc.a(vfprintf.o): In function `printf_core':
> src/stdio/vfprintf.c:(.text+0x1088): undefined reference to `__udivdi3'
> src/stdio/vfprintf.c:(.text+0x10a6): undefined reference to `__umoddi3'
>

these functions are part of libgcc as nsz already stated.

> maybe it is impossible to compile a working musl with clang at this 
> stage, maybe a quick fix can be applied (:
>

there is another known bug in clang which will lead to calloc getting 
wrongly optimized away, because clang disrespects -ffree-standing. 
Richard Pennington wanted to reported this to the LLVM maillist months 
ago, but afaik he still hasn't done this.



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.