From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4464 Path: news.gmane.org!not-for-mail From: Rob Landley Newsgroups: gmane.linux.lib.musl.general Subject: Re: libgcc --disable-shared test case Date: Sat, 11 Jan 2014 11:40:32 -0600 Message-ID: <1389462032.1176.18@driftwood> References: <20131017060913.GA1957@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; DelSp=Yes; Format=Flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389469763 23220 80.91.229.3 (11 Jan 2014 19:49:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jan 2014 19:49:23 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-4468-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 11 20:49:31 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 1W24Yk-0003SW-UV for gllmg-musl@plane.gmane.org; Sat, 11 Jan 2014 20:49:31 +0100 Original-Received: (qmail 18396 invoked by uid 550); 11 Jan 2014 19:49:29 -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 18388 invoked from network); 11 Jan 2014 19:49:29 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:subject:to:cc:in-reply-to:message-id :mime-version:content-type:content-disposition :content-transfer-encoding; bh=KaTllOw5kArGYi390zssvNXh3sgERpLIe7uUMNCd21c=; b=bPK4s6PVGuBUecWQteR3g8LoHV4DbN4Mo4cjUo8zLzVUBY1hYfimybDLj0TKh5K26e PQXh7KfAM7GWl6TrQpyqOx7eYBzNVnD9A6lLLi0oLFdj1wlGzzKEs+qlIKw2q17NiI3x mMCV/Ar52qilTV2lyjOF8xprG8sBcTQS403SpoVuPU2su+HP2Fck0tZgaI3A1mOMXD1/ f4nwsWnrB6oFyFd0W11OGxiHhoJYzA64fr9ua/AK6kqTdlRkuS5aiA56Aw/FBiggr8NS IIEvjtIGzlckEmDBbDjWss6qQUc56IRIkhushgZJegZThFcOATajsOj7I0+U3zuXQDDN tYJQ== X-Gm-Message-State: ALoCoQkaC7EU2OTIxmfwThBQdWA37TS8U7htleK2i2mGegyuN6mfR3zXCplItHG2cdo8eUX+1Y1e X-Received: by 10.182.250.163 with SMTP id zd3mr14318585obc.20.1389469756611; Sat, 11 Jan 2014 11:49:16 -0800 (PST) In-Reply-To: <20131017060913.GA1957@brightrain.aerifal.cx> (from dalias@aerifal.cx on Thu Oct 17 01:09:13 2013) X-Mailer: Balsa 2.4.11 Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:4464 Archived-At: On 10/17/2013 01:09:13 AM, Rich Felker wrote: > On i386 or any arch where libgcc functions are needed for 64-bit > division, the following should reproduce the failure if libgcc was > built with --disable-shared (which disables visibility): >=20 > gcc -O2 -shared -o libfoo.so lib_v1.c > gcc -O2 main.c ./libfoo.so > ./a.out # ok > gcc -O2 -shared -o libfoo.so lib_v2.c > ./a.out # fails with symbol errors >=20 > Rich lib_v1.c: long long foo(long long x) { return x/10; } lib_v2.c: long long foo(long long x) { return x/16; } main.c: #include extern long long foo(long long); int main() { printf("%lld\n", foo(100)/10); } Ok, I just tested this again. With lib_v1.c, the one built with my =20 simple-cross-compiler toolchain printed 1, and the lib_v2.c printed 0. =20 (I believe you said the error was a link failure?) I had to copy the resulting a.out and libfoo.so into =20 simple-root-filesystem (which was built with the simple cross compiler =20 and doesn't contain a native compiler) to run it in a chroot because =20 the host hasn't got uClibc libraries installed in it, hence no =20 libc.so.0 for the dynamic link... Looks like my toolchain doesn't exhibit this behavior? (Not after I =20 hacked the hell out of the libgcc.a build, anyway...) (I'm sure I tested this before, but didn't write the result down. =20 There's a reason I blog to myself so much when I'm not buried by =20 $DAYJOB...) Rob=