Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds with -fPIC when --enable-static is used #117

Open
yurivict opened this issue Jun 6, 2021 · 1 comment
Open

Builds with -fPIC when --enable-static is used #117

yurivict opened this issue Jun 6, 2021 · 1 comment

Comments

@yurivict
Copy link

yurivict commented Jun 6, 2021

-fPIC should only be used for shared libraries.
-fPIC reduces code performance therefore defearing the purpose of static libraries.

Version 6.3.0
OS: FreeBSD 13

@StefanBruens
Copy link

-fPIC is also correct for static libraries, and required when you want to build a position-independent executable.

And when you build shared libraries with LTO (link-time-optimization), you typically end up with faster code due to cross-translation-unit optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants