https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63784

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 33931
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33931&action=edit
A testcase

[hjl@gnu-6 pr63784]$ make
./libtool --tag=CXX   --mode=compile
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++       -g -O2 -c -o foo.lo
foo.cc
libtool: compile:  /export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ -g -O2
-c foo.cc  -fPIC -DPIC -o .libs/foo.o
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/gcc -flto -fPIC -g -O2 -c -o
bar.o bar.c
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/gcc-ar rv libiberty.a bar.o
/usr/local/bin/ar: creating libiberty.a
a - bar.o
CXX=/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ \
./libtool --tag=CXX   --mode=link
/export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++  -g -O2 -rpath
/export/home/hjl/bugs/gcc/pr63784  -o libcc1.la  foo.lo libiberty.a 

*** Warning: Linking the shared library libcc1.la against the
*** static library libiberty.a is not portable!
libtool: link: /export/build/gnu/gcc/release/usr/gcc-5.0.0/bin/g++ -shared
-nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtbeginS.o  .libs/foo.o   libiberty.a
-L/usr/lib/gcc/x86_64-redhat-linux/4.8.3
-L/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../.. -lstdc++
-lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.8.3/crtendS.o
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/../../../../lib64/crtn.o    -Wl,-soname
-Wl,libcc1.so.0 -o .libs/libcc1.so.0.0.0
/usr/local/bin/ld: /tmp/ccEkQEhc.ltrans0.ltrans.o: relocation R_X86_64_32S
against `i' can not be used when making a shared object; recompile with -fPIC
/tmp/ccEkQEhc.ltrans0.ltrans.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [libcc1.la] Error 1
[hjl@gnu-6 pr63784]$

Reply via email to