init for Multi-Version LLVM-18.1.8

Signed-off-by: liyunfei <liyunfei33@huawei.com>
This commit is contained in:
liyunfei 2024-12-09 11:07:52 +08:00
parent f278552b4c
commit 36376140e1
4 changed files with 125 additions and 47 deletions

View File

@ -1,8 +1,24 @@
# lldb # lldb-latest
#### Description #### Description
The LLDB project builds on libraries provided by LLVM and Clang to provide a great native debugger. It uses the Clang ASTs and expression parser, LLVM JIT, LLVM disassembler, etc so that it provides an experience that "just works". It is also blazing fast and much more memory efficient than GDB at loading symbols. Next generation high-performance debugger
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository 1. Fork the repository
2. Create Feat_xxx branch 2. Create Feat_xxx branch

View File

@ -1,7 +1,23 @@
# lldb # lldb-latest
#### 介绍 #### 介绍
The LLDB project builds on libraries provided by LLVM and Clang to provide a great native debugger. It uses the Clang ASTs and expression parser, LLVM JIT, LLVM disassembler, etc so that it provides an experience that "just works". It is also blazing fast and much more memory efficient than GDB at loading symbols. Next generation high-performance debugger
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献 #### 参与贡献
@ -11,11 +27,11 @@ The LLDB project builds on libraries provided by LLVM and Clang to provide a gre
4. 新建 Pull Request 4. 新建 Pull Request
#### 码云特技 #### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

120
lldb.spec
View File

@ -1,34 +1,64 @@
%undefine __cmake_in_source_build %bcond_without toolchain_clang
%bcond_without bisheng_autotuner
Name: lldb %if %{with toolchain_clang}
Version: 17.0.6 %global toolchain clang
Release: 3 %endif
%global maj_ver 18
%global min_ver 1
%global patch_ver 8
%global lldb_version %{maj_ver}.%{min_ver}.%{patch_ver}
%global _scl_prefix /opt/openEuler
%{?scl:%scl_package %scl}
%{!?scl:%global scl_prefix llvm-toolset-%{maj_ver}-}
%{!?scl:%global pkg_name %{name}}
%global install_prefix %{!?scl:%{_scl_prefix}/llvm-toolset-%{maj_ver}/root}%{_prefix}
%global install_datadir %{!?scl:%{_scl_prefix}/llvm-toolset-%{maj_ver}/root}%{_datadir}
%global install_bindir %{install_prefix}/bin
%global install_includedir %{install_prefix}/include
%if 0%{?__isa_bits} == 64
%global install_libdir %{install_prefix}/lib64
%else
%global install_libdir %{install_prefix}/lib
%endif
%global install_libexecdir %{install_prefix}/libexec
%global install_sharedir %{install_prefix}/share
%global install_docdir %{install_sharedir}/doc
Name: %{?scl_prefix}lldb
Version: %{lldb_version}
Release: 1
Summary: Next generation high-performance debugger Summary: Next generation high-performance debugger
License: NCSA License: NCSA
URL: http://lldb.llvm.org/ URL: http://lldb.llvm.org/
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lldb-%{version}.src.tar.xz
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: cmake BuildRequires: cmake
BuildRequires: clang BuildRequires: ninja-build
BuildRequires: llvm-devel = %{version} BuildRequires: %{?scl_prefix}clang
BuildRequires: llvm-test = %{version} BuildRequires: %{?scl_prefix}llvm-devel = %{version}
BuildRequires: clang-devel = %{version} BuildRequires: %{?scl_prefix}llvm-test = %{version}
BuildRequires: clang-tools-extra = %{version} BuildRequires: %{?scl_prefix}clang-devel = %{version}
BuildRequires: %{?scl_prefix}clang-tools-extra = %{version}
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: swig BuildRequires: swig
BuildRequires: llvm-static = %{version} BuildRequires: %{?scl_prefix}llvm-static = %{version}
BuildRequires: libffi-devel BuildRequires: libffi-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: libedit-devel BuildRequires: libedit-devel
BuildRequires: python3-lit BuildRequires: python3-lit
BuildRequires: multilib-rpm-config BuildRequires: multilib-rpm-config
%if %{with toolchain_clang}
BuildRequires: clang
%endif
Requires: python3-lldb Requires: %{?scl_prefix}python3-lldb
%description %description
LLDB is a next generation, high-performance debugger. It is built as a set LLDB is a next generation, high-performance debugger. It is built as a set
@ -38,35 +68,40 @@ disassembler.
%package devel %package devel
Summary: Development header files for LLDB Summary: Development header files for LLDB
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{pkg_name}%{?_isa} = %{version}-%{release}
%description devel %description devel
The package contains header files for the LLDB debugger. The package contains header files for the LLDB debugger.
%package -n python3-lldb %package -n %{?scl_prefix}python3-lldb
%{?python_provide:%python_provide python3-lldb} %{?python_provide:%python_provide python3-lldb}
Summary: Python module for LLDB Summary: Python module for LLDB
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
Requires: python3-six Requires: python3-six
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{pkg_name}%{?_isa} = %{version}-%{release}
BuildRequires: llvm-cmake-utils = %{version} BuildRequires: %{?scl_prefix}llvm-cmake-utils = %{version}
%description -n python3-lldb %description -n %{?scl_prefix}python3-lldb
The package contains the LLDB Python module. The package contains the LLDB Python module.
%prep %prep
%autosetup -n %{name}-%{version}.src -p2 %autosetup -n lldb-%{version}.src -p2
%build %build
# Python version detection is broken # Python version detection is broken
LDFLAGS="%{build_ldflags} -lpthread -ldl" LDFLAGS="%{__global_ldflags} -lpthread -ldl"
CFLAGS="%{optflags} -Wno-error=format-security" CFLAGS="%{optflags} -Wno-error=format-security"
CXXFLAGS="%{optflags} -Wno-error=format-security" CXXFLAGS="%{optflags} -Wno-error=format-security"
%cmake \ mkdir -p _build
cd _build
%cmake .. \
-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
-DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \
-DLLVM_MAIN_SRC_DIR=%{install_prefix}/src \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_SKIP_RPATH:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
@ -75,13 +110,14 @@ CXXFLAGS="%{optflags} -Wno-error=format-security"
-DLLDB_DISABLE_CURSES:BOOL=OFF \ -DLLDB_DISABLE_CURSES:BOOL=OFF \
-DLLDB_DISABLE_LIBEDIT:BOOL=OFF \ -DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
-DLLDB_DISABLE_PYTHON:BOOL=OFF \ -DLLDB_DISABLE_PYTHON:BOOL=OFF \
%if "%toolchain" == "clang"
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
%endif
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \ -DLLVM_LIBDIR_SUFFIX=64 \
%else %else
-DLLVM_LIBDIR_SUFFIX= \ -DLLVM_LIBDIR_SUFFIX= \
%endif
%if %{with bisheng_autotuner}
-DLLVM_ENABLE_AUTOTUNER=ON \
%endif %endif
\ \
-DPYTHON_EXECUTABLE:STRING=%{__python3} \ -DPYTHON_EXECUTABLE:STRING=%{__python3} \
@ -89,40 +125,50 @@ CXXFLAGS="%{optflags} -Wno-error=format-security"
-DPYTHON_VERSION_MINOR:STRING=$(%{__python3} -c "import sys; print(sys.version_info.minor)") \ -DPYTHON_VERSION_MINOR:STRING=$(%{__python3} -c "import sys; print(sys.version_info.minor)") \
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
-DCLANG_LINK_CLANG_DYLIB=ON \ -DCLANG_LINK_CLANG_DYLIB=ON \
-DLLVM_COMMON_CMAKE_UTILS=%{_datadir}/llvm/cmake \
-DLLVM_LIT_ARGS="-sv \ -DLLVM_LIT_ARGS="-sv \
--path %{_libdir}/llvm" \ --path %{install_libdir}/llvm" \
%cmake_build %make_build
%install %install
%cmake_install cd _build
%make_install
# remove static libraries # remove static libraries
rm -fv %{buildroot}%{_libdir}/*.a rm -fv %{buildroot}%{install_libdir}/*.a
# python: fix binary libraries location # python: fix binary libraries location
liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so)) liblldb=$(basename $(readlink -e %{buildroot}%{install_libdir}/liblldb.so))
mkdir -p %{buildroot}%{python3_sitearch}
mv %{buildroot}%{install_prefix}/..%{python3_sitearch}/lldb %{buildroot}%{python3_sitearch}/lldb
ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so
%py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb %py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb
# remove bundled six.py # remove bundled six.py
rm -f %{buildroot}%{python3_sitearch}/six.* rm -f %{buildroot}%{install_prefix}%{python3_sitearch}/six.*
%ldconfig_scriptlets
%check
%files %files
%license LICENSE.TXT %license LICENSE.TXT
%{_bindir}/lldb* %{install_bindir}/lldb*
%{_libdir}/liblldb.so.* %{install_libdir}/liblldb.so.*
%{_libdir}/liblldbIntelFeatures.so.* %{install_libdir}/liblldbIntelFeatures.so.*
%files devel %files devel
%{_includedir}/lldb %{install_includedir}/lldb
%{_libdir}/*.so %{install_libdir}/*.so
%files -n python3-lldb %files -n %{?scl_prefix}python3-lldb
%{python3_sitearch}/lldb %{python3_sitearch}/lldb
%changelog %changelog
* Fri Dec 6 2024 liyunfei <liyunfei33@huawei.com> - 18.1.8-1
- init for Multi-Version LLVM-18.1.8
* Wed Nov 13 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-3 * Wed Nov 13 2024 Funda Wang <fundawang@yeah.net> - 17.0.6-3
- adopt to new cmake macro - adopt to new cmake macro