Skip to content

Commit

Permalink
clang: scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do
Browse files Browse the repository at this point in the history
* other libraries are installed in 'lib64' or 'lib32' based on
  LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always
  installed in 'lib'

* fixes:
  ERROR: QA Issue: lib32-clang: Files/directories were installed but not shipped in any package:
    /usr/lib/libscanbuild
    /usr/lib/libscanbuild/intercept.py
    /usr/lib/libscanbuild/analyze.py
    /usr/lib/libscanbuild/clang.py
    /usr/lib/libscanbuild/report.py
    /usr/lib/libscanbuild/arguments.py
    /usr/lib/libscanbuild/shell.py
    /usr/lib/libscanbuild/compilation.py
    /usr/lib/libscanbuild/__init__.py
    /usr/lib/libscanbuild/resources
    /usr/lib/libscanbuild/resources/sorttable.js
    /usr/lib/libscanbuild/resources/selectable.js
    /usr/lib/libscanbuild/resources/scanview.css
  Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
  lib32-clang: 13 installed and not shipped files. [installed-vs-shipped]

  e.g. in multilib build where libdir is set to /usr/lib32 or /usr/lib64.

Signed-off-by: Martin Jansa <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
shr-project authored and kraj committed Sep 18, 2024
1 parent 5820cb9 commit 185e954
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
From cb6f0fa134a9bb1dcf2b7f5f2f683410853b5cde Mon Sep 17 00:00:00 2001
From: Martin Jansa <[email protected]>
Date: Fri, 13 Sep 2024 13:38:08 +0200
Subject: [PATCH] scan-build-py: respect LLVM_LIBDIR_SUFFIX like other tools do

* other libraries are installed in 'lib64' or 'lib32' based on
LLVM_LIBDIR_SUFFIX value, but libscanbuild files were always
installed in 'lib'

Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/108549]

Signed-off-by: Martin Jansa <[email protected]>
---
clang/tools/scan-build-py/CMakeLists.txt | 38 ++++++++++++------------
1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt
index 9273eb5ed977..9033786d2da5 100644
--- a/clang/tools/scan-build-py/CMakeLists.txt
+++ b/clang/tools/scan-build-py/CMakeLists.txt
@@ -77,52 +77,52 @@ foreach(lib ${LibExecs})
endforeach()

foreach(lib ${LibScanbuild})
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib}
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib}
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib/libscanbuild
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib}
- ${CMAKE_BINARY_DIR}/lib/libscanbuild/
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/${lib})
- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/${lib})
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/${lib})
install(FILES lib/libscanbuild/${lib}
- DESTINATION lib/libscanbuild
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild
COMPONENT scan-build-py)
endforeach()

foreach(resource ${LibScanbuildResources})
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource}
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource}
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib/libscanbuild
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource}
- ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libscanbuild/resources/${resource})
- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libscanbuild/resources/${resource})
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources/${resource})
install(FILES lib/libscanbuild/resources/${resource}
- DESTINATION lib/libscanbuild/resources
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libscanbuild/resources
COMPONENT scan-build-py)
endforeach()

foreach(lib ${LibEar})
- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/libear/${lib}
+ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib}
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/lib/libear
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib}
- ${CMAKE_BINARY_DIR}/lib/libear/
+ ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/lib/libear/${lib})
- list(APPEND Depends ${CMAKE_BINARY_DIR}/lib/libear/${lib})
+ list(APPEND Depends ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/libear/${lib})
install(FILES lib/libear/${lib}
- DESTINATION lib/libear
+ DESTINATION lib${LLVM_LIBDIR_SUFFIX}/libear
COMPONENT scan-build-py)
endforeach()

1 change: 1 addition & 0 deletions recipes-devtools/clang/common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ SRC_URI = "\
file://0032-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \
file://0033-clang-llvm-Add-OE-specific-ABI-triple-for-N32-ABI.patch \
file://0034-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \
file://0035-scan-build-py-respect-LLVM_LIBDIR_SUFFIX-like-other-.patch \
"
# Fallback to no-PIE if not set
GCCPIE ??= ""
Expand Down

0 comments on commit 185e954

Please sign in to comment.