diff --git a/README.md b/README.md index 4271afabf93a8b5b20b975ea6649d69f82d41a57..fbac4199eb206c86ab2a2a24c6ff0520cceefd4e 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,12 @@ -# llvm-libunwind-15 +# llvm-libunwind #### 介绍 -libunwind of llvm 15 for openEuler +LLVM libunwind is an implementation of the interface defined by the HP libunwind +project. It was contributed Apple as a way to enable clang++ to port to +platforms that do not have a system unwinder. It is intended to be a small and +fast implementation of the ABI, leaving off some features of HP's libunwind +that never materialized (e.g. remote unwinding). -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx #### 参与贡献 diff --git a/libunwind-15.0.7.src.tar.xz b/libunwind-15.0.7.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..991ff004b5397ac403274e1d44d32792a4157a80 Binary files /dev/null and b/libunwind-15.0.7.src.tar.xz differ diff --git a/libunwind-15.0.7.src.tar.xz.sig b/libunwind-15.0.7.src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000..3dd32d77b522e8b7b32940910bb1c0184528820c Binary files /dev/null and b/libunwind-15.0.7.src.tar.xz.sig differ diff --git a/llvm-libunwind.spec b/llvm-libunwind.spec new file mode 100644 index 0000000000000000000000000000000000000000..ba25f2d35903c7775243d1de5a8f94220a555184 --- /dev/null +++ b/llvm-libunwind.spec @@ -0,0 +1,124 @@ +%bcond_without sys_llvm +%bcond_without check + +%global maj_ver 15 +%global min_ver 0 +%global patch_ver 7 +%global libunwind_version %{maj_ver}.%{min_ver}.%{patch_ver} +%global libunwind_srcdir libunwind-%{libunwind_version}.src + +%if %{with sys_llvm} +%global pkg_name llvm-libunwind +%global install_prefix %{_prefix} +%else +%global pkg_name llvm-libunwind%{maj_ver} +%global bin_suffix -%{maj_ver} +%global install_prefix %{_libdir}/%{name} +%endif + +%if 0%{?__isa_bits} == 64 +%global install_libdir %{install_prefix}/lib64 +%else +%global install_libdir %{install_prefix}/lib +%endif + +Name: %{pkg_name} +Version: %{libunwind_version} +Release: 1 +Summary: LLVM libunwind + + +License: Apache License 2.0 +URL: http://llvm.org +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libunwind_version}/%{libunwind_srcdir}.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{libunwind_version}/%{libunwind_srcdir}.tar.xz.sig + +BuildRequires: clang +BuildRequires: cmake +BuildRequires: ninja-build +BuildRequires: llvm-devel + +%description + +LLVM libunwind is an implementation of the interface defined by the HP libunwind +project. It was contributed Apple as a way to enable clang++ to port to +platforms that do not have a system unwinder. It is intended to be a small and +fast implementation of the ABI, leaving off some features of HP's libunwind +that never materialized (e.g. remote unwinding). + +%package devel +Summary: LLVM libunwind development files +Provides: libunwind(major) = %{maj_ver} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Unversioned shared library for LLVM libunwind + +%package static +Summary: Static library for LLVM libunwind + +%description static +Static library for LLVM libunwind + +%prep +%autosetup -n %{libunwind_srcdir} -p2 + +%build +# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. +export ASMFLAGS=$CFLAGS + +%cmake -GNinja \ + -DCMAKE_MODULE_PATH=%{install_libdir}/cmake/llvm \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ +%if 0%{?__isa_bits} == 64 + -DLIBUNWIND_LIBDIR_SUFFIX=64 +%else + -DLIBUNWIND_LIBDIR_SUFFIX= +%endif + + +%ninja_build + +%install + +%ninja_install + + +# We can't install the unversionned path on default location because that would conflict with +# https://src.fedoraproject.org/rpms/libunwind +# +# The versionned path has a different soname (libunwind.so.1 compared to +# libunwind.so.8) so they can live together in %{_libdir} +# +# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't +# have the exact same ABI has gcc's libunwind (it actually provides a subset). +rm %{buildroot}%{install_libdir}/libunwind.so +mkdir -p %{buildroot}/%{install_libdir}/llvm-unwind/ + +pushd %{buildroot}/%{install_libdir}/llvm-unwind +ln -s ../libunwind.so.1.0 libunwind.so +popd + + +%check + +# upstream has a hard dependency on libcxx source code for test to be configured +# properly. We can't model that, so rely on gating instead. +#cmake_build --target check-unwind + +%files +%license LICENSE.TXT +%{install_libdir}/libunwind.so.1 +%{install_libdir}/libunwind.so.1.0 + +%files devel +%dir %{install_libdir}/llvm-unwind +%{install_libdir}/llvm-unwind/libunwind.so + +%files static +%{install_libdir}/libunwind.a + +%changelog +* Tue Jul 04 2023 cf-zhao - 15.0.7-1 +- Initial release