From patchwork Wed Apr 29 16:12:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 466177 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BBF06140320 for ; Thu, 30 Apr 2015 02:12:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=MmgUzD64; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=bJv65c07i+OGvufbVTqf0g0jVjQMCXpQ9+kKTxqZDc1 gzTwsa6FT4W9ymobSKHKcTVaWpQCNB42FkbZRuuXUxRzgHTTLAptYdRcEQofaEGQ sa+aSA6xsRK1/CgFvDv82s6Tdw5ZI5TSLJGxYRcPW5LRDMC2c5ZD8l392ZoNcQuc = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=6UQ+WV9JR1Bn99XuMQpkrvqCD8I=; b=MmgUzD645gxzMOIaK E81SawvaX6BItvksiUuwLYz+ES0s7FN5+8zKpJAiMV89qWa4p4uLPn4TrnHwFThu WuMpEQqcRcmEWe24QTv3S0/l3SkCrBBKHilacSVN0+ZnseyllX3/nvjMNugP7DlB Kv302B1rxJ/sPKKj1kZKglKEWU= Received: (qmail 70596 invoked by alias); 29 Apr 2015 16:12:25 -0000 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 Received: (qmail 70416 invoked by uid 89); 29 Apr 2015 16:12:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Apr 2015 16:12:22 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 29 Apr 2015 09:12:21 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.52]) by fmsmga001.fm.intel.com with ESMTP; 29 Apr 2015 09:12:20 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id 368FB200C82; Wed, 29 Apr 2015 09:12:20 -0700 (PDT) Date: Wed, 29 Apr 2015 09:12:20 -0700 From: "H.J. Lu" To: binutils@sourceware.org, GDB , gcc-patches@gcc.gnu.org Subject: [PATCH] PR ld/18355: --enable-shared doesn't work Message-ID: <20150429161220.GA28295@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) When bfd is configured as a shared library, we need to configure zlib with --enable-host-shared since zlib is used by bfd. Any comments, feedbacks, objections? H.J. --- PR ld/18355 * Makefile.def: Add extra_configure_flags to host zlib. * configure.ac (extra_host_zlib_configure_flags): New. Set to --enable-host-shared When bfd is to be built as shared library. AC_SUBST. * Makefile.in: Regenerated. * configure: Likewise. --- Makefile.def | 4 +++- Makefile.in | 20 +++++++++++++------- configure | 10 ++++++++++ configure.ac | 9 +++++++++ 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/Makefile.def b/Makefile.def index 4e76450..4394188 100644 --- a/Makefile.def +++ b/Makefile.def @@ -104,7 +104,9 @@ host_modules= { module= readline; }; host_modules= { module= sid; }; host_modules= { module= sim; }; host_modules= { module= texinfo; no_install= true; }; -host_modules= { module= zlib; no_install=true; no_check=true; bootstrap=true; }; +host_modules= { module= zlib; no_install=true; no_check=true; + bootstrap=true; + extra_configure_flags='@extra_host_zlib_configure_flags@';}; host_modules= { module= gdb; }; host_modules= { module= expect; }; host_modules= { module= guile; }; diff --git a/Makefile.in b/Makefile.in index cc05f7b..8ae261f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -26714,7 +26714,7 @@ configure-zlib: $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ + --target=${target_alias} @extra_host_zlib_configure_flags@ \ || exit 1 @endif zlib @@ -26749,7 +26749,8 @@ configure-stage1-zlib: $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ --target=${target_alias} \ \ - $(STAGE1_CONFIGURE_FLAGS) + $(STAGE1_CONFIGURE_FLAGS) \ + @extra_host_zlib_configure_flags@ @endif zlib-bootstrap .PHONY: configure-stage2-zlib maybe-configure-stage2-zlib @@ -26782,7 +26783,8 @@ configure-stage2-zlib: $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ --target=${target_alias} \ --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGE2_CONFIGURE_FLAGS) + $(STAGE2_CONFIGURE_FLAGS) \ + @extra_host_zlib_configure_flags@ @endif zlib-bootstrap .PHONY: configure-stage3-zlib maybe-configure-stage3-zlib @@ -26815,7 +26817,8 @@ configure-stage3-zlib: $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ --target=${target_alias} \ --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGE3_CONFIGURE_FLAGS) + $(STAGE3_CONFIGURE_FLAGS) \ + @extra_host_zlib_configure_flags@ @endif zlib-bootstrap .PHONY: configure-stage4-zlib maybe-configure-stage4-zlib @@ -26848,7 +26851,8 @@ configure-stage4-zlib: $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ --target=${target_alias} \ --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGE4_CONFIGURE_FLAGS) + $(STAGE4_CONFIGURE_FLAGS) \ + @extra_host_zlib_configure_flags@ @endif zlib-bootstrap .PHONY: configure-stageprofile-zlib maybe-configure-stageprofile-zlib @@ -26881,7 +26885,8 @@ configure-stageprofile-zlib: $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ --target=${target_alias} \ --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEprofile_CONFIGURE_FLAGS) + $(STAGEprofile_CONFIGURE_FLAGS) \ + @extra_host_zlib_configure_flags@ @endif zlib-bootstrap .PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib @@ -26914,7 +26919,8 @@ configure-stagefeedback-zlib: $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ --target=${target_alias} \ --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEfeedback_CONFIGURE_FLAGS) + $(STAGEfeedback_CONFIGURE_FLAGS) \ + @extra_host_zlib_configure_flags@ @endif zlib-bootstrap diff --git a/configure b/configure index 97250fa..426eece 100755 --- a/configure +++ b/configure @@ -643,6 +643,7 @@ CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET DEBUG_PREFIX_CFLAGS_FOR_TARGET SYSROOT_CFLAGS_FOR_TARGET +extra_host_zlib_configure_flags extra_host_libiberty_configure_flags stage1_languages extra_linker_plugin_flags @@ -6585,15 +6586,24 @@ fi # Sometimes we have special requirements for the host libiberty. extra_host_libiberty_configure_flags= +extra_host_zlib_configure_flags= case " $configdirs " in *" lto-plugin "* | *" libcc1 "*) # When these are to be built as shared libraries, the same applies to # libiberty. extra_host_libiberty_configure_flags=--enable-shared ;; + *" bfd "*) + # When bfd is to be built as a shared library, the same applies to + # zlib. + if test "$enable_shared" = "yes"; then + extra_host_zlib_configure_flags=--enable-host-shared + fi + ;; esac + # Produce a warning message for the subdirs we can't configure. # This isn't especially interesting in the Cygnus tree, but in the individual # FSF releases, it's important to let people know when their machine isn't diff --git a/configure.ac b/configure.ac index ef5f5b1..a81d781 100644 --- a/configure.ac +++ b/configure.ac @@ -2276,14 +2276,23 @@ fi # Sometimes we have special requirements for the host libiberty. extra_host_libiberty_configure_flags= +extra_host_zlib_configure_flags= case " $configdirs " in *" lto-plugin "* | *" libcc1 "*) # When these are to be built as shared libraries, the same applies to # libiberty. extra_host_libiberty_configure_flags=--enable-shared ;; + *" bfd "*) + # When bfd is to be built as a shared library, the same applies to + # zlib. + if test "$enable_shared" = "yes"; then + extra_host_zlib_configure_flags=--enable-host-shared + fi + ;; esac AC_SUBST(extra_host_libiberty_configure_flags) +AC_SUBST(extra_host_zlib_configure_flags) # Produce a warning message for the subdirs we can't configure. # This isn't especially interesting in the Cygnus tree, but in the individual