[Bug driver/100937] configure: Add --enable-default-semantic-interposition

i at maskray dot me gcc-bugzilla@gcc.gnu.org
Sun Jun 6 23:15:26 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100937

Fangrui Song <i at maskray dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WONTFIX                     |---
             Status|RESOLVED                    |UNCONFIRMED

--- Comment #2 from Fangrui Song <i at maskray dot me> ---
How is it a portability problem?

clang -fpic has always been allowing interprocedural optimizations for
non-vague-linkage function definitions. FreeBSD uses clang and software works
with no problem.




For a vague-linkage function definition, a call site in the same
translation unit may inline the callee. Whether
-fno-semantic-interposition is enabled/disabled has no effect.

For a non-vague-linkage function definition, by default
(-fsemantic-interposition) the -fpic mode does not allow a call site
in the same translation unit to inline the callee or perform other
interprocedural optimizations.
-fno-semantic-interposition re-enables interprocedural optimizations.

If a caller inlines a callee, using LD_PRELOAD to interpose the callee
will not affect the caller. But many other LD_PRELOAD usage still
work.
We consider the small LD_PRELOAD limitation a good trade off for the speedup.


More information about the Gcc-bugs mailing list