[OpenMP] Fix not linking C libraries when enabled (#109168)

Summary:
We used to do this automatically, add it back in to do it manually.
This commit is contained in:
Joseph Huber
2024-09-18 10:02:16 -07:00
committed by GitHub
parent b18190ebfc
commit 5f02558d82

View File

@@ -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 = [