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.20210604snap6%{?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} <= 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}
53 # CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
54 # CMake 3.13.4 or higher is required. You are running version 3.11.4
59 BuildRequires: wget expat-devel
60 BuildRequires: /usr/bin/sphinx-build curl-devel emacs jsoncpp-devel openssl-devel pkgconfig(Qt5Widgets) rhash-devel
61 # -- Could NOT find LibArchive: Found unsuitable version "3.3.2", but required is at least "3.3.3" (found /usr/lib64/libarchive.so)
62 # CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!
63 #BuildRequires: libarchive-devel
64 # -- Could NOT find LibUV: Found unsuitable version "", but required is at least "1.10.0" (found LibUV_LIBRARY-NOTFOUND)
65 # CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!
66 # [local]=https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/$basearch/
67 #BuildRequires: libuv-devel
68 # CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
69 # Please set them or make sure they are set and tested correctly in the CMake files:
71 BuildRequires: bzip2-devel
74 BuildRequires: python3-devel python3-pygments python3-pyyaml
76 #BuildRequires: xar-devel
77 %if !0%{?rhel:1} || 0%{?rhel} > 8
78 BuildRequires: z3-devel
83 LLDB is a next generation, high-performance debugger. It is built as a set
84 of reusable components which highly leverage existing libraries in the
85 larger LLVM Project, such as the Clang expression parser and LLVM
87 This package is an experimental trunk snapshot.
88 %if %{use_jankratochvil_dwz}
89 This package contains off-trunk DWZ support for Fedora debuginfos such as:
90 unsupported DW_FORM values: 0x1f20 0x1f21
92 %if %{use_jankratochvil_uniqaddr}
93 This package contains off-trunk:
94 Support for libstdc++11 std::unique_ptr: [[no_unique_address]]
96 %if %{use_jankratochvil_rust}
97 This package contains off-trunk Rust support:
98 https://github.com/rust-lang-nursery/lldb
102 Summary: Development header files for %{name}
103 Requires: %{name}%{?_isa} = %{version}-%{release}
106 The package contains header files for %{name}.
108 {-L,"-Wl,-rpath,"}%{pkg_prefix}/%{_lib} -I%{pkg_prefix}/include -llldb -lLLVMSupport -ltinfo -pthread
113 %if 0%{?rhel:1} && 0%{?rhel} <= 7
114 # git clone --depth 10000 --single-branch --reference ../reference https://github.com/llvm/llvm-project.git .
115 # fatal: git fetch-pack: expected shallow list
116 . /opt/rh/rh-git218/enable
117 # CMake Warning at ../lldb/cmake/modules/FindPythonInterpAndLibs.cmake:10 (find_package):
118 # By not providing "FindPython3.cmake" in CMAKE_MODULE_PATH this project has
119 # asked CMake to find a package configuration file provided by "Python3", but
120 # CMake did not find one.
121 # Could not find a package configuration file provided by "Python3" with any
122 # of the following names:
123 # Python3Config.cmake
124 # python3-config.cmake
125 # Add the installation prefix of "Python3" to CMAKE_PREFIX_PATH or set
126 # "Python3_DIR" to a directory containing one of the above files. If
127 # "Python3" provides a separate development package or SDK, be sure it has
129 # Call Stack (most recent call first):
130 # ../lldb/cmake/modules/FindPythonInterpAndLibs.cmake:71 (FindPython3)
131 # ../lldb/cmake/modules/LLDBConfig.cmake:48 (find_package)
132 # ../lldb/cmake/modules/LLDBConfig.cmake:59 (add_optional_dependency)
133 # ../lldb/CMakeLists.txt:28 (include)
134 . /opt/rh/rh-python38/enable
137 cmakesrc=cmake-3.18.3-1.fc33.src.rpm
138 rm -rf $cmakesrc $cmakesrc.tgz $cmakesrc.d
139 wget http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/33/Everything/source/tree/Packages/c/$cmakesrc
140 rpm2archive $cmakesrc
143 tar xzf ../$cmakesrc.tgz
144 # FIXME: Why? FIXME: No longer needed?
145 #for i in .[a-z]*;do mv $i `echo $i|sed 's/^\.//'`;done
146 sed -i -e 's/qt-gui /&--no-system-libarchive --no-system-libuv /' cmake.spec
147 rpmbuild --define "_topdir $PWD" --define "_builddir $PWD" --define "_rpmdir $PWD" --define "_sourcedir $PWD" --define "_specdir $PWD" --define "_srcrpmdir $PWD" -bc --nodeps cmake.spec
149 %global __cmake %(echo %{_builddir}/cmake-*.d/cmake-*/*/bin/cmake)
150 %global __cmake_builddir .
151 %global cmake_build \
152 %__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose
153 %global cmake_install \
154 DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}"
158 %if !0%{?rhel:1} || 0%{?rhel} > 7
159 OPTS="$OPTS --no-tags"
162 # RHEL-7 does not support: --reference-if-able
163 CLONEOPTS="--single-branch"
164 test -d ../$REF/ && CLONEOPTS="$CLONEOPTS --reference ../$REF"
165 # 2500 = 1 month in 2019
166 git clone $OPTS $CLONEOPTS https://github.com/llvm/llvm-project.git .
167 %if %{use_jankratochvil_dwz} || %{use_jankratochvil_rust}
168 git remote remove jankratochvil || :
169 #git remote add jankratochvil git://git.jankratochvil.net/lldb
170 git remote add jankratochvil https://github.com/jankratochvil/llvm-project.git
171 git fetch $OPTS jankratochvil
172 git config user.email jankratochvil@copr.fedorainfracloud.org
173 git config user.name jankratochvil
175 %if %{use_jankratochvil_dwz}
176 git merge jankratochvil/dwz
178 %if %{use_jankratochvil_uniqaddr}
179 git merge jankratochvil/layout3
181 %if %{use_jankratochvil_rust}
182 # '-c merge.renames=false' is F-29+.
183 # '-c merge.renameLimit=0' has no effect.
184 git -c merge.renameLimit=1 merge jankratochvil/rust
190 # lldb/scripts/LLDBWrapPython.cpp:23699:70: error: format not a string literal and no format arguments [-Werror=format-security]
191 FLAGS="$FLAGS -Wno-error=format-security"
193 %if (0%{?rhel:1} && 0%{?rhel} <= 7)
194 . /opt/rh/devtoolset-8/enable
195 . /opt/rh/rh-python38/enable
200 # -fno-reorder-blocks-and-partition:
201 # -gsplit-dwarf: Error: can't resolve `.text.unlikely' - `.LVL414'
202 # https://bugzilla.redhat.com/show_bug.cgi?id=1573647
203 %if 0%{?fedora} != 35
204 FLAGS="$FLAGS -fdebug-types-section"
208 # clang-12: error: unsupported argument 'auto' to option 'flto='
209 # clang-12: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
210 FLAGS="$(echo $FLAGS|sed 's/ -flto=auto -ffat-lto-objects / -flto /')"
211 # ld.lld: error: relocation R_X86_64_PC32 cannot be used against symbol ...; recompile with -fPIC
213 %if 0%{?rhel:1} && 0%{?rhel} <= 7
214 # clang: error: unknown argument: '-fstack-protector-strong'
215 FLAGS="$(echo $FLAGS|sed 's/ -fstack-protector-strong / /')"
221 # This is default - changing it breaks the testsuite: -DLLVM_LINK_LLVM_DYLIB=OFF
222 # It does not work: -DDCMAKE_EXECUTABLE_SUFFIX=-experimental
224 -DCMAKE_INSTALL_PREFIX=%{pkg_prefix} \
225 -DCMAKE_C_COMPILER=clang \
226 -DCMAKE_CXX_COMPILER=clang++ \
227 %if 0%{?rhel:1} && 0%{?rhel} <= 7
228 -DLLVM_USE_LINKER=gold \
230 -DLLVM_USE_LINKER=lld \
233 -DCMAKE_BUILD_TYPE=Release \
235 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
237 -DLLVM_ENABLE_PROJECTS="lldb;clang;lld" \
238 -DLLVM_TARGETS_TO_BUILD=X86 \
239 -DLLVM_BUILD_TOOLS=OFF \
240 $(: file INSTALL cannot find build-release/lib/python3.6 ) \
241 %if 0%{?__isa_bits} == 64
242 -DLLVM_LIBDIR_SUFFIX=64 \
244 -DLLVM_LIBDIR_SUFFIX= \
246 -DLLDB_DISABLE_CURSES=OFF \
247 -DLLDB_DISABLE_LIBEDIT=OFF \
248 -DLLDB_DISABLE_PYTHON=OFF \
249 -DLLVM_ENABLE_ASSERTIONS=ON \
254 mkdir -p %{buildroot}%{pkg_prefix}
256 echo "$(cd $1;git rev-parse ${2:-origin/master}) ${2:-$1}"
259 %if %{use_jankratochvil_dwz}
260 revline . jankratochvil/dwz
262 %if %{use_jankratochvil_rust}
263 revline . jankratochvil/rust
265 ) >%{buildroot}%{pkg_prefix}/HEAD
267 mkdir -p %{buildroot}%{_bindir}
270 echo >%{buildroot}%{_bindir}/${i}-experimental -e '#! /bin/bash\nexec %{pkg_prefix}/bin/'$i' "$@"'
271 chmod +x %{buildroot}%{_bindir}/${i}-experimental
274 # remove static libraries
275 rm -fv %{buildroot}%{_libdir}/*.a
277 ### python: fix liblldb.so -> liblldb.so.7 symlink target
278 (cd %{buildroot}%{pkg_prefix}/%{_lib}/python*/site-packages/lldb/
279 ln -vsf "$(dirname $(readlink _lldb.so))/$(readlink $(readlink _lldb.so))" _lldb.so
281 du -shc $PWD %{buildroot}
284 %{_bindir}/lldb-experimental
285 #{_bindir}/lldb-mi-experimental
287 %{pkg_prefix}/bin/lldb
288 %{pkg_prefix}/bin/lldb-server
289 #{pkg_prefix}/bin/lldb-mi
290 %{pkg_prefix}/bin/lldb-argdumper
291 # RHEL-7: File not found by glob: .../lib{lldb,clang,LLVM}*.so.*
292 %{pkg_prefix}/%{_lib}/libl*.so.*
293 %{pkg_prefix}/%{_lib}/python*
294 %{pkg_prefix}/%{_lib}/lib[^l]*.so.*
297 %{pkg_prefix}/include
298 %{pkg_prefix}/%{_lib}/*.so
301 * Thu Apr 5 2018 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.0-0.1
302 - Initial import for COPR, based on Fedora package 'lldb'.