This patch changes the special-case handling of visibility when
compiling for an OpenMP target offloading device. This was orignally
added as a precaution against the bug encountered in PR41826 when
symbols in the device were being preempted by shared library symbols.
This should instead be done by making the visibility protected by default.
With protected visibility we are asserting that the symbols on the device
will never be preempted or preempt another symbol pending a shared library
load.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Changing to use default protected instead of passing -Bsymbolic this should be more portable and make the intentions clearer.
Does this still work with AMDGPU as we need it to?
clang/test/OpenMP/declare_target_codegen.cpp | ||
---|---|---|
293 | What happened here? |
clang/test/OpenMP/declare_target_codegen.cpp | ||
---|---|---|
293 | That was a special case I added that was only necessary when we were trying to remove things from being hidden. Now that hidden is not the default it's not necessary anymore. |
clang/test/OpenMP/declare_target_codegen.cpp | ||
---|---|---|
293 | can we keep the test (coverage) anyway |
Changing to use '-fvisibility=protected' when we construct the job. This is much more transparent and leaves the option open for the user to override it if they need default visibility.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5830 ↗ | (On Diff #401766) | I think we need some more code here to detect if the user has already specified a value for fvisibility so that we don't clobber it |
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
5830 ↗ | (On Diff #401766) | I put the code there with the intent of putting the else there, but forgot to actually put it there. |
What happened here?