This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld-gold, i386 without PIC and "/usr/bin/ld: -f may not be used without -shared"
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Wed, 6 Jul 2016 11:52:06 -0400
- Subject: ld-gold, i386 without PIC and "/usr/bin/ld: -f may not be used without -shared"
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
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?