From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26617 invoked by alias); 30 Mar 2015 16:51:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26596 invoked by uid 89); 30 Mar 2015 16:51:02 -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-f181.google.com Received: from mail-ob0-f181.google.com (HELO mail-ob0-f181.google.com) (209.85.214.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 30 Mar 2015 16:51:01 +0000 Received: by obcjt1 with SMTP id jt1so128141175obc.2; Mon, 30 Mar 2015 09:50:59 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.28.39 with SMTP id y7mr27205458obg.11.1427734253673; Mon, 30 Mar 2015 09:50:53 -0700 (PDT) Received: by 10.76.134.102 with HTTP; Mon, 30 Mar 2015 09:50:53 -0700 (PDT) In-Reply-To: <55197D8E.7070208@codesourcery.com> References: <1427730751.30498.4.camel@ubuntu-sellcey> <55197D8E.7070208@codesourcery.com> Date: Mon, 30 Mar 2015 16:51:00 -0000 Message-ID: Subject: Re: [PATCH 1/8] Add --with-system-zlib in bfd From: "H.J. Lu" To: lgustavo@codesourcery.com Cc: sellcey@imgtec.com, Binutils , GDB Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01002.txt.bz2 On Mon, Mar 30, 2015 at 9:45 AM, Luis Machado wrote: > On 03/30/2015 01:31 PM, H.J. Lu wrote: >> >> On Mon, Mar 30, 2015 at 8:52 AM, Steve Ellcey wrote: >>> >>> On Sun, 2015-03-29 at 07:10 -0700, H.J. Lu wrote: >>>> >>>> On Thu, Mar 26, 2015 at 8:57 AM, H.J. Lu wrote: >>>>> >>>>> I imported zlib from GCC. This patch adds --with-system-zlib and >>>>> remove >>>>> --with-zlib in bfd. OK for master? >>> >>> >>> I think the global binutils-gdb Makefile needs to have a dependency of >>> bfd on zlib. If I build 'all-binutils' (using just the binutils-gdb >>> repository, not a combined tree with GCC) I get a build failure. If I >>> explicitly build all-zlib before building all-binutils it works, but I >>> should not have to do that. >>> >>> >>> /bin/sh ./libtool --tag=CC --mode=link gcc -W -Wall -Wstrict-prototypes >>> -Wmissing-prototypes -Wshadow -Werror >>> -I/scratch/sellcey/repos/nightly/src/binutils-gdb/bfd/../zlib -g -O2 -rpath >>> /scratch/sellcey/repos/nightly/install-mips-mti-linux-gnu/x86_64-unknown-linux-gnu/mips-mti-linux-gnu/lib >>> -release `cat libtool-soversion` -static-libstdc++ -static-libgcc -o >>> libbfd.la archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo >>> coff-bfd.lo compress.lo corefile.lo format.lo hash.lo init.lo libbfd.lo >>> linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo >>> stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo >>> `cat ofiles` -ldl -L../zlib -lz -ldl >>> ./libtool: line 5195: cd: ../zlib: No such file or directory >>> libtool: link: cannot determine absolute directory name of `../zlib' >>> make[3]: *** [libbfd.la] Error 1 >>> make[3]: Leaving directory >>> `/scratch/sellcey/repos/nightly/obj-mips-mti-linux-gnu/binutils-gdb/bfd' >>> make[2]: *** [all-recursive] Error 1 >>> make[2]: Leaving directory >>> `/scratch/sellcey/repos/nightly/obj-mips-mti-linux-gnu/binutils-gdb/bfd' >>> make[1]: *** [all] Error 2 >>> make[1]: Leaving directory >>> `/scratch/sellcey/repos/nightly/obj-mips-mti-linux-gnu/binutils-gdb/bfd' >>> make: *** [all-bfd] Error 2 >>> Error: Make command failed, stopping build. >> >> >> I will take a look. >> > > It seems GDB's Makefile.in is also missing a few bits to make sure it > includes ../zlib/libz.a in the final link step, otherwise it tries to pick > the system's zlib instead of the included zlib, which may fail if you have > an older libz installed. > > -- > > /usr/bin/ld: ../bfd/libbfd.a(compress.o): undefined reference to symbol > 'compressBound@@ZLIB_1.2.0' > //lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from > command line > collect2: error: ld returned 1 exit status > make[2]: *** [gdb] Error 1 > > -- > > We need something like libiberty in gdb/Makefile.in, but conditionalized > based on the configure switches to use the system's or the include zlib. > Please check out users/hjl/zlib branch. -- H.J.