https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117851
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 59747 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59747&action=edit gcc15-pr117851.patch Completely untested patch to make it working (at least for the explicit -pie or -shared linking). I must say I have no idea if lto-wrapper will see explicit -pie option in the --enable-default-pie case, otherwise perhaps there should be #ifdef ENABLE_DEFAULT_PIE bool pie_or_shared = true; #else bool pie_or_shared = false; #endif