Skip to content

My meson.build constructs an erroneous c++ or ld command: some error about -fPIC, what's it mean and how to rectify? #14068

Closed Answered by eli-schwartz
metaleap asked this question in Q&A
Discussion options

You must be logged in to vote
/usr/local/lib/WickedEngine/libWickedEngine_Linux.a(wiFont.cpp.o)

This file is built without support for using in a shared library. Shared libraries require PIC. Static libraries can optionally use PIC, but if they don't use PIC then you can only link them into executables, not into shared libraries.

There are security considerations that suggest using PIC for all code, even code intended for static linking into a binary, and also modest performance penalties for doing so (32-bit systems). Many people simply compile all objects with PIC and save themselves a lot of trouble.

There's nothing meson can do about this -- the cmake-built static library was compiled with options that don't supp…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@dcbaker
Comment options

Answer selected by metaleap
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants