diff --git a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake --- a/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTAIXUtils.cmake @@ -11,7 +11,7 @@ # > On AIX, runtime linking is no longer enabled by default. # See https://cmake.org/cmake/help/latest/release/3.16.html if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0") - set(linkopts -Wl,-G ${linkopts}) + list(PREPEND linkopts -Wl,-G) endif() set(${link_flags} ${linkopts} PARENT_SCOPE) endfunction() diff --git a/compiler-rt/lib/fuzzer/CMakeLists.txt b/compiler-rt/lib/fuzzer/CMakeLists.txt --- a/compiler-rt/lib/fuzzer/CMakeLists.txt +++ b/compiler-rt/lib/fuzzer/CMakeLists.txt @@ -141,7 +141,7 @@ get_target_flags_for_arch(${arch} target_cflags) if(CMAKE_CXX_COMPILER_ID MATCHES Clang) get_compiler_rt_target(${arch} target) - set(target_cflags "--target=${target} ${target_cflags}") + list(PREPEND target_cflags --target=${target}) endif() set(cxx_${arch}_merge_dir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${arch}_merge.dir") file(MAKE_DIRECTORY ${cxx_${arch}_merge_dir})