From 530ee77849b1c3dfad13f38fc768f05ceef1b3b0 Mon Sep 17 00:00:00 2001 From: lzq11122 Date: Sun, 7 Dec 2025 21:47:09 -0500 Subject: [PATCH] fix some failed test case in check --- ...-19-Always-build-shared-libs-for-LLD.patch | 29 +++++++++++++++++++ lld.spec | 17 ++++++++--- 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 0003-19-Always-build-shared-libs-for-LLD.patch diff --git a/0003-19-Always-build-shared-libs-for-LLD.patch b/0003-19-Always-build-shared-libs-for-LLD.patch new file mode 100644 index 0000000..3d975a9 --- /dev/null +++ b/0003-19-Always-build-shared-libs-for-LLD.patch @@ -0,0 +1,29 @@ +From 69faadbc396000bfa60c722f6fb9c0fc3fb2daf0 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 8 May 2024 12:30:36 +0900 +Subject: [PATCH] Always build shared libs for LLD + +We don't want to enable BUILD_SHARED_LIBS for the whole build, +but we do want to build lld libraries. +--- + lld/cmake/modules/AddLLD.cmake | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake +index 9f2684b6f933..743ec87814a2 100644 +--- a/lld/cmake/modules/AddLLD.cmake ++++ b/lld/cmake/modules/AddLLD.cmake +@@ -7,9 +7,8 @@ macro(add_lld_library name) + "" + "" + ${ARGN}) +- if(ARG_SHARED) +- set(ARG_ENABLE_SHARED SHARED) +- endif() ++ # Always build shared libs for LLD. ++ set(ARG_ENABLE_SHARED SHARED) + llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS}) + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) +-- +2.45.1 diff --git a/lld.spec b/lld.spec index 5fb307d..823da67 100644 --- a/lld.spec +++ b/lld.spec @@ -1,9 +1,10 @@ -%define anolis_release 1 +%define anolis_release 2 %global toolchain clang %undefine _include_frame_pointers %bcond_without check +%bcond_without compat_build %global lld_srcdir lld-%{maj_ver}.%{min_ver}.%{patch_ver}.src %global cmake_srcdir cmake-%{maj_ver}.%{min_ver}.%{patch_ver}.src @@ -22,6 +23,7 @@ Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ve Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz Patch02: 0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch +Patch03: 0003-19-Always-build-shared-libs-for-LLD.patch BuildRequires: clang BuildRequires: cmake @@ -66,10 +68,12 @@ mv %{cmake_srcdir} cmake %autosetup -n %{lld_srcdir} -p2 %build + %cmake \ -GNinja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DCMAKE_INSTALL_RPATH=%{_libdir} \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DLLVM_DYLIB_COMPONENTS="all" \ -DCMAKE_SKIP_RPATH:BOOL=ON \ @@ -84,13 +88,15 @@ mv %{cmake_srcdir} cmake %cmake_build %install - -# Install libraries and binaries %cmake_install # This is generated by Patch1 during build and (probably) must be removed afterward rm %{buildroot}%{_includedir}/mach-o/compact_unwind_encoding.h +%if %{without compat_build} +install -D -m 644 -t %{buildroot}%{install_mandir}/man1/ lld/docs/ld.lld.1 +%endif + # Required when using update-alternatives touch %{buildroot}%{_bindir}/ld @@ -103,8 +109,8 @@ if [ $1 -eq 0 ] ; then fi %check - %if %{with check} +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH %cmake_build --target check-lld %endif @@ -125,6 +131,9 @@ fi %{_libdir}/liblld*.so.* %changelog +* Mon Dec 08 2025 lzq11122 - 20.1.0-2 +- fix some failed test case in check + * Wed Nov 26 2025 lzq11122 - 20.1.0-1 - Update to 20.1.0 to support rva23 -- Gitee