https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42679
--- Comment #25 from Jean-Michaƫl Celerier <jeanmichael.celerier at gmail dot com> --- My code is built with CMake with CMAKE_POSITION_INDEPENDENT_CODE set, which (I double checked) correctly adds -fPIC to the link line.