From patchwork Thu Oct 29 19:11:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1390331 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=D5WX9gbc; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CMZn4551zz9sPB for ; Fri, 30 Oct 2020 06:11:52 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CDB3386186E; Thu, 29 Oct 2020 19:11:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CDB3386186E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1603998703; bh=fwJIE1EYuSU4KR9XA+BjauYgFx2nvRNh1cIwaEf67v0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=D5WX9gbcdctFD6DzT9fpngJaJwp93YvRD7qixHiM8ljF6f/4NenASZCpzYodGM3ty MfpSe1KjWKXxRNag+1aP8VyzPtFYHxxHnqtPiZYBQOemyG1rrUnskYhrTu09/DJlYq YDkJZXqpl373bokC0Y+T2q6L5hdrdddsJIv0LT5Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 5BD773861001 for ; Thu, 29 Oct 2020 19:11:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5BD773861001 Received: by mail-pl1-x636.google.com with SMTP id p17so1737546pli.13 for ; Thu, 29 Oct 2020 12:11:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fwJIE1EYuSU4KR9XA+BjauYgFx2nvRNh1cIwaEf67v0=; b=ZcXJeCdsmvUEJ6i7bRxQhduC/W34taef394kSNi0cpIEdAB/lZ95MWFcheQFZ/rf0o M/JOZedx2Xb8cxs3kdipeeminw6WNXQbjG4qwMFpveAnu+MjRbyGhQ6xHcSWtmMhWChH iHMdGM1H3jBH53171v9SUM2lfQd2ehc4LrC/xKVaQKbiTFwfI58yjgB9wZXOW+OXv+1C 0DXE0SkJBk4xKUNEa9KX+epFG6uDN7cNw9PvL7kBlZZWqr7TVMldKsKOX2/DOc9h6sJu lsYc0pWXOFuT83nzFe6+VwYlSH7u+r/mS6uvbQhWH0+Wz4lk3t9PNF9qHF1k3m7twG5u jsQQ== X-Gm-Message-State: AOAM530ZLQrFmVZvkPBjrGt1p3zOZjLqviwMQXsQwQFjwEhl590S757v oPsRRGGp8ISbYm0z6bTXIQmwlDmqnGU= X-Google-Smtp-Source: ABdhPJy1ru4goew3iPuGvFKFGY0kA8sbI2taZZKlAOtuJtx47+oLwmZbDOUKwMsw2QtDgSejKCruSw== X-Received: by 2002:a17:902:fe0a:b029:d6:aa7:5220 with SMTP id g10-20020a170902fe0ab02900d60aa75220mr5297116plj.16.1603998697874; Thu, 29 Oct 2020 12:11:37 -0700 (PDT) Received: from gnu-cfl-2.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id d145sm3942452pfd.136.2020.10.29.12.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 12:11:36 -0700 (PDT) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 11A331A093D; Thu, 29 Oct 2020 12:11:35 -0700 (PDT) To: binutils@sourceware.org Subject: [PATCH 2/3] Binutils: Pass --plugin to AR and RANLIB Date: Thu, 29 Oct 2020 12:11:31 -0700 Message-Id: <20201029191132.137382-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201029191132.137382-1-hjl.tools@gmail.com> References: <20201029191132.137382-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3041.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. libctf/ * configure: Regenerated. opcodes/ * configure: Regenerated. --- bfd/configure | 27 +++++++++++++++++++++++++-- binutils/configure | 27 +++++++++++++++++++++++++-- gas/configure | 27 +++++++++++++++++++++++++-- gprof/configure | 27 +++++++++++++++++++++++++-- ld/configure | 27 +++++++++++++++++++++++++-- libctf/configure | 27 +++++++++++++++++++++++++-- opcodes/configure | 27 +++++++++++++++++++++++++-- 7 files changed, 175 insertions(+), 14 deletions(-) diff --git a/bfd/configure b/bfd/configure index 864e78851c..c518d9e5be 100755 --- a/bfd/configure +++ b/bfd/configure @@ -6824,6 +6824,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -6917,6 +6930,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -7121,6 +7139,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -11729,7 +11752,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11732 "configure" +#line 11755 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11835,7 +11858,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11838 "configure" +#line 11861 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/binutils/configure b/binutils/configure index 7c3113c6af..c4d19e406e 100755 --- a/binutils/configure +++ b/binutils/configure @@ -6616,6 +6616,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -6709,6 +6722,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -6913,6 +6931,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -11552,7 +11575,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11555 "configure" +#line 11578 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11658,7 +11681,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11661 "configure" +#line 11684 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gas/configure b/gas/configure index c1fff579c6..6b87cc2401 100755 --- a/gas/configure +++ b/gas/configure @@ -6408,6 +6408,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -6501,6 +6514,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -6705,6 +6723,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -11344,7 +11367,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11347 "configure" +#line 11370 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11450,7 +11473,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11453 "configure" +#line 11476 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gprof/configure b/gprof/configure index 6fd9974466..4aaab18a42 100755 --- a/gprof/configure +++ b/gprof/configure @@ -6255,6 +6255,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -6348,6 +6361,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -6552,6 +6570,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -11191,7 +11214,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11194 "configure" +#line 11217 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11297,7 +11320,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11300 "configure" +#line 11323 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/ld/configure b/ld/configure index bd869cc8fd..947de62357 100755 --- a/ld/configure +++ b/ld/configure @@ -7106,6 +7106,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -7199,6 +7212,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -7403,6 +7421,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -12043,7 +12066,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12046 "configure" +#line 12069 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12149,7 +12172,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12152 "configure" +#line 12175 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libctf/configure b/libctf/configure index 3fcb2f9416..cd8d82e6f0 100755 --- a/libctf/configure +++ b/libctf/configure @@ -6613,6 +6613,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -6706,6 +6719,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -6910,6 +6928,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -11519,7 +11542,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11522 "configure" +#line 11545 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11625,7 +11648,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11628 "configure" +#line 11651 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/opcodes/configure b/opcodes/configure index b9bddf8cba..aa0f943568 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -6533,6 +6533,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown +plugin_option= +plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +for plugin in $plugin_names; do + plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` + if test x$plugin_so = x$plugin; then + plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin` + fi + if test x$plugin_so != x$plugin; then + plugin_option="--plugin $plugin_so" + break + fi +done + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -6626,6 +6639,11 @@ else fi test -z "$AR" && AR=ar +if test -n "$plugin_option"; then + if $AR --help 2>&1 | grep -q "\--plugin"; then + AR="$AR $plugin_option" + fi +fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -6830,6 +6848,11 @@ else fi test -z "$RANLIB" && RANLIB=: +if test -n "$plugin_option" && test "$RANLIB" != ":"; then + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi +fi @@ -11439,7 +11462,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11442 "configure" +#line 11465 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11545,7 +11568,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11548 "configure" +#line 11571 "configure" #include "confdefs.h" #if HAVE_DLFCN_H