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.20210609snap0%{?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: clang 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} > 8
33 BuildRequires: ocaml-findlib ocaml-ctypes
35 %if 0%{?rhel:1} && 0%{?rhel} <= 7
36 #+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
37 #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 ...
38 # File "/opt/lldb-experimental/lib64/python3.8/site-packages/lldb/__init__.py", line 883
39 # def IsValid(self) -> "bool":
41 #SyntaxError: invalid syntax
42 %global __python /usr/bin/python3
43 BuildRequires: llvm-toolset-7.0-clang llvm-toolset-7.0-lld
44 # swig on rhel7: /builddir/build/BUILD/lldb-experimental-11.0.0/lldb/bindings/./python/python-typemaps.swig:496: Error: Syntax error in input(3).
46 BuildRequires: rh-git218-git-core
47 BuildRequires: rh-python38-python-devel rh-python38-python-pyyaml
48 # https://bugzilla.redhat.com/show_bug.cgi?id=1511892
50 %global cmake %{cmake3}
51 %global cmake_build %{cmake3_build}
52 %global cmake_install %{cmake3_install}
56 # CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
57 # CMake 3.13.4 or higher is required. You are running version 3.11.4
62 BuildRequires: wget expat-devel
63 BuildRequires: /usr/bin/sphinx-build curl-devel emacs jsoncpp-devel openssl-devel pkgconfig(Qt5Widgets) rhash-devel
64 # -- Could NOT find LibArchive: Found unsuitable version "3.3.2", but required is at least "3.3.3" (found /usr/lib64/libarchive.so)
65 # CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!
66 #BuildRequires: libarchive-devel
67 # -- Could NOT find LibUV: Found unsuitable version "", but required is at least "1.10.0" (found LibUV_LIBRARY-NOTFOUND)
68 # CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!
69 # [local]=https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/$basearch/
70 #BuildRequires: libuv-devel
71 # CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
72 # Please set them or make sure they are set and tested correctly in the CMake files:
74 BuildRequires: bzip2-devel
77 BuildRequires: python3-devel python3-pygments python3-pyyaml
79 #BuildRequires: xar-devel
80 %if !0%{?rhel:1} || 0%{?rhel} > 8
81 BuildRequires: z3-devel
86 LLDB is a next generation, high-performance debugger. It is built as a set
87 of reusable components which highly leverage existing libraries in the
88 larger LLVM Project, such as the Clang expression parser and LLVM
90 This package is an experimental trunk snapshot.
91 %if %{use_jankratochvil_dwz}
92 This package contains off-trunk DWZ support for Fedora debuginfos such as:
93 unsupported DW_FORM values: 0x1f20 0x1f21
95 %if %{use_jankratochvil_uniqaddr}
96 This package contains off-trunk:
97 Support for libstdc++11 std::unique_ptr: [[no_unique_address]]
99 %if %{use_jankratochvil_rust}
100 This package contains off-trunk Rust support:
101 https://github.com/rust-lang-nursery/lldb
105 Summary: Development header files for %{name}
106 Requires: %{name}%{?_isa} = %{version}-%{release}
109 The package contains header files for %{name}.
111 {-L,"-Wl,-rpath,"}%{pkg_prefix}/%{_lib} -I%{pkg_prefix}/include -llldb -lLLVMSupport -ltinfo -pthread
116 %if 0%{?rhel:1} && 0%{?rhel} <= 7
117 # git clone --depth 10000 --single-branch --reference ../reference https://github.com/llvm/llvm-project.git .
118 # fatal: git fetch-pack: expected shallow list
119 . /opt/rh/rh-git218/enable
120 # CMake Warning at ../lldb/cmake/modules/FindPythonInterpAndLibs.cmake:10 (find_package):
121 # By not providing "FindPython3.cmake" in CMAKE_MODULE_PATH this project has
122 # asked CMake to find a package configuration file provided by "Python3", but
123 # CMake did not find one.
124 # Could not find a package configuration file provided by "Python3" with any
125 # of the following names:
126 # Python3Config.cmake
127 # python3-config.cmake
128 # Add the installation prefix of "Python3" to CMAKE_PREFIX_PATH or set
129 # "Python3_DIR" to a directory containing one of the above files. If
130 # "Python3" provides a separate development package or SDK, be sure it has
132 # Call Stack (most recent call first):
133 # ../lldb/cmake/modules/FindPythonInterpAndLibs.cmake:71 (FindPython3)
134 # ../lldb/cmake/modules/LLDBConfig.cmake:48 (find_package)
135 # ../lldb/cmake/modules/LLDBConfig.cmake:59 (add_optional_dependency)
136 # ../lldb/CMakeLists.txt:28 (include)
137 . /opt/rh/rh-python38/enable
140 cmakesrc=cmake-3.18.3-1.fc33.src.rpm
141 rm -rf $cmakesrc $cmakesrc.tgz $cmakesrc.d
142 wget http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/33/Everything/source/tree/Packages/c/$cmakesrc
143 rpm2archive $cmakesrc
146 tar xzf ../$cmakesrc.tgz
147 # FIXME: Why? FIXME: No longer needed?
148 #for i in .[a-z]*;do mv $i `echo $i|sed 's/^\.//'`;done
149 sed -i -e 's/qt-gui /&--no-system-libarchive --no-system-libuv /' cmake.spec
150 rpmbuild --define "_topdir $PWD" --define "_builddir $PWD" --define "_rpmdir $PWD" --define "_sourcedir $PWD" --define "_specdir $PWD" --define "_srcrpmdir $PWD" -bc --nodeps cmake.spec
152 %global __cmake %(echo %{_builddir}/cmake-*.d/cmake-*/*/bin/cmake)
153 %global __cmake_builddir .
154 %global cmake_build \
155 %__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose
156 %global cmake_install \
157 DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}"
161 %if !0%{?rhel:1} || 0%{?rhel} > 7
162 OPTS="$OPTS --no-tags"
165 # RHEL-7 does not support: --reference-if-able
166 CLONEOPTS="--single-branch"
167 test -d ../$REF/ && CLONEOPTS="$CLONEOPTS --reference ../$REF"
168 # 2500 = 1 month in 2019
169 git clone $OPTS $CLONEOPTS https://github.com/llvm/llvm-project.git .
170 %if %{use_jankratochvil_dwz} || %{use_jankratochvil_rust}
171 git remote remove jankratochvil || :
172 #git remote add jankratochvil git://git.jankratochvil.net/lldb
173 git remote add jankratochvil https://github.com/jankratochvil/llvm-project.git
174 git fetch $OPTS jankratochvil
175 git config user.email jankratochvil@copr.fedorainfracloud.org
176 git config user.name jankratochvil
178 %if %{use_jankratochvil_dwz}
179 git merge jankratochvil/dwz
181 %if %{use_jankratochvil_uniqaddr}
182 git merge jankratochvil/layout3
184 %if %{use_jankratochvil_rust}
185 # '-c merge.renames=false' is F-29+.
186 # '-c merge.renameLimit=0' has no effect.
187 git -c merge.renameLimit=1 merge jankratochvil/rust
193 # lldb/scripts/LLDBWrapPython.cpp:23699:70: error: format not a string literal and no format arguments [-Werror=format-security]
194 FLAGS="$FLAGS -Wno-error=format-security"
196 %if (0%{?rhel:1} && 0%{?rhel} <= 7)
197 . /opt/rh/llvm-toolset-7.0/enable
198 . /opt/rh/rh-python38/enable
203 # -fno-reorder-blocks-and-partition:
204 # -gsplit-dwarf: Error: can't resolve `.text.unlikely' - `.LVL414'
205 # https://bugzilla.redhat.com/show_bug.cgi?id=1573647
206 %if 0%{?fedora} != 35
207 FLAGS="$FLAGS -fdebug-types-section"
211 # clang-12: error: unsupported argument 'auto' to option 'flto='
212 # clang-12: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
213 FLAGS="$(echo $FLAGS|sed 's/ -flto=auto -ffat-lto-objects / -flto /')"
214 # ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol ...; recompile with -fPIC
216 %if 0%{?rhel:1} && 0%{?rhel} <= 7
217 # clang: error: unknown argument: '-fstack-protector-strong'
218 FLAGS="$(echo $FLAGS|sed 's/ -fstack-protector-strong / /')"
221 export CFLAGS="$FLAGS"
222 export CXXFLAGS="$FLAGS"
224 export LDFLAGS="%{build_ldflags}"
225 LDFLAGS="$LDFLAGS -flto -Wl,--build-id=sha1"
227 # This is default - changing it breaks the testsuite: -DLLVM_LINK_LLVM_DYLIB=OFF
228 # It does not work: -DDCMAKE_EXECUTABLE_SUFFIX=-experimental
230 -DCMAKE_INSTALL_PREFIX=%{pkg_prefix} \
231 -DCMAKE_C_COMPILER=clang \
232 -DCMAKE_CXX_COMPILER=clang++ \
233 %if 0%{?rhel:1} && 0%{?rhel} <= 7
234 -DLLVM_USE_LINKER=gold \
236 -DLLVM_USE_LINKER=lld \
239 -DCMAKE_BUILD_TYPE=Release \
241 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
243 -DLLVM_ENABLE_PROJECTS="lldb;clang;lld" \
244 -DLLVM_TARGETS_TO_BUILD=X86 \
245 -DLLVM_BUILD_TOOLS=OFF \
246 $(: file INSTALL cannot find build-release/lib/python3.6 ) \
247 %if 0%{?__isa_bits} == 64
248 -DLLVM_LIBDIR_SUFFIX=64 \
250 -DLLVM_LIBDIR_SUFFIX= \
252 -DLLDB_DISABLE_CURSES=OFF \
253 -DLLDB_DISABLE_LIBEDIT=OFF \
254 -DLLDB_DISABLE_PYTHON=OFF \
255 -DLLVM_ENABLE_ASSERTIONS=ON \
260 mkdir -p %{buildroot}%{pkg_prefix}
262 echo "$(cd $1;git rev-parse ${2:-origin/master}) ${2:-$1}"
265 %if %{use_jankratochvil_dwz}
266 revline . jankratochvil/dwz
268 %if %{use_jankratochvil_rust}
269 revline . jankratochvil/rust
271 ) >%{buildroot}%{pkg_prefix}/HEAD
273 mkdir -p %{buildroot}%{_bindir}
276 echo >%{buildroot}%{_bindir}/${i}-experimental -e '#! /bin/bash\nexec %{pkg_prefix}/bin/'$i' "$@"'
277 chmod +x %{buildroot}%{_bindir}/${i}-experimental
280 # remove static libraries
281 rm -fv %{buildroot}%{_libdir}/*.a
283 ### python: fix liblldb.so -> liblldb.so.7 symlink target
284 (cd %{buildroot}%{pkg_prefix}/%{_lib}/python*/site-packages/lldb/
285 ln -vsf "$(dirname $(readlink _lldb.so))/$(readlink $(readlink _lldb.so))" _lldb.so
287 du -shc $PWD %{buildroot}
290 %{_bindir}/lldb-experimental
291 #{_bindir}/lldb-mi-experimental
293 %{pkg_prefix}/bin/lldb
294 %{pkg_prefix}/bin/lldb-server
295 #{pkg_prefix}/bin/lldb-mi
296 %{pkg_prefix}/bin/lldb-argdumper
297 # RHEL-7: File not found by glob: .../lib{lldb,clang,LLVM}*.so.*
298 %{pkg_prefix}/%{_lib}/libl*.so.*
299 %{pkg_prefix}/%{_lib}/python*
300 %{pkg_prefix}/%{_lib}/lib[^l]*.so.*
303 %{pkg_prefix}/include
304 %{pkg_prefix}/%{_lib}/*.so
307 * Thu Apr 5 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.0-0.1
308 - Initial import for COPR, based on Fedora package 'lldb'.