PIE static library builds
Bruce Richardson
bruce.richardson at intel.com
Tue Mar 14 17:29:43 CET 2023
On Tue, Mar 14, 2023 at 05:22:02PM +0100, Mattias Rönnblom wrote:
> Hi.
>
> Is the "b_staticpic" meson build option supposed to work with DPDK?
>
> Setting it to "false" (default is "true") causes link failures on Ubuntu
> 22.04, with GCC 9 and 11, on v23.03rc1 and v22.11:
>
> /usr/bin/ld: lib/librte_eal.a.p/eal_common_eal_common_errno.c.o: relocation
> R_X86_64_TPOFF32 against `per_lcore_retval.1' can not be used when making a
> shared object; recompile with -fPIC
> /usr/bin/ld: failed to set dynamic section sizes: bad value
> collect2: error: ld returned 1 exit status
>
> Does something per-lcore/TLS-related require PIC builds, even for static
> libraries?
>
I don't think that is the issue. The "issue" is that DPDK always does both
static and shared builds from the same object files, so without -fPIC the
shared library parts of the build fails. To support not using staticpic,
we'd have to disable building the .so's in those cases, or each C file
built twice.
/Bruce
More information about the dev
mailing list