Skip to content

Commit 5f02558

Browse files
authored
[OpenMP] Fix not linking C libraries when enabled (#109168)
Summary: We used to do this automatically, add it back in to do it manually.
1 parent b18190e commit 5f02558

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

offload/test/lit.cfg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,12 @@ def remove_suffix_if_present(name):
182182
return name
183183

184184
def add_libraries(source):
185-
return source + " " + config.llvm_library_intdir + "/libomptarget.devicertl.a"
185+
if config.libomptarget_has_libc:
186+
return source + " -Xoffload-linker " + "-lc " + \
187+
"-Xoffload-linker " + "-lm " + \
188+
config.llvm_library_intdir + "/libomptarget.devicertl.a"
189+
else:
190+
return source + " " + config.llvm_library_intdir + "/libomptarget.devicertl.a"
186191

187192
# Add platform targets
188193
host_targets = [

0 commit comments

Comments
 (0)