From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1631 Path: news.gmane.org!not-for-mail From: idunham@lavabit.com Newsgroups: gmane.linux.lib.musl.general Subject: Re: Building without -Wl,-Bsymbolic-functions Date: Sat, 18 Aug 2012 12:07:34 -0400 (EDT) Message-ID: <2774.50.0.229.11.1345306054.squirrel@lavabit.com> References: <20120818121418.GX27715@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1345306070 12227 80.91.229.3 (18 Aug 2012 16:07:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Aug 2012 16:07:50 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1632-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 18 18:07:50 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 1T2lYz-0002G9-DU for gllmg-musl@plane.gmane.org; Sat, 18 Aug 2012 18:07:49 +0200 Original-Received: (qmail 5776 invoked by uid 550); 18 Aug 2012 16:07:47 -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 5765 invoked from network); 18 Aug 2012 16:07:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=HgURgOsyv724Nr/m5sh2IBOWonekmojeWbi5+amYxUtEASrTq1oB2e5FRc8xNSSSgn2oaJTez8x+6Rk7zBOEtOP78PTVN79Wc2kbyyA2yyIBjv/SuUx6lqkaeLC3f1DeOCeFcB4phcE323aCfYCxAPDXAGb7HsTvKyeApZV5UPo=; h=Message-ID:In-Reply-To:References:Date:Subject:From:To:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20120818121418.GX27715@brightrain.aerifal.cx> User-Agent: SquirrelMail/1.4.13 Xref: news.gmane.org gmane.linux.lib.musl.general:1631 Archived-At: > On Sat, Aug 18, 2012 at 01:38:23PM +0200, Jens wrote: >> >> Hi! >> >> Im building musl inside an oldish uclibc environment based on uclibc >> 0.9.30.1, gcc 4.1.2 and GNU ld version 2.17. >> >> The linker does not accept -Bsymbolic-functions. >> >> Im now building the shared library despite of this. >> >> How broken will the musl libc be without -Bsymbolic-functions ? > > If building without it entirely, the shared libc will just crash. > > If replacing it with -Bsymbolic, it will run, but global variables in > libc that are accessed by the application (e.g. environ, optind, ...) > will actually have separate copies in libc and the application, and > thus the app won't work as expected. Last I checked, ISTR it was "Illegal instruction" or segfault (even for hello world); I forget which was which, but both did not work at all. > A patch to add -Bsymbolic-functions to old binutils would be very > welcome... In the mean time, you could compile a new ld and pass the > -B option to gcc to give it the path for the new ld. The patch isn't trivial to get right, but 2.17.50 (20070703) is a significant improvement in many other ways (a few code generation fixes among them)... I've built a tarball, but not really posted it publicly (tarballs in git is really nasty 8-)* ). Interestingly, -B is not needed if you just put the desired version first in your path. (I found that out trying 2.17/2.17.50 on an Ubuntu host Isaac Dunham *see github.com/idunham/srcs if you still dare.