You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Builds with -fPIC when --enable-static is used #117
-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.
As @StefanBruens said, static libraries can also need -fPIC, for example when linked into a shared library or plugin. I would prefer to keep it enabled by default for compatibility with those uses. The performance cost depends on the platform and workload.
Activity
StefanBruens commentedon Apr 27, 2022
-fPICis 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.
zayenz commentedon Nov 13, 2026
As @StefanBruens said, static libraries can also need
-fPIC, for example when linked into a shared library or plugin. I would prefer to keep it enabled by default for compatibility with those uses. The performance cost depends on the platform and workload.Gecode 7 will use CMake only, so we can make this configurable through CMake's position-independent code settings.