2 %global use_jankratochvil_dwz 1
3 %global use_jankratochvil_rust 0
4 %global pkg_prefix /opt/%{name}
5 %global _unpackaged_files_terminate_build 0
6 # dwz: Couldn't find DIE referenced by DW_OP_GNU_parameter_ref
7 %global _find_debuginfo_dwz_opts %{nil}
8 # *** ERROR: ambiguous python shebang in /opt/lldb-experimental/...: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
9 %global __brp_mangle_shebangs %{nil}
11 %global debug_package %{nil}
13 Name: lldb-experimental
15 Release: 0.20191027snap0%{?dist}
16 Summary: Next generation high-performance debugger - experimental trunk snapshot
18 URL: http://lldb.llvm.org/
20 BuildRequires: gcc-c++ git libedit-devel swig libatomic ninja-build libxml2-devel zlib-devel valgrind-devel libpfm-devel epydoc
21 %if 0%{?rhel:1} && 0%{?rhel} <= 7
22 BuildRequires: llvm-toolset-7-cmake devtoolset-8-gcc-c++ python-devel python2-pyyaml
23 # https://bugzilla.redhat.com/show_bug.cgi?id=1511892
24 %global __cmake /opt/rh/llvm-toolset-7/root/usr/bin/cmake3
25 %global ninjabuild ninja-build
27 BuildRequires: cmake z3-devel
28 BuildRequires: python3-devel python3-pygments python3-pyyaml
30 #BuildRequires: xar-devel
31 %global ninjabuild ninja
35 LLDB is a next generation, high-performance debugger. It is built as a set
36 of reusable components which highly leverage existing libraries in the
37 larger LLVM Project, such as the Clang expression parser and LLVM
39 This package is an experimental trunk snapshot.
40 %if %{use_jankratochvil_dwz}
41 This package contains off-trunk DWZ support for Fedora debuginfos such as:
42 unsupported DW_FORM values: 0x1f20 0x1f21
44 %if %{use_jankratochvil_rust}
45 This package contains off-trunk Rust support:
46 https://github.com/rust-lang-nursery/lldb
50 Summary: Development header files for %{name}
51 Requires: %{name}%{?_isa} = %{version}-%{release}
54 The package contains header files for %{name}.
56 {-L,"-Wl,-rpath,"}%{pkg_prefix}/%{_lib} -I%{pkg_prefix}/include -llldb -lLLVMSupport -ltinfo -pthread
63 %if !0%{?rhel:1} || 0%{?rhel} > 7
64 OPTS="$OPTS --no-tags"
67 # RHEL-7 does not support: --reference-if-able
68 test -d ../$REF/ && OPTS="$OPTS --reference ../$REF"
69 # 2500 = 1 month in 2019
70 git clone --depth 10000 --single-branch $OPTS https://github.com/llvm/llvm-project.git .
71 %if %{use_jankratochvil_dwz} || %{use_jankratochvil_rust}
72 git remote remove jankratochvil || :
73 git remote add jankratochvil git://git.jankratochvil.net/lldb
74 git fetch jankratochvil
75 git config user.email jankratochvil@copr.fedorainfracloud.org
76 git config user.name jankratochvil
78 %if %{use_jankratochvil_dwz}
79 git merge jankratochvil/dwz
81 %if %{use_jankratochvil_rust}
82 # '-c merge.renames=false' is F-29+.
83 # '-c merge.renameLimit=0' has no effect.
84 git -c merge.renameLimit=1 merge jankratochvil/rust
93 # lldb/scripts/LLDBWrapPython.cpp:23699:70: error: format not a string literal and no format arguments [-Werror=format-security]
94 FLAGS="$FLAGS -Wno-error=format-security"
96 %if (0%{?rhel:1} && 0%{?rhel} <= 7)
97 . /opt/rh/devtoolset-8/enable
98 # -gsplit-dwarf: LLVM: internal compiler error: in output_index_string, at dwarf2out.c:21891
99 # https://bugzilla.redhat.com/show_bug.cgi?id=1590678
100 # Set %%{fast} only after %%debug_package above.
106 # -fno-reorder-blocks-and-partition:
107 # -gsplit-dwarf: Error: can't resolve `.text.unlikely' - `.LVL414'
108 # https://bugzilla.redhat.com/show_bug.cgi?id=1573647
109 FLAGS="$FLAGS -gsplit-dwarf -fno-reorder-blocks-and-partition"
115 # This is default - changing it breaks the testsuite: -DLLVM_LINK_LLVM_DYLIB=OFF
116 # It does not work: -DDCMAKE_EXECUTABLE_SUFFIX=-experimental
117 # -fdebug-types-section && -DLLVM_USE_LINKER=gold:
118 # ../../../../lib64/libclangLex.a(PreprocessingRecord.cpp.o)(.debug_types+0xfe): error: undefined reference to 'clang::SourceRange::getBegin() const'
121 -DCMAKE_INSTALL_PREFIX=%{buildroot}%{pkg_prefix} \
122 -DBUILD_SHARED_LIBS=OFF \
124 -DCMAKE_BUILD_TYPE=Release \
126 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
128 -DLLVM_ENABLE_PROJECTS="lldb;clang;lld" \
129 -DLLVM_TARGETS_TO_BUILD=X86 \
130 -DLLVM_BUILD_TOOLS=OFF \
131 -DLLVM_USE_LINKER=gold \
132 $(: file INSTALL cannot find build-release/lib/python3.6 ) \
133 %if 0%{?__isa_bits} == 64
134 -DLLVM_LIBDIR_SUFFIX=64 \
136 -DLLVM_LIBDIR_SUFFIX= \
138 -DLLDB_DISABLE_CURSES=OFF \
139 -DLLDB_DISABLE_LIBEDIT=OFF \
140 -DLLDB_DISABLE_PYTHON=OFF \
145 mkdir -p %{buildroot}%{pkg_prefix}
147 echo "$(cd $1;git rev-parse ${2:-origin/master}) ${2:-$1}"
150 %if %{use_jankratochvil_dwz}
151 revline . jankratochvil/dwz
153 %if %{use_jankratochvil_rust}
154 revline . jankratochvil/rust
156 ) >%{buildroot}%{pkg_prefix}/HEAD
158 %{ninjabuild} -v install
159 mkdir -p %{buildroot}%{_bindir}
162 echo >%{buildroot}%{_bindir}/${i}-experimental -e '#! /bin/bash\nexec %{pkg_prefix}/bin/'$i' "$@"'
163 chmod +x %{buildroot}%{_bindir}/${i}-experimental
166 # remove static libraries
167 rm -fv %{buildroot}%{_libdir}/*.a
169 ### python: fix liblldb.so -> liblldb.so.7 symlink target
170 (cd %{buildroot}%{pkg_prefix}/%{_lib}/python*/site-packages/lldb/
171 ln -vsf "$(dirname $(readlink _lldb.so))/$(readlink $(readlink _lldb.so))" _lldb.so
174 # FIXME: Port it to Python 3: remove bundled six.py - Python 2<->3
175 rm -f %{buildroot}%{pkg_prefix}/%{_lib}/python*/site-packages/six.py*
178 %{_bindir}/lldb-experimental
179 #{_bindir}/lldb-mi-experimental
181 %{pkg_prefix}/bin/lldb
182 %{pkg_prefix}/bin/lldb-server
183 #{pkg_prefix}/bin/lldb-mi
184 %{pkg_prefix}/bin/lldb-argdumper
185 # RHEL-7: File not found by glob: .../lib{lldb,clang,LLVM}*.so.*
186 %{pkg_prefix}/%{_lib}/libl*.so.*
187 %{pkg_prefix}/%{_lib}/python*
190 %{pkg_prefix}/include
191 %{pkg_prefix}/%{_lib}/lib[^l]*.so.*
192 %{pkg_prefix}/%{_lib}/*.so
193 %{pkg_prefix}/%{_lib}/*.a
196 * Thu Apr 5 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.0-0.1
197 - Initial import for COPR, based on Fedora package 'lldb'.