This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Fix compiling with asserts using the bitcode library
ClosedPublic

Authored by jhuber6 on Sep 9 2022, 11:23 AM.

Details

Summary

Sumnmary:
A previous patch introduces an exports file which contains all the
symbol names that are not internalized in the bitcode library. This is
done to reduce the size of the bitcode library and only export needed
functions. This export file must contain all the functoins expected to
be called from the device. Since its introduction the __assert_fail
function used to be provided but was mistakenly not included. This patch
adds it.

Fixes #57656

Diff Detail

Event Timeline

jhuber6 created this revision.Sep 9 2022, 11:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 11:23 AM
jhuber6 requested review of this revision.Sep 9 2022, 11:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2022, 11:23 AM
This revision is now accepted and ready to land.Sep 9 2022, 11:37 AM

It seems a bit sketchy to be defining libc symbols in the openmp runtime. Is there a reason we can't prefix these __omp or similar?

It seems a bit sketchy to be defining libc symbols in the openmp runtime. Is there a reason we can't prefix these __omp or similar?

Because assert is expanded to __assert_fail by the preprocessor, so we just provide that function.