This happens when compiling arts (KDE sound server) 1.5.4: /usr/bin/ld: ./flow/gslpp/.libs/libgslpp.a(datahandle.o): relocation R_X86_64_PC32 against `vtable for GSL::WaveDataHandle' can not be used when making a shared object; recompile with -fPIC However, libgslpp.a and datahandle.o were built using -fPIC. This is the extract of the build log for building datahandle.o and libgslpp.a: g++ -DHAVE_CONFIG_H -I../../flow/gslpp -I/usr/src/ark/BUILD/arts/flow/gslpp -I../.. -I/usr/src/ark/BUILD/arts/flow -I/usr/src/ark/BUILD/arts/flow/gsl -I../../flow -I/usr/src/ark/BUILD/arts/mcop -I../../mcop -I../.. -I/usr/include/kde -I/usr/lib64/qt3-gcc4.1/include -I. -I/usr/src/ark/BUILD/arts/libltdl -DQT_THREAD_SUPPORT -D_REENTRANT -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -O2 -fomit-frame-pointer -fweb -frename-registers -fPIC -fno-exceptions -fno-check-new -fvisibility=hidden -fvisibility-inlines-hidden -D_GNU_SOURCE -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -ftemplate-depth-99 -fPIC -DPIC -c /usr/src/ark/BUILD/arts/flow/gslpp/datahandle.cpp -o ../../flow/gslpp/.libs/datahandle.o -Wp,-MD,../../flow/gslpp/.deps/datahandle.TUlo /bin/sh ../../libtool --silent --mode=link --tag=CXX g++ -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -O2 -fomit-frame-pointer -fweb -frename-registers -fPIC -fno-exceptions -fno-check-new -fvisibility=hidden -fvisibility-inlines-hidden -D_GNU_SOURCE -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -fvisibility=hidden -fvisibility-inlines-hidden -ftemplate-depth-99 -DQT_THREAD_SUPPORT -D_REENTRANT -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -o ../../flow/gslpp/libgslpp.la ../../flow/gslpp/datahandle.lo This worked correctly before; binutils version is 2.17.50.0.3 (just in case this is a binutils bug that just happened not to show up with earlier gccs).
This works for me with gcc 4.2.0 20060810 or 4.2.0 20060819 and binutils 2.17-2. Can you try to downgrade binutils to see if it works then?
Can you stop using HJL's special non FSF binutils? Can you try with a real snapshot of the FSF binutils before reporting bugs like this?
/usr/bin/ld: ./flow/gslpp/.libs/libgslpp.a(datahandle.o): relocation R_X86_64_PC32 against `vtable for GSL::WaveDataHandle' can not be used when making a shared object; recompile with -fPIC This looks more like a binutils issue as I think the vtable has been marked as hidden which means it can bind local which is what is happening here so this is a non bug unless someone can come up with a testcase or show the code to what the class definition of the above class looks like. And I doubt this is a regression also, more like a progression :).
This may be related to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218 Please provide # readelf -s --wide ./flow/gslpp/.libs/libgslpp.a | c++filt| grep "vtable for GSL::WaveDataHandle"
No testcase in 3 months so closing.