Hello community, here is the log from the commit of package llvm11 for openSUSE:Factory checked in at 2020-11-26 23:12:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/llvm11 (Old) and /work/SRC/openSUSE:Factory/.llvm11.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "llvm11" Thu Nov 26 23:12:26 2020 rev:2 rq:850277 version:11.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/llvm11/llvm11.changes 2020-11-02 09:41:19.177663252 +0100 +++ /work/SRC/openSUSE:Factory/.llvm11.new.5913/llvm11.changes 2020-11-26 23:13:17.692968910 +0100 @@ -1,0 +2,13 @@ +Mon Nov 23 17:29:28 UTC 2020 - Aaron Puchert <[email protected]> + +- Add compiler-rt-dont-compile-assembly-files-as-c.patch to fix + build failure with newer CMake versions. + +------------------------------------------------------------------- +Sat Nov 14 22:09:41 UTC 2020 - Aaron Puchert <[email protected]> + +- Let CMake files in {llvm,clang}X-devel refer to the versioned + binaries that come with the package instead of the symlink + managed by update-alternatives. (boo#1178513) + +------------------------------------------------------------------- New: ---- compiler-rt-dont-compile-assembly-files-as-c.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ llvm11.spec ++++++ --- /var/tmp/diff_new_pack.XUWk8j/_old 2020-11-26 23:13:18.628969204 +0100 +++ /var/tmp/diff_new_pack.XUWk8j/_new 2020-11-26 23:13:18.632969205 +0100 @@ -129,6 +129,8 @@ # PATCH-FIX-OPENSUSE llvm-exegesis-link-dylib.patch -- Don't waste space for llvm-exegesis. # It's crippled anyway because of missing deps and not relevant for users. Eventually we should drop it. Patch27: llvm-exegesis-link-dylib.patch +# PATCH-FIX-UPSTREAM compiler-rt-dont-compile-assembly-files-as-c.patch -- https://reviews.llvm.org/D86308 +Patch28: compiler-rt-dont-compile-assembly-files-as-c.patch BuildRequires: binutils-devel >= 2.21.90 BuildRequires: cmake BuildRequires: fdupes @@ -550,6 +552,7 @@ %patch22 -p1 %patch24 -p1 %patch27 -p2 +%patch28 -p1 pushd clang-%{_version}.src %patch2 -p1 @@ -992,6 +995,13 @@ ln -s -f %{_sysconfdir}/alternatives/$p.1%{ext_man} %{buildroot}%{_mandir}/man1/$p.1%{ext_man} done +# Also rewrite the CMake files referring to the binaries. +sed -i "$( + for p in "${binfiles[@]}"; do + echo "s|\"\${_IMPORT_PREFIX}/bin/$p\"|\"\${_IMPORT_PREFIX}/bin/$p-%{_relver}\"|g" + done +)" %{buildroot}%{_libdir}/cmake/{llvm/LLVMExports,clang/ClangTargets}-relwithdebinfo.cmake + # rpm macro for version checking mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.llvm <<EOF ++++++ compiler-rt-dont-compile-assembly-files-as-c.patch ++++++ From 45344cf7ac5b848f77825ffa37b0cb3b69b9b07b Mon Sep 17 00:00:00 2001 From: Raul Tambre <[email protected]> Date: Thu, 20 Aug 2020 20:17:47 +0300 Subject: [PATCH] [CMake][compiler-rt][libunwind] Compile assembly files as ASM not C, unify workarounds It isn't very wise to pass an assembly file to the compiler and tell it to compile as a C file and hope that the compiler recognizes it as assembly instead. Simply don't mark the file as C and CMake will recognize the rest. This was attempted earlier in https://reviews.llvm.org/D85706, but reverted due to architecture issues on Apple. Subsequent digging revealed a similar change was done earlier for libunwind in https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09. Afterwards workarounds were added for MinGW and Apple: * https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09 * https://reviews.llvm.org/rGd4ded05ba851304b26a437896bc3962ef56f62cb The workarounds in libunwind and compiler-rt are unified and comments added pointing to each other. The workaround is updated to only be used for MinGW for CMake versions before 3.17, which fixed the issue (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287). Additionally fixed Clang not being passed as the assembly compiler for compiler-rt runtime build. Example error: [525/634] Building C object lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o FAILED: lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o /opt/tooling/drive/host/bin/clang --target=aarch64-linux-gnu -I/opt/tooling/drive/llvm/compiler-rt/lib/tsan/.. -isystem /opt/tooling/drive/toolchain/opt/drive/toolchain/include -x c -Wall -Wno-unused-parameter -fno-lto -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fPIE -fno-rtti -Wframe-larger-than=530 -Wglobal-constructors --sysroot=. -MD -MT lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -MF lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o.d -o lib/tsan/CMakeFiles/clang_rt.tsan-aarch64.dir/rtl/tsan_rtl_aarch64.S.o -c /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S /opt/tooling/drive/llvm/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S:29:1: error: expected identifier or '(' .section .text ^ 1 error generated. Differential Revision: https://reviews.llvm.org/D86308 --- clang/runtime/CMakeLists.txt | 1 + compiler-rt/cmake/Modules/AddCompilerRT.cmake | 10 +++++----- libunwind/src/CMakeLists.txt | 12 ++++-------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt index e20cc26f60af..61bbbf8faedd 100644 --- a/clang-11.0.0.src/runtime/CMakeLists.txt +++ b/clang-11.0.0.src/runtime/CMakeLists.txt @@ -75,6 +75,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/) CMAKE_ARGS ${CLANG_COMPILER_RT_CMAKE_ARGS} -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang -DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++ + -DCMAKE_ASM_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} -DLLVM_CONFIG_PATH=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-config diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index efb660818270..f2f0b5ecde59 100644 --- a/compiler-rt-11.0.0.src/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt-11.0.0.src/cmake/Modules/AddCompilerRT.cmake @@ -109,11 +109,11 @@ endfunction() function(add_asm_sources output) set(${output} ${ARGN} PARENT_SCOPE) - # Xcode will try to compile asm files as C ('clang -x c'), and that will fail. - if (${CMAKE_GENERATOR} STREQUAL "Xcode") - enable_language(ASM) - else() - # Pass ASM file directly to the C++ compiler. + # CMake doesn't pass the correct architecture for Apple prior to CMake 3.19. https://gitlab.kitware.com/cmake/cmake/-/issues/20771 + # MinGW didn't work correctly with assembly prior to CMake 3.17. https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4287 and https://reviews.llvm.org/rGb780df052dd2b246a760d00e00f7de9ebdab9d09 + # Workaround these two issues by compiling as C. + # Same workaround used in libunwind. Also update there if changed here. + if((APPLE AND CMAKE_VERSION VERSION_LESS 3.19) OR (MINGW AND CMAKE_VERSION VERSION_LESS 3.17)) set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C) endif() endfunction() -- 2.29.2 _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
