From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84854 invoked by alias); 9 Aug 2017 02:10:39 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 82223 invoked by uid 89); 9 Aug 2017 02:10:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-oi0-f65.google.com Received: from mail-oi0-f65.google.com (HELO mail-oi0-f65.google.com) (209.85.218.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Aug 2017 02:10:22 +0000 Received: by mail-oi0-f65.google.com with SMTP id e124so4548603oig.0 for ; Tue, 08 Aug 2017 19:10:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MUQSV3VTJQ0THioET5xFoLF+tHgL/9h26IGzulkWdsQ=; b=YJ2g8kWb6rov2lCaXlwutvZ6xPKrzcrhnm1VXA60j78tsc0QahR54/ef4NSKnYTF5v fUSZJjuJ7EBaeYq8h++JnhW7dJen5Z0MoUb8jkSyNTZUc3BFya/xM+FWtbuJlIEiNsdp U1pTrzUQ8UGYe/xzPnpuVkKR5blh/QDxgvzQNSkVYGmDbxaQQ6xL1FFuXyq95WpqfVRM MLitdQTb6tL9FwecXcyfh4NZy0sN4+8FwakcAc2+Vb0RZ3ulH4uFFp9G17YVXnNe1a4g dtSTNciZmtM/h2H4Hg2/278Lp5ruW78I6MCADdv4TIhzpC7TYtqcIdCvMKYfpig9c/Zl VIzA== X-Gm-Message-State: AHYfb5ikgzYFVaeUOF47Z5JalGzYJCzmZLntuxGmOg9QEppyGy9uYSlH qCIKFJ0DQnwstfG1D3Fe6ccg6FUdyg== X-Received: by 10.202.219.198 with SMTP id s189mr7351416oig.103.1502244620908; Tue, 08 Aug 2017 19:10:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.136.75 with HTTP; Tue, 8 Aug 2017 19:10:20 -0700 (PDT) In-Reply-To: References: <20170808211705.GA3961@gmail.com> <20170808223922.GE16312@bubble.grove.modra.org> From: "H.J. Lu" Date: Wed, 09 Aug 2017 02:10:00 -0000 Message-ID: Subject: Re: [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath To: Alan Modra Cc: Binutils Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00090.txt.bz2 On Tue, Aug 8, 2017 at 4:36 PM, H.J. Lu wrote: > On Tue, Aug 8, 2017 at 3:39 PM, Alan Modra wrote: >> On Tue, Aug 08, 2017 at 02:17:05PM -0700, H.J. Lu wrote: >>> --- a/ld/configure.ac >>> +++ b/ld/configure.ac >>> @@ -470,7 +470,7 @@ EMULATION_LIBPATH=3D$all_libpath >>> AC_SUBST(EMULATION_LIBPATH) >>> >>> if test x${enable_static} =3D xno; then >>> - TESTBFDLIB=3D"--rpath ../bfd/.libs ../bfd/.libs/libbfd.so" >>> + TESTBFDLIB=3D"-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so" >>> else >>> TESTBFDLIB=3D"../bfd/.libs/libbfd.a" >>> fi >> >> Does that actually work? I thought you needed to write -Wl options >> without the spaces.. >> >> TESTBFDLIB=3D"-Wl,--rpath,../bfd/.libs,../bfd/.libs/libbfd.so" >> > > Yes, a `,' is needed. For some reason, it passed the tests without it. > > I got lucky. -Wl,--rpath ../bfd/.libs works: [hjl@gnu-tools-1 ld]$ gcc -B/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdir/gccld2/ -L/usr/local/x86_64-pc-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/x86_64-pc-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib -o tmpdir/xxx -Wl,--relax ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf32_x86_64.o eelf_i386.o eelf_iamcu.o ei386linux.o eelf_l1om.o eelf_k1om.o ldbuildid.o -Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so ../libiberty/libiberty.a -L../zlib -lz -ldl -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=3Dc,c++,objc,obj-c++,fortran,ada,go,lto --prefix=3D/usr --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-bugurl=3Dhttp://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=3Dposix --enable-checking=3Drelease --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=3Dgnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=3Dnvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=3Dgeneric --with-arch_32=3Di686 --with-multilib-list=3Dm32,m64,mx32 --build=3Dx86_64-redhat-linux Thread model: posix gcc version 7.1.1 20170709 (Red Hat 7.1.1-4) (GCC) COMPILER_PATH=3D/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdi= r/gccld2/:/usr/libexec/gcc/x86_64-redhat-linux/7/:/usr/libexec/gcc/x86_64-r= edhat-linux/7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-re= dhat-linux/7/:/usr/lib/gcc/x86_64-redhat-linux/ LIBRARY_PATH=3D/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdir= /gccld2/:/usr/lib/gcc/x86_64-redhat-linux/7/:/usr/lib/gcc/x86_64-redhat-lin= ux/7/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_= 64-redhat-linux/7/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS=3D'-B' '/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdir/gccld2/' '-L/usr/local/x86_64-pc-linux-gnu/lib64' '-L/usr/local/lib64' '-L/lib64' '-L/usr/lib64' '-L/usr/local/x86_64-pc-linux-gnu/lib' '-L/usr/local/lib' '-L/lib' '-L/usr/lib' '-o' 'tmpdir/xxx' '-L../zlib' '-v' '-mtune=3Dgeneric' '-march=3Dx86-64' /usr/libexec/gcc/x86_64-redhat-linux/7/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/7/liblto_plugin.so -plugin-opt=3D/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper -plugin-opt=3D-fresolution=3D/tmp/cc8hQvTc.res -plugin-opt=3D-pass-through=3D-lgcc -plugin-opt=3D-pass-through=3D-lgcc_s -plugin-opt=3D-pass-through=3D-lc -plugin-opt=3D-pass-through=3D-lgcc -plugin-opt=3D-pass-through=3D-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=3Dgnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o tmpdir/xxx /usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/7/crtbegin.o -L/usr/local/x86_64-pc-linux-gnu/lib64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/x86_64-pc-linux-gnu/lib -L/usr/local/lib -L/lib -L/usr/lib -L../zlib -L/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdir/gccld2 -L/usr/lib/gcc/x86_64-redhat-linux/7 -L/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/7/../../.. --relax ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf32_x86_64.o eelf_i386.o eelf_iamcu.o ei386linux.o eelf_l1om.o eelf_k1om.o ldbuildid.o --rpath ../bfd/.libs ../bfd/.libs/libbfd.so ../libiberty/libiberty.a -lz -ldl -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/7/crtend.o /usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crtn.o COLLECT_GCC_OPTIONS=3D'-B' '/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdir/gccld2/' '-L/usr/local/x86_64-pc-linux-gnu/lib64' '-L/usr/local/lib64' '-L/lib64' '-L/usr/lib64' '-L/usr/local/x86_64-pc-linux-gnu/lib' '-L/usr/local/lib' '-L/lib' '-L/usr/lib' '-o' 'tmpdir/xxx' '-L../zlib' '-v' '-mtune=3Dgeneric' '-march=3Dx86-64' [hjl@gnu-tools-1 ld]$ I will add '.' anyway. --=20 H.J.