From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6189 Path: news.gmane.org!not-for-mail From: u-igbb@aetey.se Newsgroups: gmane.linux.lib.musl.general Subject: Re: compiling musl on x86_64 linux with pcc Date: Tue, 23 Sep 2014 21:05:25 +0200 Message-ID: <20140923190525.GJ13475@example.net> References: <20140813091843.GD5170@example.net> <20140813123832.GK12888@brightrain.aerifal.cx> <20140813125607.GK5170@example.net> <20140813142332.GN12888@brightrain.aerifal.cx> <20140825082807.GB12376@example.net> <20140825083457.GC12376@example.net> <20140825154617.GV12888@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1411500052 3009 80.91.229.3 (23 Sep 2014 19:20:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Sep 2014 19:20:52 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-6202-gllmg-musl=m.gmane.org@lists.openwall.com Tue Sep 23 21:20:47 2014 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 1XWVdm-0003SJ-HE for gllmg-musl@plane.gmane.org; Tue, 23 Sep 2014 21:20:46 +0200 Original-Received: (qmail 15480 invoked by uid 550); 23 Sep 2014 19:20:45 -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 29757 invoked from network); 23 Sep 2014 19:05:51 -0000 X-T2-Spam-Status: No, hits=0.8 required=5.0 tests=BAYES_50 Received-SPF: none receiver=mailfe06.swip.net; client-ip=96.47.226.20; envelope-from=u-igbb@aetey.se Content-Disposition: inline In-Reply-To: <20140825154617.GV12888@brightrain.aerifal.cx> User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:6189 Archived-At: On Mon, Aug 25, 2014 at 11:46:17AM -0400, Rich Felker wrote: > Note that some fixes are needed for > pcc-libs: > > - You need to remove the broken csu files and replace them with > symlinks to the musl files. > > - You need to add __attribute__((__visibility__("hidden"))) to all > external functions in libpcc. > > - You need to add -fPIC to the CFLAGS for building libpcc or you get a > broken libpcc (containing textrels) that can't be used for building > libc.so and that's harmful for use with any other shared libs. I followed these directions and musl with pcc play along very well for me (on i386). One strange thing I notice though, which is probably more pcc-related than musl (even though this concerns a musl-based toolchain). If I build a shared library with pcc without supplying -Wl,-Bsymbolic (or -Wl,-Bsymbolic-functions as musl does) then a(ny) binary linked to that library segfaults at start even if it does not actually need/use the library. I noticed this with libpcap and wonder what is the reason. Adding -Wl,-Bsymbolic makes everything work so the code is not exactly broken. Wonder if you happen to guess a possible reason for such kind of trouble, something that pcc gets wrong? This looks related to runtime linking behaviour so possibly not fully offtopic here. Rune