From patchwork Sat Feb 12 13:23:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Wildenhues X-Patchwork-Id: 82904 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 C8A84B7123 for ; Sun, 13 Feb 2011 00:24:13 +1100 (EST) Received: (qmail 22770 invoked by alias); 12 Feb 2011 13:24:10 -0000 Received: (qmail 22760 invoked by uid 22791); 12 Feb 2011 13:24:08 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mailout-de.gmx.net) (213.165.64.22) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 12 Feb 2011 13:24:03 +0000 Received: (qmail invoked by alias); 12 Feb 2011 13:24:00 -0000 Received: from xdsl-78-35-52-232.netcologne.de (EHLO localhost.localdomain) [78.35.52.232] by mail.gmx.net (mp014) with SMTP; 12 Feb 2011 14:24:00 +0100 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1PoFSB-0000nl-O5; Sat, 12 Feb 2011 14:23:59 +0100 Date: Sat, 12 Feb 2011 14:23:59 +0100 From: Ralf Wildenhues To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org Subject: Re: [PR lto/47225] Check for shared lto-plugin to enable it in GCC Message-ID: <20110212132359.GA29282@gmx.de> Mail-Followup-To: Ralf Wildenhues , Alexandre Oliva , gcc-patches@gcc.gnu.org References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2010-08-04) 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 Hi Alexandre, * Alexandre Oliva wrote on Sat, Feb 12, 2011 at 12:58:55PM CET: > Depending on various platform-specific details and including configure > options, lto-plugin may be built as a static module, in which case GCC > must not be configured to require the lto plugin, because it won't work. > > This patch fixes this problem, installing the lto-plugin in gcc/ only if > it was build as a dynamic library, arranging for gcc to be configured > only after lto-plugin is built (and perhaps copied into gcc/), and using > the installed plugin to test within gcc's configure whether the plugin > is to be configured. Thank you! for addressing this issue. Looking at the patch again, I see two small nits: > --- lto-plugin/Makefile.am.orig 2011-02-11 13:03:27.460233730 -0200 > +++ lto-plugin/Makefile.am 2011-02-12 09:55:10.657012631 -0200 > @@ -12,6 +12,8 @@ AM_CFLAGS = -Wall -Werror > AM_LIBTOOLFLAGS = --tag=disable-static > > libexecsub_LTLIBRARIES = liblto_plugin.la > +gcc_build_dir = ../gcc This isn't true for an in-tree build, where gcc could be in host-$host/gcc. > +all: $(in_gcc_libs) This target should be all-local instead of all, as per 'info Automake Extending', so as to not overwrite the automake-generated all rule. I'm currently testing this patch, and will push later when it works. Thanks, Ralf Fix minor build system issues in lto-plugin. lto-plugin/: * Makefile.am (all-local): Rename from 'all'. (gcc_build_dir): Use $(host_subdir). * Makefile.in: Regenerate. diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am index fd9ea62..4067c43 100644 --- a/lto-plugin/Makefile.am +++ b/lto-plugin/Makefile.am @@ -12,7 +12,7 @@ AM_CFLAGS = -Wall -Werror AM_LIBTOOLFLAGS = --tag=disable-static libexecsub_LTLIBRARIES = liblto_plugin.la -gcc_build_dir = ../gcc +gcc_build_dir = ../$(host_subdir)/gcc in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib)) # Can be removed when libiberty becomes a normal convenience library @@ -27,7 +27,7 @@ liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -bindir $(libexecsubdir) \ liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \ ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) -all: $(in_gcc_libs) +all-local: $(in_gcc_libs) $(in_gcc_libs) : $(gcc_build_dir)/%: % @if test "X`dlname=; . ./$*; echo dlname:$$dlname`" = "Xdlname:"; then \