tcpdump mailing list archives
Re: -fPIC for libnetdissect
From: Guy Harris <guy () alum mit edu>
Date: Sun, 30 Oct 2016 11:52:01 -0700
On Oct 30, 2016, at 9:18 AM, Michael Richardson <mcr () sandelman ca> wrote:
When building libnetdissect into a virtual switch (uml_netjig), I started to get: /usr/bin/ld: /home/mcr/stuff/x86_64/tcpdump-4.8.1/libnetdissect.a(print-ripng.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC which is odd, since I'm not trying to make a shared object, just a final link of the executable. But, adding -fPIC to the build works. a) any reason we shouldn't build with -fPIC when using gcc?
Well, there might be platforms on which -fpic would be sufficient, but -fPIC appears to be necessary for x86-64 - and I wouldn't be surprised if it's necessary on SPARC as well.
b) any advince in a way that doesn't shoot non-gcc builds in the foot?
We could pick up the stuff in libpcap for building *it* as a shared library, and adjust as necessary for netdissect, e.g. adding x86-64 (at least on some OSes) to the set of platforms where we need -fPIC. _______________________________________________ tcpdump-workers mailing list tcpdump-workers () lists tcpdump org https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers
Current thread:
- -fPIC for libnetdissect Michael Richardson (Oct 30)
- Re: -fPIC for libnetdissect Guy Harris (Oct 30)