2 %global use_jankratochvil_dwz 1
3 %global use_jankratochvil_uniqaddr 1
4 %global use_jankratochvil_rust 0
5 %global pkg_prefix /opt/%{name}
6 %global _unpackaged_files_terminate_build 0
7 # dwz: Couldn't find DIE referenced by DW_OP_GNU_parameter_ref
8 %global _find_debuginfo_dwz_opts %{nil}
9 # *** ERROR: ambiguous python shebang in /opt/lldb-experimental/...: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.
10 %global __brp_mangle_shebangs %{nil}
11 %if (0%{?rhel:1} && 0%{?rhel} <= 7)
12 # -gsplit-dwarf: LLVM: internal compiler error: in output_index_string, at dwarf2out.c:21891
13 # https://bugzilla.redhat.com/show_bug.cgi?id=1590678
17 %global debug_package %{nil}
19 Name: lldb-experimental
21 Release: 0.20210519snap1%{?dist}
22 Summary: Next generation high-performance debugger - experimental trunk snapshot
24 URL: http://lldb.llvm.org/
26 # Source zero not found
27 # https://bugzilla.redhat.com/show_bug.cgi?id=1938320
29 BuildRequires: gcc-c++ git libedit-devel libatomic libxml2-devel zlib-devel valgrind-devel libpfm-devel
30 # https://src.fedoraproject.org/rpms/epydoc
31 #BuildRequires: epydoc
32 %if 0%{?rhel:1} && 0%{?rhel} <= 7
33 #+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
34 #Compiling /quad/home/jkratoch/redhat/lldb-experimental/BUILDROOT/lldb-experimental-13.0.0-0.20210206snap1.el7.x86_64/opt/lldb-experimental/lib64/python3.8/site-packages/lldb/__init__.py ...
35 # File "/opt/lldb-experimental/lib64/python3.8/site-packages/lldb/__init__.py", line 883
36 # def IsValid(self) -> "bool":
38 #SyntaxError: invalid syntax
39 %global __python /usr/bin/python3
40 BuildRequires: devtoolset-8-gcc-c++
41 # swig on rhel7: /builddir/build/BUILD/lldb-experimental-11.0.0/lldb/bindings/./python/python-typemaps.swig:496: Error: Syntax error in input(3).
43 BuildRequires: rh-git218-git-core
44 BuildRequires: rh-python38-python-devel rh-python38-python-pyyaml
45 # https://bugzilla.redhat.com/show_bug.cgi?id=1511892
47 %global cmake %{cmake3}
48 %global cmake_build %{cmake3_build}
49 %global cmake_install %{cmake3_install}
52 # CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
53 # CMake 3.13.4 or higher is required. You are running version 3.11.4
58 BuildRequires: wget expat-devel
59 BuildRequires: /usr/bin/sphinx-build curl-devel emacs jsoncpp-devel openssl-devel pkgconfig(Qt5Widgets) rhash-devel
60 # -- Could NOT find LibArchive: Found unsuitable version "3.3.2", but required is at least "3.3.3" (found /usr/lib64/libarchive.so)
61 # CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!
62 #BuildRequires: libarchive-devel
63 # -- Could NOT find LibUV: Found unsuitable version "", but required is at least "1.10.0" (found LibUV_LIBRARY-NOTFOUND)
64 # CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!
65 # [local]=https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/$basearch/
66 #BuildRequires: libuv-devel
67 # CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
68 # Please set them or make sure they are set and tested correctly in the CMake files:
70 BuildRequires: bzip2-devel
73 BuildRequires: python3-devel python3-pygments python3-pyyaml
75 #BuildRequires: xar-devel
76 %if !0%{?rhel:1} || 0%{?rhel} > 8
77 BuildRequires: z3-devel
82 LLDB is a next generation, high-performance debugger. It is built as a set
83 of reusable components which highly leverage existing libraries in the
84 larger LLVM Project, such as the Clang expression parser and LLVM
86 This package is an experimental trunk snapshot.
87 %if %{use_jankratochvil_dwz}
88 This package contains off-trunk DWZ support for Fedora debuginfos such as:
89 unsupported DW_FORM values: 0x1f20 0x1f21
91 %if %{use_jankratochvil_uniqaddr}
92 This package contains off-trunk:
93 Support for libstdc++11 std::unique_ptr: [[no_unique_address]]
95 %if %{use_jankratochvil_rust}
96 This package contains off-trunk Rust support:
97 https://github.com/rust-lang-nursery/lldb
101 Summary: Development header files for %{name}
102 Requires: %{name}%{?_isa} = %{version}-%{release}
105 The package contains header files for %{name}.
107 {-L,"-Wl,-rpath,"}%{pkg_prefix}/%{_lib} -I%{pkg_prefix}/include -llldb -lLLVMSupport -ltinfo -pthread
112 %if 0%{?rhel:1} && 0%{?rhel} <= 7
113 # git clone --depth 10000 --single-branch --reference ../reference https://github.com/llvm/llvm-project.git .
114 # fatal: git fetch-pack: expected shallow list
115 . /opt/rh/rh-git218/enable
116 # CMake Warning at ../lldb/cmake/modules/FindPythonInterpAndLibs.cmake:10 (find_package):
117 # By not providing "FindPython3.cmake" in CMAKE_MODULE_PATH this project has
118 # asked CMake to find a package configuration file provided by "Python3", but
119 # CMake did not find one.
120 # Could not find a package configuration file provided by "Python3" with any
121 # of the following names:
122 # Python3Config.cmake
123 # python3-config.cmake
124 # Add the installation prefix of "Python3" to CMAKE_PREFIX_PATH or set
125 # "Python3_DIR" to a directory containing one of the above files. If
126 # "Python3" provides a separate development package or SDK, be sure it has
128 # Call Stack (most recent call first):
129 # ../lldb/cmake/modules/FindPythonInterpAndLibs.cmake:71 (FindPython3)
130 # ../lldb/cmake/modules/LLDBConfig.cmake:48 (find_package)
131 # ../lldb/cmake/modules/LLDBConfig.cmake:59 (add_optional_dependency)
132 # ../lldb/CMakeLists.txt:28 (include)
133 . /opt/rh/rh-python38/enable
136 cmakesrc=cmake-3.18.3-1.fc33.src.rpm
137 rm -rf $cmakesrc $cmakesrc.tgz $cmakesrc.d
138 wget http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/33/Everything/source/tree/Packages/c/$cmakesrc
139 rpm2archive $cmakesrc
142 tar xzf ../$cmakesrc.tgz
143 # FIXME: Why? FIXME: No longer needed?
144 #for i in .[a-z]*;do mv $i `echo $i|sed 's/^\.//'`;done
145 sed -i -e 's/qt-gui /&--no-system-libarchive --no-system-libuv /' cmake.spec
146 rpmbuild --define "_topdir $PWD" --define "_builddir $PWD" --define "_rpmdir $PWD" --define "_sourcedir $PWD" --define "_specdir $PWD" --define "_srcrpmdir $PWD" -bc --nodeps cmake.spec
148 %global __cmake %(echo %{_builddir}/cmake-*.d/cmake-*/*/bin/cmake)
149 %global __cmake_builddir .
150 %global cmake_build \
151 %__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose
152 %global cmake_install \
153 DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}"
157 %if !0%{?rhel:1} || 0%{?rhel} > 7
158 OPTS="$OPTS --no-tags"
161 # RHEL-7 does not support: --reference-if-able
162 CLONEOPTS="--single-branch"
163 test -d ../$REF/ && CLONEOPTS="$CLONEOPTS --reference ../$REF"
164 # 2500 = 1 month in 2019
165 git clone $OPTS $CLONEOPTS https://github.com/llvm/llvm-project.git .
166 %if %{use_jankratochvil_dwz} || %{use_jankratochvil_rust}
167 git remote remove jankratochvil || :
168 #git remote add jankratochvil git://git.jankratochvil.net/lldb
169 git remote add jankratochvil https://github.com/jankratochvil/llvm-project.git
170 git fetch $OPTS jankratochvil
171 git config user.email jankratochvil@copr.fedorainfracloud.org
172 git config user.name jankratochvil
174 %if %{use_jankratochvil_dwz}
175 git merge jankratochvil/dwz
177 %if %{use_jankratochvil_uniqaddr}
178 git merge jankratochvil/layout3
180 %if %{use_jankratochvil_rust}
181 # '-c merge.renames=false' is F-29+.
182 # '-c merge.renameLimit=0' has no effect.
183 git -c merge.renameLimit=1 merge jankratochvil/rust
189 # lldb/scripts/LLDBWrapPython.cpp:23699:70: error: format not a string literal and no format arguments [-Werror=format-security]
190 FLAGS="$FLAGS -Wno-error=format-security"
192 %if (0%{?rhel:1} && 0%{?rhel} <= 7)
193 . /opt/rh/devtoolset-8/enable
194 . /opt/rh/rh-python38/enable
199 # -fno-reorder-blocks-and-partition:
200 # -gsplit-dwarf: Error: can't resolve `.text.unlikely' - `.LVL414'
201 # https://bugzilla.redhat.com/show_bug.cgi?id=1573647
202 %if 0%{?fedora} != 35
203 FLAGS="$FLAGS -fdebug-types-section"
207 # Rawhide Gold on lldb-experimental build: invalid symbol table name index && section_header_offset: bad shndx
208 # https://bugzilla.redhat.com/show_bug.cgi?id=1954141
209 %if 0%{?fedora} == 35
210 FLAGS="$FLAGS -fno-lto"
216 # This is default - changing it breaks the testsuite: -DLLVM_LINK_LLVM_DYLIB=OFF
217 # It does not work: -DDCMAKE_EXECUTABLE_SUFFIX=-experimental
218 # -fdebug-types-section && -DLLVM_USE_LINKER=gold:
219 # ../../../../lib64/libclangLex.a(PreprocessingRecord.cpp.o)(.debug_types+0xfe): error: undefined reference to 'clang::SourceRange::getBegin() const'
221 -DCMAKE_INSTALL_PREFIX=%{pkg_prefix} \
223 -DCMAKE_BUILD_TYPE=Release \
225 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
227 -DLLVM_ENABLE_PROJECTS="lldb;clang;lld" \
228 -DLLVM_TARGETS_TO_BUILD=X86 \
229 -DLLVM_BUILD_TOOLS=OFF \
230 -DLLVM_USE_LINKER=gold \
231 $(: file INSTALL cannot find build-release/lib/python3.6 ) \
232 %if 0%{?__isa_bits} == 64
233 -DLLVM_LIBDIR_SUFFIX=64 \
235 -DLLVM_LIBDIR_SUFFIX= \
237 -DLLDB_DISABLE_CURSES=OFF \
238 -DLLDB_DISABLE_LIBEDIT=OFF \
239 -DLLDB_DISABLE_PYTHON=OFF \
240 -DLLVM_ENABLE_ASSERTIONS=ON \
245 mkdir -p %{buildroot}%{pkg_prefix}
247 echo "$(cd $1;git rev-parse ${2:-origin/master}) ${2:-$1}"
250 %if %{use_jankratochvil_dwz}
251 revline . jankratochvil/dwz
253 %if %{use_jankratochvil_rust}
254 revline . jankratochvil/rust
256 ) >%{buildroot}%{pkg_prefix}/HEAD
258 mkdir -p %{buildroot}%{_bindir}
261 echo >%{buildroot}%{_bindir}/${i}-experimental -e '#! /bin/bash\nexec %{pkg_prefix}/bin/'$i' "$@"'
262 chmod +x %{buildroot}%{_bindir}/${i}-experimental
265 # remove static libraries
266 rm -fv %{buildroot}%{_libdir}/*.a
268 ### python: fix liblldb.so -> liblldb.so.7 symlink target
269 (cd %{buildroot}%{pkg_prefix}/%{_lib}/python*/site-packages/lldb/
270 ln -vsf "$(dirname $(readlink _lldb.so))/$(readlink $(readlink _lldb.so))" _lldb.so
272 du -shc $PWD %{buildroot}
275 %{_bindir}/lldb-experimental
276 #{_bindir}/lldb-mi-experimental
278 %{pkg_prefix}/bin/lldb
279 %{pkg_prefix}/bin/lldb-server
280 #{pkg_prefix}/bin/lldb-mi
281 %{pkg_prefix}/bin/lldb-argdumper
282 # RHEL-7: File not found by glob: .../lib{lldb,clang,LLVM}*.so.*
283 %{pkg_prefix}/%{_lib}/libl*.so.*
284 %{pkg_prefix}/%{_lib}/python*
285 %{pkg_prefix}/%{_lib}/lib[^l]*.so.*
288 %{pkg_prefix}/include
289 %{pkg_prefix}/%{_lib}/*.so
292 * Thu Apr 5 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.0-0.1
293 - Initial import for COPR, based on Fedora package 'lldb'.