public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath
@ 2017-08-08 21:17 H.J. Lu
  2017-08-08 22:39 ` Alan Modra
  0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2017-08-08 21:17 UTC (permalink / raw)
  To: binutils

"--rpath ../bfd/.libs ../bfd/.libs/libbfd.so" isn't a valid compiler
command-line option.  We should use -Wl,--rpath instead of --rpath.

	PR ld/21923
	* configure.ac (TESTBFDLIB): Replace --rpath with -Wl,--rpath
	for --disable-static.
	* configure: Regenerated.
---
 ld/ChangeLog    | 7 +++++++
 ld/configure    | 2 +-
 ld/configure.ac | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 645c0fe636..65ddf6b145 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR ld/21923
+	* configure.ac (TESTBFDLIB): Replace --rpath with -Wl,--rpath
+	for --disable-static.
+	* configure: Regenerated.
+
 2017-08-08  Romain Geissler  <romain.geissler@gmail.com>
 	    Alan Modra  <amodra@gmail.com>
 
diff --git a/ld/configure b/ld/configure
index de709d3a82..f1d1f0e9e8 100755
--- a/ld/configure
+++ b/ld/configure
@@ -17298,7 +17298,7 @@ EMULATION_LIBPATH=$all_libpath
 
 
 if test x${enable_static} = xno; then
-  TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
+  TESTBFDLIB="-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
 else
   TESTBFDLIB="../bfd/.libs/libbfd.a"
 fi
diff --git a/ld/configure.ac b/ld/configure.ac
index 99d127bd11..9bada13208 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -470,7 +470,7 @@ EMULATION_LIBPATH=$all_libpath
 AC_SUBST(EMULATION_LIBPATH)
 
 if test x${enable_static} = xno; then
-  TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
+  TESTBFDLIB="-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
 else
   TESTBFDLIB="../bfd/.libs/libbfd.a"
 fi
-- 
2.13.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath
  2017-08-08 21:17 [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath H.J. Lu
@ 2017-08-08 22:39 ` Alan Modra
  2017-08-08 23:36   ` H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2017-08-08 22:39 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

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=$all_libpath
>  AC_SUBST(EMULATION_LIBPATH)
>  
>  if test x${enable_static} = xno; then
> -  TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
> +  TESTBFDLIB="-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>  else
>    TESTBFDLIB="../bfd/.libs/libbfd.a"
>  fi

Does that actually work?  I thought you needed to write -Wl options
without the spaces..

TESTBFDLIB="-Wl,--rpath,../bfd/.libs,../bfd/.libs/libbfd.so"

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath
  2017-08-08 22:39 ` Alan Modra
@ 2017-08-08 23:36   ` H.J. Lu
  2017-08-09  2:10     ` H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2017-08-08 23:36 UTC (permalink / raw)
  To: Alan Modra; +Cc: Binutils

On Tue, Aug 8, 2017 at 3:39 PM, Alan Modra <amodra@gmail.com> 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=$all_libpath
>>  AC_SUBST(EMULATION_LIBPATH)
>>
>>  if test x${enable_static} = xno; then
>> -  TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>> +  TESTBFDLIB="-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>>  else
>>    TESTBFDLIB="../bfd/.libs/libbfd.a"
>>  fi
>
> Does that actually work?  I thought you needed to write -Wl options
> without the spaces..
>
> TESTBFDLIB="-Wl,--rpath,../bfd/.libs,../bfd/.libs/libbfd.so"
>

Yes, a `,' is needed.  For some reason, it passed the tests without it.


-- 
H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath
  2017-08-08 23:36   ` H.J. Lu
@ 2017-08-09  2:10     ` H.J. Lu
  2017-08-13 12:54       ` H.J. Lu
  0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2017-08-09  2:10 UTC (permalink / raw)
  To: Alan Modra; +Cc: Binutils

On Tue, Aug 8, 2017 at 4:36 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Aug 8, 2017 at 3:39 PM, Alan Modra <amodra@gmail.com> 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=$all_libpath
>>>  AC_SUBST(EMULATION_LIBPATH)
>>>
>>>  if test x${enable_static} = xno; then
>>> -  TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>>> +  TESTBFDLIB="-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>>>  else
>>>    TESTBFDLIB="../bfd/.libs/libbfd.a"
>>>  fi
>>
>> Does that actually work?  I thought you needed to write -Wl options
>> without the spaces..
>>
>> TESTBFDLIB="-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=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --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=gnu --enable-plugin --enable-initfini-array
--with-isl --enable-libmpx --enable-offload-targets=nvptx-none
--without-cuda-driver --enable-gnu-indirect-function
--with-tune=generic --with-arch_32=i686
--with-multilib-list=m32,m64,mx32 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.1.1 20170709 (Red Hat 7.1.1-4) (GCC)
COMPILER_PATH=/export/build/gnu/binutils-misc/build-x86_64-linux/ld/tmpdir/gccld2/:/usr/libexec/gcc/x86_64-redhat-linux/7/:/usr/libexec/gcc/x86_64-redhat-linux/7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/7/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/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-linux/7/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-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=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/7/collect2 -plugin
/usr/libexec/gcc/x86_64-redhat-linux/7/liblto_plugin.so
-plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
-plugin-opt=-fresolution=/tmp/cc8hQvTc.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed
--eh-frame-hdr --hash-style=gnu -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='-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=generic' '-march=x86-64'
[hjl@gnu-tools-1 ld]$

I will add '.' anyway.

-- 
H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath
  2017-08-09  2:10     ` H.J. Lu
@ 2017-08-13 12:54       ` H.J. Lu
  0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2017-08-13 12:54 UTC (permalink / raw)
  To: Alan Modra; +Cc: Binutils

On Tue, Aug 8, 2017 at 7:10 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Aug 8, 2017 at 4:36 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Tue, Aug 8, 2017 at 3:39 PM, Alan Modra <amodra@gmail.com> 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=$all_libpath
>>>>  AC_SUBST(EMULATION_LIBPATH)
>>>>
>>>>  if test x${enable_static} = xno; then
>>>> -  TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>>>> +  TESTBFDLIB="-Wl,--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
>>>>  else
>>>>    TESTBFDLIB="../bfd/.libs/libbfd.a"
>>>>  fi
>>>
>>> Does that actually work?  I thought you needed to write -Wl options
>>> without the spaces..
>>>
>>> TESTBFDLIB="-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:

> I will add '.' anyway.
>

I am backporting these 2 patches to 2.29 branch.

-- 
H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-13 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 21:17 [committed, PATCH] PR ld/21923: Replace --rpath with -Wl,--rpath H.J. Lu
2017-08-08 22:39 ` Alan Modra
2017-08-08 23:36   ` H.J. Lu
2017-08-09  2:10     ` H.J. Lu
2017-08-13 12:54       ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).