Skip to content

Commit 1fe70f0

Browse files
jhuber6github-actions[bot]
authored andcommitted
Automerge: [Offload] Fix PowerPC builds that pass -mcpu (#138327)
Summary: Another hacky fix done until llvm/llvm-project#136729 lands. This time for `-mcpu`.
2 parents 4c33d2e + dbe070e commit 1fe70f0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

offload/DeviceRTL/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ function(compileDeviceRTLLibrary target_name target_triple)
132132
BUILD_RPATH ""
133133
INSTALL_RPATH ""
134134
RUNTIME_OUTPUT_NAME libomptarget-${target_name}.bc)
135-
target_compile_options(libomptarget-${target_name} PRIVATE "--target=${target_triple}" "-fuse-ld=lld" "-march=")
135+
target_compile_options(libomptarget-${target_name} PRIVATE
136+
"--target=${target_triple}" "-fuse-ld=lld" "-march=" "-mcpu="
137+
"-Wno-unused-command-line-argument")
136138
target_link_options(libomptarget-${target_name} PRIVATE "--target=${target_triple}"
137-
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm" "-fuse-ld=lld" "-march=")
139+
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm"
140+
"-fuse-ld=lld" "-march=" "-mcpu=")
138141
install(TARGETS libomptarget-${target_name}
139142
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ
140143
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${target_triple}")
@@ -153,7 +156,8 @@ function(compileDeviceRTLLibrary target_name target_triple)
153156
)
154157
target_link_libraries(omptarget.${target_name} PRIVATE omptarget.${target_name}.all_objs)
155158
target_link_options(omptarget.${target_name} PRIVATE "--target=${target_triple}"
156-
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm" "-fuse-ld=lld" "-march=")
159+
"-Wno-unused-command-line-argument""-r" "-nostdlib" "-flto"
160+
"-Wl,--lto-emit-llvm" "-fuse-ld=lld" "-march=" "-mcpu=")
157161

158162
install(TARGETS omptarget.${target_name}
159163
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${target_triple}")

0 commit comments

Comments
 (0)