This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 6962aa8fb [thirdparty] fix building LLVM+IWYU on ARM
6962aa8fb is described below

commit 6962aa8fbcb8b7cdf11577f7ead3a6fcb42086a8
Author: Alexey Serbin <[email protected]>
AuthorDate: Mon Feb 24 13:31:50 2025 -0800

    [thirdparty] fix building LLVM+IWYU on ARM
    
    There had been an issue with building IWYU in-tree with LLVM for non-X86
    platforms that was addressed upstream by [1].  It's necessary to add
    that patch into Kudu's 3rd-party to fix building LLVM on ARM after [2].
    Without the extra patch for IWYU's top-level CMakeLists.txt, building
    Kudu's 3rd-party on ARM produces an error like below after [2]:
    
    The error looked like the following:
    
      -- IWYU: in-tree configuration
      -- IWYU: configuring for LLVM 11.0.0...
      CMake Error at cmake/modules/LLVM-Config.cmake:274 (message):
        Library 'X86AsmParser' is a direct reference to a target library for an
        omitted target.
      Call Stack (most recent call first):
        cmake/modules/LLVM-Config.cmake:100 (llvm_map_components_to_libnames)
        cmake/modules/LLVM-Config.cmake:93 (explicit_llvm_config)
        cmake/modules/AddLLVM.cmake:867 (llvm_config)
        tools/clang/tools/include-what-you-use/CMakeLists.txt:49 
(add_llvm_executable)
    
    This is a follow-up to [2].
    
    [1] 
https://github.com/include-what-you-use/include-what-you-use/commit/718e69875
    [2] https://github.com/apache/kudu/commit/de9a0370e
    
    Change-Id: If24fcf01079918d951278237241edb60610f5927
    Reviewed-on: http://gerrit.cloudera.org:8080/22534
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: Abhishek Chennaka <[email protected]>
---
 thirdparty/download-thirdparty.sh            |  3 ++-
 thirdparty/patches/llvm-iwyu-718e69875.patch | 34 ++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/thirdparty/download-thirdparty.sh 
b/thirdparty/download-thirdparty.sh
index 5031caafe..224ebd61b 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -332,12 +332,13 @@ fetch_and_patch \
  $PYTHON_SOURCE \
  $PYTHON_PATCHLEVEL
 
-LLVM_PATCHLEVEL=6
+LLVM_PATCHLEVEL=7
 fetch_and_patch \
  llvm-${LLVM_VERSION}-iwyu-${IWYU_VERSION}.src.tar.gz \
  $LLVM_SOURCE \
  $LLVM_PATCHLEVEL \
  "patch -p1 < $TP_DIR/patches/llvm-add-iwyu.patch" \
+ "patch -p1 < $TP_DIR/patches/llvm-iwyu-718e69875.patch" \
  "patch -d projects -p1 < 
$TP_DIR/patches/llvm-remove-cyclades-inclusion-in-sanitizer.patch" \
  "patch -p2 < $TP_DIR/patches/llvm-fix-missing-include.patch" \
  "patch -d projects -p1 < 
$TP_DIR/patches/llvm-Sanitizer-built-against-glibc-2_34-doesnt-work.patch" \
diff --git a/thirdparty/patches/llvm-iwyu-718e69875.patch 
b/thirdparty/patches/llvm-iwyu-718e69875.patch
new file mode 100644
index 000000000..61ae857cf
--- /dev/null
+++ b/thirdparty/patches/llvm-iwyu-718e69875.patch
@@ -0,0 +1,34 @@
+commit 718e6987556d765425df63cc114cbd3fb021c917
+Author: Kim Gräsman <[email protected]>
+Date:   Sat Jul 24 14:27:03 2021 +0200
+
+    Link with all target libraries
+    
+    In the parent commit, I forgot to update the build so that 
include-what-you-use
+    links with all targets, which led to link failures for builds against LLVM 
build
+    trees (as opposed to the Debian packages).
+    
+    While troubleshooting this, I found a patch by @Romain-Geissler-1A that I 
had
+    previously misunderstood/overlooked:
+    
https://github.com/include-what-you-use/include-what-you-use/pull/854#issuecomment-732487734
+    
+    Borrowing the link dependencies from that patch to complete my accidental
+    plagiarism fixes the build again.
+
+diff --git a/tools/clang/tools/include-what-you-use/CMakeLists.txt 
b/tools/clang/tools/include-what-you-use/CMakeLists.txt
+index e1b03f3..0a0d683 100644
+--- a/tools/clang/tools/include-what-you-use/CMakeLists.txt
++++ b/tools/clang/tools/include-what-you-use/CMakeLists.txt
+@@ -68,9 +68,9 @@ endif()
+ set(LLVM_LINK_COMPONENTS
+   Option
+   Support
+-  X86AsmParser
+-  X86Desc
+-  X86Info
++  AllTargetsAsmParsers
++  AllTargetsDescs
++  AllTargetsInfos
+   )
+ 
+ add_llvm_executable(include-what-you-use

Reply via email to