From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11045 Path: news.gmane.org!.POSTED!not-for-mail From: Charlie Kester Newsgroups: gmane.linux.lib.musl.general Subject: link failures when building projects that use libtool Date: Wed, 15 Feb 2017 18:06:12 -0800 Message-ID: <20170216020612.GB20945@comcast.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Trace: blaine.gmane.org 1487210793 28675 195.159.176.226 (16 Feb 2017 02:06:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2017 02:06:33 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) To: musl@lists.openwall.com Original-X-From: musl-return-11060-gllmg-musl=m.gmane.org@lists.openwall.com Thu Feb 16 03:06:29 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1ceBSk-0006yn-A9 for gllmg-musl@m.gmane.org; Thu, 16 Feb 2017 03:06:26 +0100 Original-Received: (qmail 22189 invoked by uid 550); 16 Feb 2017 02:06:30 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 22130 invoked from network); 16 Feb 2017 02:06:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1487210775; bh=GoRP8fdiVGQ/IQGbrm89WgCjQLb8fATfvxxuxiQm8Rw=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=EB/kZA3pdCQf39v17e+DkrHsxWjzFk+MCmvNUmUMDVef/9cndS8N5pp6/MRSYHM1A rIqvJmi/MQON9AYY4lXK35tUlaAy220dnhuoqYIZF0JdJMBEuDlEVdKfy2ZphgIy8W sQ5Gioe+7Wq1l1LPjOfD9+mDAFbgWiMNtiozgu2AVex/6Cnj2G/PEbXIYV/iVsI0QD Wxp9sPz8JaToKrB+1wGhCrSnpO1tnduK47R84QXSS2J+LH3SHVYLElzJRCtU+YwOng /R75EJ9OTSVrz2bn6ijhiGCWNfGww+9oizHUhu5TgXvev340vvgRDA8coWkVp/3xhf R4hDk0BseoDZw== Content-Disposition: inline X-Mailer: Mutt 1.7.0 X-Composer: Vim 7.4.2229 X-CMAE-Envelope: MS4wfAsFM+MD02YsRr9VFQxMs+Uff3uRrTTAIcCxpagvT39aeFIeX0g89NoXqHE94g7CvEc92Wt26gtedZFRr9x9pcneyr1eKMTnRanc8l9rm9W3hjLj40r2 shQPMK8k3OtGn7btRnXFn6zItrlWAUBcv2YZHTz8qbSABuqh1ayptnUBR60ygvmjtRlEfUuv2X8dEA== Xref: news.gmane.org gmane.linux.lib.musl.general:11045 Archived-At: I have a recurring problem trying to build projects that use libtool. The link step fails with a message like the one below, for libzip: ------------------ /bin/bash ../libtool --tag=CC --mode=link musl-gcc -O2 -D_GNU_SOURCE -I/usr/local/musl/include -static -s -static -L/usr/local/musl/lib -o zipcmp zipcmp.o ../lib/libzip.la -lz libtool: link: musl-gcc -O2 -D_GNU_SOURCE -I/usr/local/musl/include -s -o zipcmp zipcmp.o -L/usr/local/musl/lib ../lib/.libs/libzip.a -lz /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/6/crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object /usr/bin/ld: final link failed: Nonrepresentable section on output ------------------- (I added blank lines to separate the lines of output, to satisfy linelength conventions for email.) Note that the -static flag was used in both the compile & the link steps. Yet the linker error seems to indicate that it is still trying to build a shared library. Worse, it's pulling in modules from glibc. I've seen similar error messages with other projects that don't use libtool, but in those cases it was fixed by adding the -static flag to the link command in the Makefile. As you can see, however, libtool seems to be discarding that flag. $ /usr/bin/ld --version GNU ld (GNU Binutils for Debian) 2.27.90.20170205 The ltmain.sh included with the libzip sourcecode contains the following version info: # libtool (GNU libtool) 2.4.2 I'd appreciate any ideas about how to fix this. I see in the wiki's list of bugs found with musl that something very like this was reported to the libtool developers as far back as 2012, but I don't see that it was ever resolved.