ld-gold, i386 without PIC and "/usr/bin/ld: -f may not be used without -shared"

Jeffrey Walton noloader@gmail.com
Wed Jul 6 15:52:00 GMT 2016


I'm working on Ubuntu 12.04 with Binutils 2.22. I have a test script
that builds a library under different configurations. The test fails
under the ld-gold test on i386 without PIC. The same test build
without ld.gold is fine.

$ make
...
g++ -DNDEBUG -g2 -O2 -march=native -pipe -c datatest.cpp
...
g++ -o cryptest.exe -DNDEBUG -g2 -O2 -march=native -pipe bench1.o
bench2.o test.o validat1.o validat2.o validat3.o adhoc.o datatest.o
regtest.o fipsalgt.o dlltest.o ./libcryptopp.a -pthread
-Wl,-fuse-ld=gold
/usr/bin/ld: -f may not be used without -shared
collect2: ld returned 1 exit status
make: *** [cryptest.exe] Error 1

And:

$ ld.gold -version
GNU gold (GNU Binutils for Ubuntu 2.22) 1.11

My questions are:

  * Is this expected
  * what are the options to work around it?



More information about the Binutils mailing list