!2 upgrade lldb to 10.0.1

From: @wangxiao65
Reviewed-by: @si-gui,@small_leek
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2020-10-12 11:04:43 +08:00 committed by Gitee
commit ef06699448
4 changed files with 79 additions and 45 deletions

BIN
lldb-10.0.1.src.tar.xz Normal file

Binary file not shown.

Binary file not shown.

120
lldb.spec
View File

@ -1,79 +1,109 @@
Name: lldb Name: lldb
Version: 7.0.0 Version: 10.0.1
Release: 2 Release: 1
Summary: Next-generation high-performance debugger Summary: Next generation high-performance debugger
License: NCSA
URL: http://lldb.llvm.org/ License: NCSA
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz URL: http://lldb.llvm.org/
BuildRequires: cmake llvm-devel = %{version} clang-devel = %{version} ncurses-devel swig Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz
BuildRequires: llvm-static = %{version} libffi-devel zlib-devel libxml2-devel libedit-devel
Requires: python2-lldb BuildRequires: cmake llvm-devel = %{version} llvm-test = %{version} clang-devel = %{version}
BuildRequires: ncurses-devel swig llvm-static = %{version} libffi-devel zlib-devel
BuildRequires: libxml2-devel libedit-devel python3-lit
Requires: python3-lldb
%description %description
The LLDB Debugger (LLDB) is the debugger component of the LLVM project. It LLDB is a next generation, high-performance debugger. It is built as a set
is built as a set of reusable components which extensively use existing of reusable components which highly leverage existing libraries in the
libraries from LLVM, such as the Clang expression parser and LLVM disassembler. larger LLVM Project, such as the Clang expression parser and LLVM
LLDB is free and open-source software under the University of Illinois/NCSA disassembler.
Open Source License,[2] a BSD-style permissive software license.
%package devel %package devel
Summary: Development header files for LLDB Summary: Development header files for LLDB
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{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 python2-lldb %package -n python3-lldb
%{?python_provide:%python_provide python2-lldb} %{?python_provide:%python_provide python3-lldb}
Summary: Python module for LLDB Summary: Python module for LLDB
BuildRequires: python2-devel BuildRequires: python3-devel
Requires: python2-six Requires: python3-six
%description -n python2-lldb %description -n python3-lldb
The package contains the LLDB Python module. The package contains the LLDB Python module.
%prep %prep
%autosetup -n %{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1 %autosetup -n %{name}-%{version}.src -p2
sed -i -e "s~import sys~import sys\nsys.path.insert\(1, '%{python2_sitearch}/lldb'\)~g" source/Interpreter/embedded_interpreter.py
%build %build
mkdir -p _build;cd _build
mkdir -p _build
cd _build
# Python version detection is broken
LDFLAGS="%{__global_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 .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_LINK_LLVM_DYLIB:BOOL=ON -DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
-DLLDB_PATH_TO_LLVM_BUILD=%{_prefix} -DLLDB_PATH_TO_CLANG_BUILD=%{_prefix} -DLLDB_DISABLE_CURSES:BOOL=OFF \ %cmake .. \
-DLLDB_DISABLE_LIBEDIT:BOOL=OFF -DLLDB_DISABLE_PYTHON:BOOL=OFF -DLLVM_LIBDIR_SUFFIX=64 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DPYTHON_EXECUTABLE:STRING=%{__python2} -DPYTHON_VERSION_MAJOR:STRING=$(%{__python2} -c "import sys; print sys.version_info.major") \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DPYTHON_VERSION_MINOR:STRING=$(%{__python2} -c "import sys; print sys.version_info.minor") -DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \
%make_build \
-DLLDB_DISABLE_CURSES:BOOL=OFF \
-DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
-DLLDB_DISABLE_PYTHON:BOOL=OFF \
%if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \
%else
-DLLVM_LIBDIR_SUFFIX= \
%endif
\
-DPYTHON_EXECUTABLE:STRING=%{__python3} \
-DPYTHON_VERSION_MAJOR:STRING=$(%{__python3} -c "import sys; print(sys.version_info.major)") \
-DPYTHON_VERSION_MINOR:STRING=$(%{__python3} -c "import sys; print(sys.version_info.minor)") \
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
-DCLANG_LINK_CLANG_DYLIB=ON \
-DLLVM_LIT_ARGS="-sv \
--path %{_libdir}/llvm" \
make %{?_smp_mflags}
%install %install
cd _build cd _build
%make_install make install DESTDIR=%{buildroot}
# remove static libraries
rm -fv %{buildroot}%{_libdir}/*.a
# python: fix binary libraries location
liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so)) liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so))
ln -vsf "../../../${liblldb}" %{buildroot}%{python2_sitearch}/lldb/_lldb.so ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so
mv -v %{buildroot}%{python2_sitearch}/readline.so %{buildroot}%{python2_sitearch}/lldb/readline.so %py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb
%post # remove bundled six.py
/sbin/ldconfig rm -f %{buildroot}%{python3_sitearch}/six.*
%postun %ldconfig_scriptlets
/sbin/ldconfig
%files %files
%{_bindir}/lldb* %{_bindir}/lldb*
%{_libdir}/liblldb*.so.* %{_libdir}/liblldb.so.*
%{_libdir}/liblldbIntelFeatures.so.*
%files devel %files devel
%{_includedir}/lldb %{_includedir}/lldb
%{_libdir}/*.so %{_libdir}/*.so
%exclude %{_libdir}/*.a
%exclude %{python2_sitearch}/six.*
%files -n python2-lldb %files -n python3-lldb
%{python2_sitearch}/lldb %{python3_sitearch}/lldb
%changelog %changelog
* Mon Dec 2 2019 likexin <likexin4@huawei.com> 7.0.0-2 * Mon Oct 12 2020 wangxiao <wangxiao65@huawei.com> - 10.0.1-1
- upgrade lldb to 10.0.1
* Mon Dec 2 2019 likexin <likexin@huawei.com> 7.0.0-2
- Package init - Package init

4
lldb.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: llvm/llvm-project
tag_prefix: ^llvmorg-
seperator: .