HomePhabricator

Refactor how -fno-semantic-interposition sets dso_local on default visibility…

Authored by MaskRay on Dec 31 2020, 1:59 PM.

Description

Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions

The idea is that the CC1 default for ELF should set dso_local on default
visibility external linkage definitions in the default -mrelocation-model pic
mode (-fpic/-fPIC) to match COFF/Mach-O and make output IR similar.

The refactoring is made available by 2820a2ca3a0e69c3f301845420e0067ffff2251b.

Currently only x86 supports local aliases. We move the decision to the driver.
There are three CC1 states:

  • -fsemantic-interposition: make some linkages interposable and make default visibility external linkage definitions dso_preemptable.
  • (default): selected if the target supports .Lfoo$local: make default visibility external linkage definitions dso_local
  • -fhalf-no-semantic-interposition: if neither option is set or the target does not support .Lfoo$local: like -fno-semantic-interposition but local aliases are not used. So references can be interposed if not optimized out.

Add -fhalf-no-semantic-interposition to a few tests using the half-based semantic interposition behavior.

Details

Committed
MaskRayDec 31 2020, 1:59 PM
Parents
rG219d00e0d909: [test] Make ELF tests immune to dso_local/dso_preemptable/(none) differences
Branches
Unknown
Tags
Unknown

Event Timeline

jsji added a subscriber: jsji.Jan 1 2021, 6:46 AM

@MaskRay Looks like this refactoring broke All ppc buildbots, please have a look or revert, thanks.

Hi, you commit failed clang-ppc64le-rhel buildbot: http://lab.llvm.org:8011/#/builders/57/builds/2938. Please take a look.