https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104895
--- Comment #1 from Christoph Müllner <christophm30 at gmail dot com> --- Compiling with '-v' shows the following differences: BAD: gcc -v -fPIC -flto=auto -shared -Wl,-soname,"lib'do it'.so" -o "lib'do it'.so" doit.o [...] COLLECT_GCC_OPTIONS='-v' '-fPIC' '-flto=auto' '-shared' '-o' 'lib'\''do it'\''.so' '-mtune=generic' '-march=x86-64' '-dumpdir' 'lib'\''do it'\''.so.' [...] COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-v' '-fPIC' '-shared' '-mtune=generic' '-march=x86-64' '-fltrans-output-list=/tmp/ccfiSKsT.ltrans.out' '-fwpa=16' '-fresolution=/tmp/ccOyShqf.res' '-flinker-output=dyn' [...] COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-v' '-fPIC' '-shared' '-mtune=generic' '-march=x86-64' '-fltrans-output-list=/tmp/ccfiSKsT.ltrans.out' '-fwpa=16' '-fresolution=/tmp/ccOyShqf.res' '-flinker-output=dyn' '-dumpdir' './lib'\''do it'\''.so.wpa.' make -f /tmp/ccNUrSeQ.mk -j16 all [...] COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-v' '-fPIC' '-shared' '-mtune=generic' '-march=x86-64' '-fltrans' '-o' '/tmp/ccfiSKsT.ltrans0.ltrans.o' '-dumpdir' './libdo-' /usr/libexec/gcc/x86_64-redhat-linux/11/lto1 -quiet -dumpdir ./libdo- -dumpbase ccfiSKsT.ltrans0.ltrans. -dumpbase-ext . -mtune=generic -march=x86-64 -version -fno-openmp -fno-openacc -fcf-protection=none -fPIC -fltrans it.so. it.so.ltrans0.ltrans /tmp/ccfiSKsT.ltrans0.o -o /tmp/ccCtIFo1.s [...] GOOD: gcc -v -fPIC -flto -shared -Wl,-soname,"lib'do it'.so" -o "lib'do it'.so" doit.o [...] COLLECT_GCC_OPTIONS='-v' '-fPIC' '-flto' '-shared' '-o' 'lib'\''do it'\''.so' '-mtune=generic' '-march=x86-64' '-dumpdir' 'lib'\''do it'\''.so.' [...] COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-v' '-fPIC' '-shared' '-mtune=generic' '-march=x86-64' '-fltrans-output-list=/tmp/ccMA9joX.ltrans.out' '-fwpa' '-fresolution=/tmp/cceTYxPV.res' '-flinker-output=dyn' [...] COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-v' '-fPIC' '-shared' '-mtune=generic' '-march=x86-64' '-fltrans-output-list=/tmp/ccMA9joX.ltrans.out' '-fwpa' '-fresolution=/tmp/cceTYxPV.res' '-flinker-output=dyn' '-dumpdir' './lib'\''do it'\''.so.wpa.' [...] COLLECT_GCC_OPTIONS='-c' '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-v' '-fPIC' '-shared' '-mtune=generic' '-march=x86-64' '-fltrans' '-o' '/tmp/ccMA9joX.ltrans0.ltrans.o' /usr/libexec/gcc/x86_64-redhat-linux/11/lto1 -quiet -dumpbase ./lib'do it'.so.ltrans0.ltrans -mtune=generic -march=x86-64 -version -fno-openmp -fno-openacc -fcf-protection=none -fPIC -fltrans @/tmp/ccpufIq0 -o /tmp/ccyVUMgZ.s The first three differences look ok: In the good case we have '-fwpa', and in the base case '-fwpa=16', which looks sane. In the last diff we can see a wrong behaviour: In the good case we have: * '-dumpbase ./lib'do it'.so.ltrans0.ltrans', and * '-fltrans it.so. it.so.ltrans0.ltrans /tmp/ccfiSKsT.ltrans0.o' In the bad case we have: * '-dumpdir ./libdo- -dumpbase ccfiSKsT.ltrans0.ltrans. -dumpbase-ext .' * '-fltrans @/tmp/ccpufIq0 -o /tmp/ccyVUMgZ.s'