Skip to content

Commit

Permalink
[OpenMP] Fix not linking C libraries when enabled (#109168)
Browse files Browse the repository at this point in the history
Summary:
We used to do this automatically, add it back in to do it manually.
  • Loading branch information
jhuber6 authored Sep 18, 2024
1 parent b18190e commit 5f02558
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion offload/test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ def remove_suffix_if_present(name):
return name

def add_libraries(source):
return source + " " + config.llvm_library_intdir + "/libomptarget.devicertl.a"
if config.libomptarget_has_libc:
return source + " -Xoffload-linker " + "-lc " + \
"-Xoffload-linker " + "-lm " + \
config.llvm_library_intdir + "/libomptarget.devicertl.a"
else:
return source + " " + config.llvm_library_intdir + "/libomptarget.devicertl.a"

# Add platform targets
host_targets = [
Expand Down

0 comments on commit 5f02558

Please sign in to comment.