From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1689 Path: news.gmane.org!not-for-mail From: John Spencer Newsgroups: gmane.linux.lib.musl.general Subject: Re: build musl with clang Date: Thu, 23 Aug 2012 14:24:17 +0200 Message-ID: <503620F1.7010003@barfooze.de> References: <5035E16E.50004@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345724446 20941 80.91.229.3 (23 Aug 2012 12:20:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Aug 2012 12:20:46 +0000 (UTC) Cc: Richard Pennington To: musl@lists.openwall.com Original-X-From: musl-return-1690-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 23 14:20:44 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1T4WOw-0002Qb-GF for gllmg-musl@plane.gmane.org; Thu, 23 Aug 2012 14:20:42 +0200 Original-Received: (qmail 11939 invoked by uid 550); 23 Aug 2012 12:20:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11928 invoked from network); 23 Aug 2012 12:20:40 -0000 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Mail/1.0 In-Reply-To: <5035E16E.50004@gmail.com> Xref: news.gmane.org gmane.linux.lib.musl.general:1689 Archived-At: 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.