lld/lld.spec

121 lines
2.6 KiB
RPMSpec
Raw Normal View History

2022-11-02 22:40:30 +03:00
%global optflags %(echo %{optflags} | sed -e 's/-ffat-lto-objects//g' -e 's/-fvar-tracking-assignments//g' -e 's/-Wa,--compress-debug-sections//g' -e 's/\-nostdinc++//g' )
2020-10-15 07:19:00 +00:00
%define major %(echo %version |cut -d. -f1)
2018-04-03 22:27:35 +03:00
%define libname %mklibname %{name} %{major}
%define devname %mklibname %{name} -d
2022-11-02 22:40:30 +03:00
#if %{mdvver} <= 201610
#bcond_without clang
#else
#bcond_with clang
#endif
2020-08-14 14:04:33 +03:00
2022-11-02 22:40:30 +03:00
#if %{with clang}
#define debug_package %{nil}
#endif
2020-08-14 14:04:33 +03:00
2020-02-14 01:55:43 +03:00
%bcond_without git
2019-09-23 03:21:17 +03:00
2018-04-03 22:27:35 +03:00
Summary: The LLVM Linker
Name: lld
2021-07-14 00:03:14 +03:00
Version: 12.0.1
2022-11-05 11:57:37 +03:00
Release: 2
2018-04-03 22:27:35 +03:00
Group: Development/Other
License: NCSA
2022-11-02 22:40:30 +03:00
URL: http://llvm.org
2019-09-23 03:21:17 +03:00
%if %{with git}
2019-08-12 17:37:47 +03:00
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz
2019-09-23 03:21:17 +03:00
%else
Source0: http://releases.llvm.org/%{version}/%{name}-%{version}.src.tar.xz
%endif
Source1: https://raw.githubusercontent.com/llvm/llvm-project/llvmorg-%{version}/libunwind/include/mach-o/compact_unwind_encoding.h
2018-04-03 22:27:35 +03:00
BuildRequires: cmake
2022-11-05 22:03:26 +03:00
BuildRequires: gcc
2022-11-02 22:40:30 +03:00
#if %{with clang}
2020-08-14 14:04:33 +03:00
BuildRequires: clang
BuildRequires: libcxx-devel
2022-11-02 22:40:30 +03:00
#endif
2018-04-03 22:27:35 +03:00
BuildRequires: llvm-devel = %{version}
BuildRequires: ncurses-devel
BuildRequires: zlib-devel
2018-04-23 19:35:39 +03:00
Requires: clang
2018-04-23 19:12:08 +03:00
Requires: llvm
2018-04-23 18:58:44 +03:00
Requires: llvm-plugins
%description
The LLVM project linker.
2018-04-03 22:27:35 +03:00
%files
%doc LICENSE.TXT
%{_bindir}/ld64.lld
%{_bindir}/ld64.lld.darwinnew
%{_bindir}/ld.lld
%{_bindir}/lld
%{_bindir}/lld-link
2018-04-03 22:27:35 +03:00
%{_bindir}/wasm-ld
2018-04-03 22:27:35 +03:00
#-------------------------------------------------------------------------
2018-04-03 22:27:35 +03:00
%package -n %{libname}
Summary: LLD shared libraries
2018-04-03 22:27:35 +03:00
Group: System/Libraries
2018-04-03 22:27:35 +03:00
%description -n %{libname}
Shared libraries for LLD.
2018-04-03 22:27:35 +03:00
%files -n %{libname}
%doc LICENSE.TXT
%{_libdir}/lib%{name}*.so.%{major}*
2019-09-23 03:21:17 +03:00
2018-04-03 22:27:35 +03:00
#-------------------------------------------------------------------------
2018-04-03 22:27:35 +03:00
%package -n %{devname}
Summary: Libraries and header files for LLD
Group: Development/Other
Requires: %{libname} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
2018-04-03 22:27:35 +03:00
%description -n %{devname}
This package contains library and header files needed to develop new native
programs that use the LLD infrastructure.
2018-04-03 22:27:35 +03:00
%files -n %{devname}
%doc LICENSE.TXT
%{_includedir}/lld
%{_libdir}/liblld*.so
2020-10-15 07:22:35 +00:00
%{_libdir}/cmake/%{name}/
2019-09-23 03:21:17 +03:00
2018-04-03 22:27:35 +03:00
#-------------------------------------------------------------------------
%prep
%setup -qn %{name}-%{version}.src
mkdir include/mach-o
cp %{S:1} include/mach-o
2018-04-03 22:27:35 +03:00
%build
2022-11-02 22:40:30 +03:00
#if %{with clang}
2020-08-14 14:04:33 +03:00
%clang_gcc_wrapper
2022-11-02 22:40:30 +03:00
#export CC=clang
#export CXX=clang++
#endif
2018-04-03 22:27:35 +03:00
%cmake \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_DYLIB_COMPONENTS="all" \
2018-04-03 22:27:35 +03:00
%ifarch x86_64
-DLLVM_LIBDIR_SUFFIX=64
%else
-DLLVM_LIBDIR_SUFFIX=
%endif
2020-01-13 15:58:05 +03:00
%make -s
%install
2020-01-13 15:58:05 +03:00
%makeinstall_std -C build
# we do not need
rm -fr %{buildroot}%{_includedir}/mach-o/compact_unwind_encoding.h