From patchwork Tue Dec 14 18:42:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 75521 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4941AB6EF2 for ; Wed, 15 Dec 2010 05:43:13 +1100 (EST) Received: (qmail 27420 invoked by alias); 14 Dec 2010 18:43:06 -0000 Received: (qmail 27322 invoked by uid 22791); 14 Dec 2010 18:43:04 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Dec 2010 18:42:59 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 810651E9; Tue, 14 Dec 2010 19:42:57 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TTlffTJy-wmY; Tue, 14 Dec 2010 19:42:35 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id DF2001E6; Tue, 14 Dec 2010 19:42:22 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id oBEIgLgd011021; Tue, 14 Dec 2010 19:42:21 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Dave Korn , DJ Delorie , Ian Lance Taylor Subject: [lto-plugin, build] Don't link libiberty.a into liblto-plugin.a Date: Tue, 14 Dec 2010 19:42:21 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org When trying a mainline bootstrap on Solaris 11/x86 with a debug version of the Sun binutils, I ran into an assertion failure building the static liblto-plugin.a: $ ar cr .libs/liblto_plugin.a ../libiberty/pic/libiberty.a lto-plugin.o Assertion failed: !is_elf || (pad(lseek(fd, 0, SEEK_CUR), PADSZ) == 0), file ../common/file.c, line 726, function write_member_header Abort While the assertion failure won't show in a production version and the condition has since been fixed to avoid it even in a debug version, it seems clear that embedding an archive inside another archive doesn't make any sense. The following patch fixed the issue for me by avoiding to pass .a files directly to libtool, but instead using the appropriate combination of -L and -l. It allowed my bootstraps to finish. Going forward, this current mixture of libtool and non-libtool libraries seems like a total mess to me. Instead, it seems better to change libiberty to use libtool itself. This would certainly simplify the Makefile.in (even if not going to automake at the same time), but this is clearly not stage3 material and would need careful coordination with other projects in src. Any thoughts on the patch below and a possible libiberty conversion? Thanks. Rainer 2010-12-11 Rainer Orth * Makefile.am (liblto_plugin_la_DEPENDENCIES): Define. (liblto_plugin_la_LIBADD): Use -L../libiberty/pic -liberty. (liblto_plugin_la_LDFLAGS): Use -L../libiberty -liberty. * Makefile.in: Regenerate. diff -r f6168cd5e1fe lto-plugin/Makefile.am --- a/lto-plugin/Makefile.am Fri Dec 10 19:55:31 2010 +0100 +++ b/lto-plugin/Makefile.am Sat Dec 11 01:31:27 2010 +0100 @@ -13,11 +13,13 @@ libexecsub_LTLIBRARIES = liblto_plugin.la liblto_plugin_la_SOURCES = lto-plugin.c +liblto_plugin_la_DEPENDENCIES = \ + $(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) liblto_plugin_la_LIBADD = \ - $(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) + $(if $(wildcard ../libiberty/pic/libiberty.a),-L../libiberty/pic -liberty,) # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS liblto_plugin_la_LDFLAGS = $(lt_host_flags) -bindir $(libexecsubdir) \ - $(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a) + $(if $(wildcard ../libiberty/pic/libiberty.a),,-L../libiberty -liberty) all: copy_lto_plugin