From patchwork Wed Apr 1 12:04:25 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: 5954 Received: (qmail 46672 invoked by alias); 1 Apr 2015 12:04:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 46654 invoked by uid 89); 1 Apr 2015 12:04:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 01 Apr 2015 12:04:27 +0000 Received: by obbec2 with SMTP id ec2so74622512obb.3; Wed, 01 Apr 2015 05:04:26 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.80.103 with SMTP id q7mr39975490obx.18.1427889865957; Wed, 01 Apr 2015 05:04:25 -0700 (PDT) Received: by 10.76.54.14 with HTTP; Wed, 1 Apr 2015 05:04:25 -0700 (PDT) Date: Wed, 1 Apr 2015 05:04:25 -0700 Message-ID: Subject: PATCH: Update --with-system-zlib From: "H.J. Lu" To: Binutils , GDB , GCC Patches X-IsSubscribed: yes On Tue, Mar 31, 2015 at 10:04 AM, H.J. Lu wrote: > On Tue, Mar 31, 2015 at 10:01 AM, Mike Frysinger wrote: >> On 31 Mar 2015 09:56, H.J. Lu wrote: >>> On Tue, Mar 31, 2015 at 9:41 AM, Mike Frysinger wrote: >>> > On 31 Mar 2015 03:10, H.J. Lu wrote: >>> >> On Mon, Mar 30, 2015 at 11:13 PM, Mike Frysinger wrote: >>> >> > On 26 Mar 2015 08:57, H.J. Lu wrote: >>> >> >> --- a/bfd/configure.ac >>> >> >> +++ b/bfd/configure.ac >>> >> >> >>> >> >> -# Link in zlib if we can. This allows us to read compressed debug sections. >>> >> >> -# This is used only by compress.c. >>> >> >> -AM_ZLIB >>> >> >> +# Use the system's zlib library. >>> >> >> +zlibdir=-L../zlib >>> >> >> +zlibinc="-I\$(srcdir)/../zlib" >>> >> >> +AC_ARG_WITH(system-zlib, >>> >> >> +[AS_HELP_STRING([--with-system-zlib], [use installed libz])], >>> >> >> +zlibdir= >>> >> >> +zlibinc= >>> >> >> +) >>> >> > >>> >> > this is wrong. the 3rd arg is whether the option was specified, not that the >>> >> > option was disabled. you need to check $withval is equal to "no" (or not equal >>> >> > to "yes"). >>> >> >>> >> That is what gcc/configure.ac has and it works for me. >>> > >>> > then gcc/configure.ac is also broken. whether "it works for me" is >>> > irrelevant -- simply read the code and you'll see it's wrong. if you >>> > pass --without-system-zlib the code wrongly behaves as if you passed >>> > --with-system-zlib. >>> > >>> > i mention this because it is breaking my test builds. not that that >>> > really matters -- the code is clearly incorrect. >>> >>> We should fix zlib.m4 and use it in gcc/configure.ac. >> >> sure; i await your patches ;). i'm not trying to point fingers here for >> pointing's sake -- binutils & gdb were working before and now they're broken, >> and they broke due to the zlib patches you merged. so i think it's reasonable >> to expect you to drive further fixes (probably across gcc) even though the bug >> has existed in gcc for sometime. > > Sure. I have put it in my queue. > > Sorry for the inconvenience. > I checked the enclosed patches to update --with-system-zlib. They fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65645 in binutils-gdb tree and add --with-system-zlib to top level configure --help. From cf39cfc52ebd683d55fc396a77355f34b5094c04 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 1 Apr 2015 04:57:28 -0700 Subject: [PATCH 3/3] Add --with-system-zlib to top level configure The top level configure supports --with-system-zlib. This patch makes configure --help to display --with-system-zlib. * configure.ac: Add --with-system-zlib. * configure: Regenerated. --- ChangeLog | 5 +++++ configure | 8 ++++++++ configure.ac | 2 ++ 3 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 37450f4..457a6bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-04-01 H.J. Lu + + * configure.ac: Add --with-system-zlib. + * configure: Regenerated. + 2015-03-31 H.J. Lu * src-release.sh: Don't configure with --with-target-subdir=. diff --git a/configure b/configure index b719d38..97250fa 100755 --- a/configure +++ b/configure @@ -747,6 +747,7 @@ ospace_frag' ac_user_opts=' enable_option_checking with_build_libsubdir +with_system_zlib enable_as_accelerator_for enable_offload_targets enable_gold @@ -1518,6 +1519,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-build-libsubdir=DIR Directory where to find libraries for build system + --with-system-zlib use installed libz --with-mpc=PATH specify prefix directory for installed MPC package. Equivalent to --with-mpc-include=PATH/include plus --with-mpc-lib=PATH/lib @@ -2854,6 +2856,12 @@ if test x$with_gnu_as = xno ; then fi use_included_zlib= + +# Check whether --with-system-zlib was given. +if test "${with_system_zlib+set}" = set; then : + withval=$with_system_zlib; +fi + # Make sure we don't let ZLIB be added if we didn't want it. if test x$with_system_zlib = xyes ; then use_included_zlib=no diff --git a/configure.ac b/configure.ac index a4e4c7d..ef5f5b1 100644 --- a/configure.ac +++ b/configure.ac @@ -245,6 +245,8 @@ if test x$with_gnu_as = xno ; then fi use_included_zlib= +AC_ARG_WITH(system-zlib, +[AS_HELP_STRING([--with-system-zlib], [use installed libz])]) # Make sure we don't let ZLIB be added if we didn't want it. if test x$with_system_zlib = xyes ; then use_included_zlib=no -- 2.1.0