https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94138
--- Comment #11 from Martin Liška <marxin at gcc dot gnu.org> --- Good, now I can see a similar issue: $ gcc -o cache_locality_test -L. libfolly.so -pthread CacheLocalityTest.o -shared /usr/bin/ld: /tmp/cache_locality_test.Kz3DE7.ltrans0.ltrans.o: relocation R_X86_64_TPOFF32 against `_ZL10testingCpu' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status and I can confirm adding -fPIC helps.