From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68278 invoked by alias); 2 Apr 2015 03:53:22 -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 68266 invoked by uid 89); 2 Apr 2015 03:53:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f177.google.com Received: from mail-ob0-f177.google.com (HELO mail-ob0-f177.google.com) (209.85.214.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 02 Apr 2015 03:53:20 +0000 Received: by obbec2 with SMTP id ec2so110205457obb.3 for ; Wed, 01 Apr 2015 20:53:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.133.49 with SMTP id oz17mr13576139oeb.58.1427946798193; Wed, 01 Apr 2015 20:53:18 -0700 (PDT) Received: by 10.76.178.170 with HTTP; Wed, 1 Apr 2015 20:53:17 -0700 (PDT) In-Reply-To: References: <1427730751.30498.4.camel@ubuntu-sellcey> <55197D8E.7070208@codesourcery.com> <1427735607.30498.7.camel@ubuntu-sellcey> <1427736975.30498.8.camel@ubuntu-sellcey> <5519A502.8040001@ericsson.com> <5519A5F3.3060505@ericsson.com> <551AD59A.9090507@ericsson.com> <551AD6EA.4070603@ericsson.com> Date: Thu, 02 Apr 2015 03:53:00 -0000 Message-ID: Subject: Re: [PATCH 1/8] Add --with-system-zlib in bfd From: "Bin.Cheng" To: "H.J. Lu" Cc: Antoine Tremblay , GDB Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00093.txt.bz2 On Thu, Apr 2, 2015 at 11:22 AM, Bin.Cheng wrote: > On Wed, Apr 1, 2015 at 4:16 AM, H.J. Lu wrote: >> On Tue, Mar 31, 2015 at 10:18 AM, Antoine Tremblay >> wrote: >>> >>> >>> On 03/31/2015 01:16 PM, H.J. Lu wrote: >>>> >>>> On Tue, Mar 31, 2015 at 10:12 AM, Antoine Tremblay >>>> wrote: >>>>>> >>>>>> Also doing ./configure in binutils/zlib I get : >>>>>> >>>>>> config.status: creating Makefile >>>>>> config.status: executing default-1 commands >>>>>> ./config.status: line 1190: ./../../config-ml.in: No such file or >>>>>> directory >>>>>> >>>>>> So configure does not exit cleanly...ideas? >>>>>> >>>>>> >>>>> >>>>> I did a bit more research on this issue and I get this if I build gdb >>>>> from >>>>> it's source directory >>>>> >>>>> in binutils-gdb >>>>> ./configure >>>>> make >>>>> >>>>> make fails with : while in zlib directory >>>>> >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: executing default-1 commands >>>>> ./config.status: line 1190: ./../../config-ml.in: No such file or >>>>> directory >>>>> >>>>> However if I build out of tree in like binutils-gdb/build for example I >>>>> do >>>>> not get this issue. >>>>> >>>>> Could this be related to 92c695a14f6a5a24b177e89624c13d7dbcbf9e1f ? >>>>> >>>>> Subject: [PATCH 09/76] A zlib to tarball >>>>> >>>>> I see this snippet there >>>>> >>>>> - ./configure --target=i386-pc-linux-gnu >>>>> + ./configure --target=i386-pc-linux-gnu \ >>>>> + --with-target-subdir=. \ >>>>> + --disable-multilib >>>>> >>>>> With these options I get around the configure problem only to fail in gas >>>>> with : >>>>> make[4]: Entering directory `/home/x/src/binutils-gdb/gas' >>>>> /bin/bash ./libtool --tag=CC --mode=link gcc -W -Wall >>>>> -Wstrict-prototypes >>>>> -Wmissing-prototypes -Wshadow -Werror -I./../zlib -g -O2 >>>>> -static-libstdc++ >>>>> -static-libgcc -o as-new app.o as.o atof-generic.o compress-debug.o >>>>> cond.o >>>>> depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o >>>>> flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o >>>>> listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o >>>>> stabs.o subsegs.o symbols.o write.o tc-i386.o obj-elf.o atof-ieee.o >>>>> ../opcodes/libopcodes.la ../bfd/libbfd.la ../libiberty/libiberty.a -ldl >>>>> libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes >>>>> -Wshadow -Werror -I./../zlib -g -O2 -static-libstdc++ -static-libgcc -o >>>>> as-new app.o as.o atof-generic.o compress-debug.o cond.o depend.o >>>>> dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o >>>>> flonum-konst.o >>>>> flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o >>>>> literal.o >>>>> macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o >>>>> symbols.o write.o tc-i386.o obj-elf.o atof-ieee.o >>>>> ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a >>>>> -L/home/x/src/binutils-gdb/zlib -lz ../libiberty/libiberty.a -ldl >>>>> /usr/bin/ld: cannot find -lz >>>>> >>>>> >>>>> This is with head as : 711a72d3d6f8cd3c3f408e718ff19aa4bfd2144e >>>>> >>>>> Did you try to compile directly in the src tree ? >>>>> >>>> >>>> Yes, I did. You need to add --disable-multilib, and maybe >>>> --with-target-subdir=. >>>> >>> >>> As I said if I add --disable-multilib, -with-target-subdir=. >>> >>> I get into the gas missing zlib error above ? >>> >>> Also I don't think it's a good idea that gdb would require options to >>> compile in it's source tree ? >>> >>> Is there a good reason for this ? >>> >>> >> >> It should be fixed now. >> > Is it possible that GDB cross build hasn't been fixed yet? If I cross > build GDB for arm-none-linux-gnueabi(hf) or aarch64-none-linux-gnu > with below configuration: > > ../binutils-gdb/configure --enable-64-bit-bfd > --enable-targets=arm-none-eabi,arm-none-linux-gnueabihf,armeb-none-eabi,armeb-none-linux-gnueabihf > --target=arm-none-linux-gnueabihf --disable-doc --disable-gdbtk > --disable-nls --disable-tui --without-python --without-x ... > > Yes zlib is built in build directory, and -lz is added on link command > line of as/gdb/sim, but option "-L/home/.../obj/binutils/zlib" is only > added for binutils program, not GDB/SIM. It seems to me gdb/sim still > use the system z library, rather than the built one. The readelf -dl > gives below information: > 0x0000000000000001 (NEEDED) Shared library: [libdl.so.2] > 0x0000000000000001 (NEEDED) Shared library: [libtinfo.so.5] > 0x0000000000000001 (NEEDED) Shared library: [libz.so.1] > 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] > 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] > > > We also do cross build with "build != host == target". In this > scenario, neither "-lz" and "-L..." option is't added in link command > line for gdb/sim. And I got below error message: > > ../bfd/libbfd.a(compress.o): In function `decompress_contents': > /home/binche01/work/systematic_testing/2015/workspace/build/bfd/../../binutils-gdb.old/bfd/compress.c:46: > undefined reference to `inflateInit_' > /home/binche01/work/systematic_testing/2015/workspace/build/bfd/../../binutils-gdb.old/bfd/compress.c:56: > undefined reference to `inflateReset' > /home/binche01/work/systematic_testing/2015/workspace/build/bfd/../../binutils-gdb.old/bfd/compress.c:53: > undefined reference to `inflate' > /home/binche01/work/systematic_testing/2015/workspace/build/bfd/../../binutils-gdb.old/bfd/compress.c:58: > undefined reference to `inflateEnd' > ../bfd/libbfd.a(compress.o): In function `bfd_compress_section_contents': > /home/binche01/work/systematic_testing/2015/workspace/build/bfd/../../binutils-gdb.old/bfd/compress.c:79: > undefined reference to `compressBound' > /home/binche01/work/systematic_testing/2015/workspace/build/bfd/../../binutils-gdb.old/bfd/compress.c:85: > undefined reference to `compress' > collect2: error: ld returned 1 exit status > Sorry my bad. My snapshot is just two commits behind the fix. So yes it is fixed. Thanks, bin > > Thanks, > bin >> >> -- >> H.J.