ld: -r and -pie may not be used together
pothos opened this issue · comments
./build-rr.sh hw fails in linking with error ld: -r and -pie may not be used together
Maybe a solution is replacing -Wl,-r
only with -r
, but I'm not sure yet because of other compiler errors afterwards…
What (Linux) distribution are you building on which is enabling -pie
? The compiler specs in app-tools have never been tested in this situation and would need to be updated to disable -pie
.
Martin Lucina writes ("Re: [rumpkernel/rumprun] ld: -r and -pie may not be used together (#85)"):
What (Linux) distribution are you building on which is enabling
-pie? The compiler specs in app-tools have never been tested in this
situation and would need to be updated to disable -pie.
Debian stretch's gcc generally has -pie (or something in this area)
enabled by default.
Ian.
I have the same problem. Any news?
The same problem on Ubuntu 16.10, works fine on 16.04
EDIT1:
It seams like they added -pie by default
https://wiki.ubuntu.com/SecurityTeam/PIE
EDIT2:
Compiling everything with -no-pie flags doesn't work either
In file included from /usr/include/c++/6/stdlib.h:36:0, from rumprun/src-netbsd/sys/lib/libunwind/UnwindCursor.hpp:16, from rumprun/src-netbsd/sys/lib/libunwind/libunwind.cxx:18: rumprun/obj-amd64-hw/dest.stage/include/c++/cstdlib:98:9: error: '::div_t' has not been declared using ::div_t; ^~~~~ rumprun/obj-amd64-hw/dest.stage/include/c++/cstdlib:99:9: error: '::ldiv_t' has not been declared using ::ldiv_t; ^~~~~~ rumprun/obj-amd64-hw/dest.stage/include/c++/cstdlib:101:9: error: '::lldiv_t' has not been declared using ::lldiv_t; ^~~~~~~
@gandro Thans a lot!
Combining CXX=false and -no-pie flags seems to work on my Ubuntu 16.10
CXX=false ./build-rr.sh hw -- -F ACLFLAGS=-no-pie
Unfortunately -no-pie is not supported by all gcc versions, so it should be added conditionally.
Still a problem on Ubuntu 17.04
On Debian Stretch when I use CXX=false ./build-rr.sh hw -- -F ACLFLAGS=-no-pie
everything will successfully build, but when I try and compile anything with x86_64-rumprun-netbsd-gcc
I get the error cc1: error: command line option '--no-pie' is valid for the driver but not for C
. Running with --verbose it seems that -no-pie
is being passed to /usr/lib/gcc/x86_64-linux-gnu/6/cc1
which doesn't accept that flag. Does anyone else experience the same behavior?