llvm-project/openmp/runtime/cmake
Aaron Puchert b29c7fdb61 [OpenMP] Remove -Wl,-fini=__kmp_internal_end_fini
Summary:
The termination function duplicated the functionality of the
__attribute((destructor))-annotated function __kmp_internal_end_fini,
and we have no indication that this doesn't work.

The function might cause issues with link-time optimization turned on:
until very recently, none of the usual linkers was reporting functions
named in -Wl,-fini as used to the LTO plugin, so it might be dropped.
If the function is dropped, -Wl,-fini=__kmp_internal_end_fini doesn't
do what we want: with ld.bfd and lld it drops the FINI attribute from
.dynamic and with gold we get FINI = 0x0, which leads to a crash on
cleanup. This can be reproduced by building with

    -DLLVM_ENABLE_PROJECTS="clang;openmp" \
    -DLLVM_ENABLE_LTO=Thin \
    -DLLVM_USE_LINKER=gold

The issue in lld has been fixed in f95273f75a, but gold remains without
fix so far.

Fixes PR43927.

Reviewers: JonChesterfield, jdoerfert, AndreyChurbanov

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D69927
2019-11-19 00:54:58 +01:00
..
LibompCheckFortranFlag.cmake Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
LibompCheckLinkerFlag.cmake Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
LibompDefinitions.cmake [OpenMP] Remove OMP spec versioning 2019-07-12 21:45:36 +00:00
LibompExports.cmake [OpenMP] Remove OMP spec versioning 2019-07-12 21:45:36 +00:00
LibompGetArchitecture.cmake [OpenMP] RISCV64 port 2019-07-25 14:36:20 +00:00
LibompHandleFlags.cmake [OpenMP] Remove -Wl,-fini=__kmp_internal_end_fini 2019-11-19 00:54:58 +01:00
LibompMicroTests.cmake [OpenMP] RISCV64 port 2019-07-25 14:36:20 +00:00
LibompUtils.cmake [OpenMP] RISCV64 port 2019-07-25 14:36:20 +00:00
config-ix.cmake [OpenMP] Remove -Wl,-fini=__kmp_internal_end_fini 2019-11-19 00:54:58 +01:00