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.20200424snap1%{?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
21 # https://src.fedoraproject.org/rpms/epydoc
22 #BuildRequires: epydoc
23 %if 0%{?rhel:1} && 0%{?rhel} <= 7
24 BuildRequires: llvm-toolset-7-cmake devtoolset-8-gcc-c++ python-devel python2-pyyaml
25 # https://bugzilla.redhat.com/show_bug.cgi?id=1511892
26 %global __cmake /opt/rh/llvm-toolset-7/root/usr/bin/cmake3
27 %global ninjabuild ninja-build
29 %if !0%{?rhel:1} || 0%{?rhel} > 8
30 BuildRequires: z3-devel
33 BuildRequires: python3-devel python3-pygments python3-pyyaml
35 #BuildRequires: xar-devel
36 %global ninjabuild ninja
40 LLDB is a next generation, high-performance debugger. It is built as a set
41 of reusable components which highly leverage existing libraries in the
42 larger LLVM Project, such as the Clang expression parser and LLVM
44 This package is an experimental trunk snapshot.
45 %if %{use_jankratochvil_dwz}
46 This package contains off-trunk DWZ support for Fedora debuginfos such as:
47 unsupported DW_FORM values: 0x1f20 0x1f21
49 %if %{use_jankratochvil_rust}
50 This package contains off-trunk Rust support:
51 https://github.com/rust-lang-nursery/lldb
55 Summary: Development header files for %{name}
56 Requires: %{name}%{?_isa} = %{version}-%{release}
59 The package contains header files for %{name}.
61 {-L,"-Wl,-rpath,"}%{pkg_prefix}/%{_lib} -I%{pkg_prefix}/include -llldb -lLLVMSupport -ltinfo -pthread
68 %if !0%{?rhel:1} || 0%{?rhel} > 7
69 OPTS="$OPTS --no-tags"
72 # RHEL-7 does not support: --reference-if-able
73 test -d ../$REF/ && OPTS="$OPTS --reference ../$REF"
74 # 2500 = 1 month in 2019
75 git clone --depth 10000 --single-branch $OPTS https://github.com/llvm/llvm-project.git .
76 %if %{use_jankratochvil_dwz} || %{use_jankratochvil_rust}
77 git remote remove jankratochvil || :
78 git remote add jankratochvil git://git.jankratochvil.net/lldb
79 git fetch jankratochvil
80 git config user.email jankratochvil@copr.fedorainfracloud.org
81 git config user.name jankratochvil
83 %if %{use_jankratochvil_dwz}
84 git merge jankratochvil/dwz
86 %if %{use_jankratochvil_rust}
87 # '-c merge.renames=false' is F-29+.
88 # '-c merge.renameLimit=0' has no effect.
89 git -c merge.renameLimit=1 merge jankratochvil/rust
98 # lldb/scripts/LLDBWrapPython.cpp:23699:70: error: format not a string literal and no format arguments [-Werror=format-security]
99 FLAGS="$FLAGS -Wno-error=format-security"
101 %if (0%{?rhel:1} && 0%{?rhel} <= 7)
102 . /opt/rh/devtoolset-8/enable
103 # -gsplit-dwarf: LLVM: internal compiler error: in output_index_string, at dwarf2out.c:21891
104 # https://bugzilla.redhat.com/show_bug.cgi?id=1590678
105 # Set %%{fast} only after %%debug_package above.
111 # -fno-reorder-blocks-and-partition:
112 # -gsplit-dwarf: Error: can't resolve `.text.unlikely' - `.LVL414'
113 # https://bugzilla.redhat.com/show_bug.cgi?id=1573647
114 FLAGS="$FLAGS -gsplit-dwarf -fno-reorder-blocks-and-partition"
120 # This is default - changing it breaks the testsuite: -DLLVM_LINK_LLVM_DYLIB=OFF
121 # It does not work: -DDCMAKE_EXECUTABLE_SUFFIX=-experimental
122 # -fdebug-types-section && -DLLVM_USE_LINKER=gold:
123 # ../../../../lib64/libclangLex.a(PreprocessingRecord.cpp.o)(.debug_types+0xfe): error: undefined reference to 'clang::SourceRange::getBegin() const'
126 -DCMAKE_INSTALL_PREFIX=%{buildroot}%{pkg_prefix} \
127 -DBUILD_SHARED_LIBS=OFF \
129 -DCMAKE_BUILD_TYPE=Release \
131 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
133 -DLLVM_ENABLE_PROJECTS="lldb;clang;lld" \
134 -DLLVM_TARGETS_TO_BUILD=X86 \
135 -DLLVM_BUILD_TOOLS=OFF \
136 -DLLVM_USE_LINKER=gold \
137 $(: file INSTALL cannot find build-release/lib/python3.6 ) \
138 %if 0%{?__isa_bits} == 64
139 -DLLVM_LIBDIR_SUFFIX=64 \
141 -DLLVM_LIBDIR_SUFFIX= \
143 -DLLDB_DISABLE_CURSES=OFF \
144 -DLLDB_DISABLE_LIBEDIT=OFF \
145 -DLLDB_DISABLE_PYTHON=OFF \
150 mkdir -p %{buildroot}%{pkg_prefix}
152 echo "$(cd $1;git rev-parse ${2:-origin/master}) ${2:-$1}"
155 %if %{use_jankratochvil_dwz}
156 revline . jankratochvil/dwz
158 %if %{use_jankratochvil_rust}
159 revline . jankratochvil/rust
161 ) >%{buildroot}%{pkg_prefix}/HEAD
163 %{ninjabuild} -v install
164 mkdir -p %{buildroot}%{_bindir}
167 echo >%{buildroot}%{_bindir}/${i}-experimental -e '#! /bin/bash\nexec %{pkg_prefix}/bin/'$i' "$@"'
168 chmod +x %{buildroot}%{_bindir}/${i}-experimental
171 # remove static libraries
172 rm -fv %{buildroot}%{_libdir}/*.a
174 ### python: fix liblldb.so -> liblldb.so.7 symlink target
175 (cd %{buildroot}%{pkg_prefix}/lib/python*/site-packages/lldb/
176 ln -vsf "$(dirname $(readlink _lldb.so))/$(readlink $(readlink _lldb.so))" _lldb.so
180 %{_bindir}/lldb-experimental
181 #{_bindir}/lldb-mi-experimental
183 %{pkg_prefix}/bin/lldb
184 %{pkg_prefix}/bin/lldb-server
185 #{pkg_prefix}/bin/lldb-mi
186 %{pkg_prefix}/bin/lldb-argdumper
187 # RHEL-7: File not found by glob: .../lib{lldb,clang,LLVM}*.so.*
188 %{pkg_prefix}/%{_lib}/libl*.so.*
189 %{pkg_prefix}/lib/python*
192 %{pkg_prefix}/include
193 %{pkg_prefix}/%{_lib}/lib[^l]*.so.*
194 %{pkg_prefix}/%{_lib}/*.so
195 %{pkg_prefix}/%{_lib}/*.a
198 * Thu Apr 5 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.0-0.1
199 - Initial import for COPR, based on Fedora package 'lldb'.