Peter Wu
changed
bug 11617
What |
Removed |
Added |
Status |
UNCONFIRMED
|
CONFIRMED
|
Hardware |
x86
|
x86-64
|
Summary |
build error in extcap/androiddump.c.o
|
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
|
Ever confirmed |
|
1
|
Comment # 5
on bug 11617
from Peter Wu
Reproduced with Ubuntu 12.04.5 x86_64. It does not just fail on extcap, but on
linking anything, including androiddump and dumpcap.
/usr/bin/ld.bfd.real: CMakeFiles/dumpcap.dir/capture_opts.c.o: relocation
R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared
object; recompile with -fPIC
CMakeFiles/dumpcap.dir/capture_opts.c.o: could not read symbols: Bad value
Comparing
CMakeFiles/wsutil.dir/popcount.c.o and
CMakeFiles/caputils.dir/capture-pcap-util-unix.c.o
shows that the former has these additional command line options (make
VERBOSE=1):
-Dwsutil_EXPORTS
-DTOP_SRCDIR=\"/tmp/wireshark\"
-DWS_BUILD_DLL
-fPIC
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 gives you a compile_commands.json file.
Ubuntu 12.04 has cmake 2.8.7 and the resultant file has no -fPIC for some
files. cmake 3.3.2 on Arch Linux has -fPIC for all commands.
It seems that CMAKE_POSITION_INDEPENDENT_CODE is only supported starting from
CMake 2.8.9[1]. We can bump the minimum required cmake version from 2.8.3 to
2.8.9, disable -pie for older versions (users can still set CMAKE_*_FLAGS
manually) or add -fPIC to targets as needed.
Since bumping the minimum cmake version is likely not appreciated, I propose
the next simplest option: avoid adding -pie by default for older cmakes.
[1]: https://cmake.org/cmake/help/v3.0/policy/CMP0018.html
You are receiving this mail because:
- You are watching all bug changes.