Skip to content

[Offload] Fix PowerPC builds that pass -mcpu #138327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions offload/DeviceRTL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,12 @@ function(compileDeviceRTLLibrary target_name target_triple)
BUILD_RPATH ""
INSTALL_RPATH ""
RUNTIME_OUTPUT_NAME libomptarget-${target_name}.bc)
target_compile_options(libomptarget-${target_name} PRIVATE "--target=${target_triple}" "-fuse-ld=lld" "-march=")
target_compile_options(libomptarget-${target_name} PRIVATE
"--target=${target_triple}" "-fuse-ld=lld" "-march=" "-mcpu="
"-Wno-unused-command-line-argument")
target_link_options(libomptarget-${target_name} PRIVATE "--target=${target_triple}"
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm" "-fuse-ld=lld" "-march=")
"-mcpu=power8" "-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we hard code power8 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, oops, forgot to delete that to check that it fixed the error Tom reported.

"-fuse-ld=lld" "-march=" "-mcpu=")
install(TARGETS libomptarget-${target_name}
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${target_triple}")
Expand All @@ -152,7 +155,8 @@ function(compileDeviceRTLLibrary target_name target_triple)
)
target_link_libraries(omptarget.${target_name} PRIVATE omptarget.${target_name}.all_objs)
target_link_options(omptarget.${target_name} PRIVATE "--target=${target_triple}"
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm" "-fuse-ld=lld" "-march=")
"-Wno-unused-command-line-argument""-r" "-nostdlib" "-flto"
"-Wl,--lto-emit-llvm" "-fuse-ld=lld" "-march=" "-mcpu=")

install(TARGETS omptarget.${target_name}
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${target_triple}")
Expand Down
Loading