[Openmp-commits] [PATCH] D69927: [libomptarget] Export __kmp_internal_end_fini to fix [Thin]LTO build

Aaron Puchert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 14 19:20:15 PST 2019


aaronpuchert added a comment.

In D69927#1745659 <https://reviews.llvm.org/D69927#1745659>, @JonChesterfield wrote:

> There's probably an existing test for them.


I can't say if there is a test case specifically for this, but indeed there are around 40 failing tests when I remove both termination functions. So I guess that means it's somehow tested already. Now I feel a bit stupid for not trying this before.

> The function could be retained by marking it `__attribute__(("used"))`,

Just to be clear, ThinLTO wasn't optimizing out the destructor, just the `-Wl,-fini` function. But maybe I'm misunderstanding here.

> which may be necessary when statically linking this library anyway.

Why might it be necessary? I thought the destructor attribute is preserved in the object file, and on Unices static libraries are just collections of object files. Then the destructor should end up in the application binary, and should be registered there. Or do you mean that an application using libomp is completely statically linked, and doesn't even have a `.dynamic` section?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69927/new/

https://reviews.llvm.org/D69927





More information about the Openmp-commits mailing list