llvm-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. %bcond_with test
  2. %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
  3. %define ver_suffix %(echo "%{version}" | cut -d . -f 1)
  4. %define _unpackaged_files_terminate_build 1
  5. # Build options:
  6. # Components skipped by default:
  7. %bcond_with doxygen
  8. # Documentation install path
  9. %global llvmdocdir() %{_docdir}/%1-%{version}
  10. %define _unpackaged_files_terminate_build 1
  11. # build order of LLVM family.
  12. # llvm
  13. # clang
  14. # lld
  15. # compiler-rt
  16. # lldb
  17. # libomp
  18. Summary: The Low Level Virtual Machine
  19. Summary(ja): LLVM - 低レベルバーチャルマシン
  20. Name: llvm
  21. Version: 14.0.5
  22. Release: 1%{?_dist_release}
  23. Group: programming
  24. Vendor: Project Vine
  25. Distribution: Vine Linux
  26. License: NCSA
  27. URL: https://llvm.org/
  28. Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz
  29. # multilib fixes
  30. Source10: llvm-config.h
  31. # patches
  32. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  33. BuildRequires: binutils-devel
  34. BuildRequires: cmake
  35. BuildRequires: libedit-devel
  36. BuildRequires: libffi-devel
  37. BuildRequires: ncurses-devel
  38. BuildRequires: ninja
  39. BuildRequires: python3-devel
  40. BuildRequires: python3-rpm-macros
  41. BuildRequires: valgrind-devel
  42. BuildRequires: zlib-devel
  43. Requires: llvm%{ver_suffix}-libs = %{version}-%{release}
  44. %description
  45. LLVM is a compiler infrastructure designed for compile-time,
  46. link-time, runtime, and idle-time optimization of programs from
  47. arbitrary programming languages. The compiler infrastructure includes
  48. mirror sets of programming tools as well as libraries with equivalent
  49. functionality.
  50. %package devel
  51. Summary: Libraries and header files for LLVM
  52. Summary(ja): LLVM のライブラリおよびヘッダファイル
  53. Group: programming
  54. Requires: %{name} = %{version}-%{release}
  55. Requires: llvm%{ver_suffix}-libs = %{version}-%{release}
  56. Requires: libedit-devel
  57. %description devel
  58. This package contains library and header files needed to develop new
  59. native programs that use the LLVM infrastructure.
  60. %package doc
  61. Summary: Documentation for LLVM
  62. Summary(ja): LLVM のドキュメント
  63. Group: documentation
  64. BuildArch: noarch
  65. Requires: %{name} = %{version}-%{release}
  66. # might seem redundant, but needed to kill off the old arch-ed -doc subpackage
  67. Obsoletes: %{name}-doc < %{version}-%{release}
  68. %description doc
  69. Documentation for the LLVM compiler infrastructure.
  70. %package -n llvm%{ver_suffix}-libs
  71. Summary: LLVM shared libraries
  72. Summary(ja): LLVM 共有ライブラリ
  73. Group: system
  74. Provides: llvm-libs = %{version}-%{release}
  75. Obsoletes: llvm-libs <= 7.0.0
  76. %description -n llvm%{ver_suffix}-libs
  77. Shared libraries for the LLVM compiler infrastructure.
  78. %description -n llvm%{ver_suffix}-libs -l ja
  79. LLVM コンパイラ基盤の共有ライブラリです.
  80. %package static
  81. Summary: LLVM static libraries
  82. Summary(ja): LLVM 静的ライブラリ
  83. Group: programming
  84. Requires: llvm-devel = %{version}-%{release}
  85. %description static
  86. Static libraries for the LLVM compiler infrastructure.
  87. %description static -l ja
  88. LLVM コンパイラ基盤の静的ライブラリです.
  89. # compat32'
  90. %package -n compat32-%{name}%{ver_suffix}-libs
  91. Summary: LLVM shared libraries
  92. Summary(ja): LLVM 共有ライブラリ
  93. Group: system
  94. Provides: compat32-llvm-libs = %{version}-%{release}
  95. Requires: %{name}%{ver_suffix}-libs = %{version}-%{release}
  96. %description -n compat32-%{name}%{ver_suffix}-libs
  97. Shared libraries for the LLVM compiler infrastructure.
  98. %debug_package
  99. %prep
  100. %setup -q -n llvm-%{version}.src
  101. %autopatch -p2
  102. pathfix%{python3_version}.py -i %{__python3} -pn \
  103. test/BugPoint/compile-custom.ll.py \
  104. tools/opt-viewer/*.py \
  105. utils/update_cc_test_checks.py
  106. %build
  107. %global _lto_cflags %{nil}
  108. %ifarch s390 s390x %{arm} %ix86
  109. # Decrease debuginfo verbosity to reduce memory consumption during final library linking
  110. %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
  111. %endif
  112. %cmake \
  113. -GNinja \
  114. -DBUILD_SHARED_LIBS:BOOL=OFF \
  115. -DLLVM_PARALLEL_LINK_JOBS=1 \
  116. -DCMAKE_BUILD_TYPE=Release \
  117. -DCMAKE_SKIP_RPATH:BOOL=ON \
  118. %if 0%{?__isa_bits} == 64
  119. -DLLVM_LIBDIR_SUFFIX=64 \
  120. %else
  121. -DLLVM_LIBDIR_SUFFIX= \
  122. %endif
  123. \
  124. -DLLVM_TARGETS_TO_BUILD=all \
  125. -DLLVM_ENABLE_LIBCXX:BOOL=OFF \
  126. -DLLVM_ENABLE_ZLIB:BOOL=ON \
  127. -DLLVM_ENABLE_FFI:BOOL=ON \
  128. -DLLVM_ENABLE_RTTI:BOOL=ON \
  129. -DLLVM_USE_PERF:BOOL=ON \
  130. -DLLVM_BINUTILS_INCDIR=%{_includedir} \
  131. \
  132. -DLLVM_BUILD_RUNTIME:BOOL=ON \
  133. \
  134. -DLLVM_INCLUDE_TOOLS:BOOL=ON \
  135. -DLLVM_BUILD_TOOLS:BOOL=ON \
  136. \
  137. -DLLVM_INCLUDE_TESTS:BOOL=ON \
  138. -DLLVM_BUILD_TESTS:BOOL=ON \
  139. \
  140. -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
  141. -DLLVM_BUILD_EXAMPLES:BOOL=OFF \
  142. \
  143. -DLLVM_INCLUDE_BENCHMARKS=OFF \
  144. \
  145. -DLLVM_INCLUDE_UTILS:BOOL=ON \
  146. -DLLVM_INSTALL_UTILS:BOOL=ON \
  147. -DLLVM_UTILS_INSTALL_DIR:PATH=%{_bindir} \
  148. -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \
  149. \
  150. -DLLVM_INCLUDE_DOCS:BOOL=ON \
  151. -DLLVM_ENABLE_SPHINX:BOOL=OFF \
  152. %if %{with doxygen}
  153. -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
  154. %else
  155. -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
  156. %endif
  157. -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
  158. -DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
  159. -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
  160. -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
  161. -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
  162. \
  163. -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
  164. # Build libLLVM.so first. This ensures that when libLLVM.so is linking, there
  165. # are no other compile jobs running. This will help reduce OOM errors on the
  166. # builders without having to artificially limit the number of concurrent jobs.
  167. %cmake_build --target LLVM
  168. %cmake_build
  169. %install
  170. rm -rf %{buildroot}
  171. %cmake_install
  172. pushd %{_vpath_builddir}
  173. #install -m755 ./bin/lli-child-target %{buildroot}%{_bindir}/lli-child-target
  174. # fix multi-lib
  175. mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  176. ln -sf llvm-config-%{__isa_bits} %{buildroot}%{_bindir}/llvm-config
  177. mv -v %{buildroot}%{_includedir}/llvm/Config/llvm-config{,-%{__isa_bits}}.h
  178. install -m 0644 %{SOURCE10} %{buildroot}%{_includedir}/llvm/Config/llvm-config.h
  179. # Add symlink to lto plugin in the binutils plugin directory.
  180. %{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/
  181. ln -s ../LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/LLVMgold.so
  182. popd
  183. %if %{with test}
  184. %check
  185. ninja -C build check
  186. %endif
  187. %clean
  188. rm -rf %{buildroot}
  189. %posttrans devel
  190. # link llvm-config to the platform-specific file;
  191. # use ISA bits as priority so that 64-bit is preferred
  192. # over 32-bit if both are installed
  193. alternatives \
  194. --install \
  195. %{_bindir}/llvm-config \
  196. llvm-config \
  197. %{_bindir}/llvm-config-%{__isa_bits} \
  198. %{__isa_bits}
  199. %postun devel
  200. if [ $1 -eq 0 ]; then
  201. alternatives --remove llvm-config \
  202. %{_bindir}/llvm-config-%{__isa_bits}
  203. fi
  204. exit 0
  205. %files
  206. %defattr(-,root,root,-)
  207. %doc CREDITS.TXT README.txt
  208. %{_bindir}/*
  209. %exclude %{_bindir}/llvm-config
  210. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  211. %doc %{_mandir}/man1/*
  212. %{_datadir}/opt-viewer
  213. %files -n llvm%{ver_suffix}-libs
  214. %defattr(-,root,root,-)
  215. %license LICENSE.TXT
  216. %{_libdir}/libLLVM-*.so
  217. %{_libdir}/libLTO.so.*
  218. %{_libdir}/libRemarks.so.*
  219. %files devel
  220. %defattr(-,root,root,-)
  221. %{_bindir}/llvm-config
  222. %{_bindir}/llvm-config-%{__isa_bits}
  223. %{_includedir}/%{name}
  224. %{_includedir}/%{name}-c
  225. %{_libdir}/libLLVM.so
  226. %{_libdir}/libLTO.so
  227. %{_libdir}/libRemarks.so
  228. %{_libdir}/LLVMgold.so
  229. %{_libdir}/bfd-plugins/LLVMgold.so
  230. %{_libdir}/cmake/llvm
  231. %files static
  232. %{_libdir}/*.a
  233. %files doc
  234. %defattr(-,root,root,-)
  235. %doc docs/*
  236. %if %{build_compat32}
  237. %files -n compat32-%{name}%{ver_suffix}-libs
  238. %defattr(-,root,root)
  239. %license LICENSE.TXT
  240. %{_libdir}/libLLVM-*.so
  241. %{_libdir}/libRemarks.so.*
  242. %endif
  243. %changelog
  244. * Wed Jun 15 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 14.0.5-1
  245. - new upstream release.
  246. * Thu Feb 03 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 13.0.1-1
  247. - new upstream release.
  248. * Fri Oct 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 13.0.0-1
  249. - new upstream release.
  250. - dropped Patch0.
  251. * Wed Aug 11 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.0.1-1
  252. - new upstream release.
  253. * Sat Apr 17 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.0.0-1
  254. - new upstream release.
  255. - separated into some packages.
  256. * Fri Oct 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-2
  257. - enabled to build utils.
  258. * Thu Oct 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-1
  259. - new upstream release.
  260. * Mon Aug 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.1-1
  261. - new upstream release.
  262. * Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-2
  263. - rebuilt with libffi-3.3.
  264. * Fri Mar 27 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-1
  265. - new upstream release.
  266. * Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
  267. - new upstream release.
  268. * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-2
  269. - dropped all patches.
  270. - switched build-system to ninja.
  271. - switched python to python3.
  272. * Fri Sep 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-1
  273. - new upstream release.
  274. - added OpenMP.
  275. * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
  276. - fixed %%files.
  277. * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
  278. - new upstream release.
  279. - dropped Patch0, 4, 5, 100 and 200.
  280. - imported Patch3, 7, 12, 15, 100, 101, 102 and 400 from rawhide.
  281. - renamed a subpackage "llvm-libs".
  282. - added a subpackage "lld".
  283. * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
  284. - added subpackages "llvm-static", "python-lldb" and "python-clang".
  285. * Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  286. - new upstream release.
  287. - dropped Patch1 and 2: fixed in upstream.
  288. - imported Patch0, 3-5, 100 and 200 from rawhide.
  289. - disabled Patch1002: no longer needed?
  290. * Fri Aug 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  291. - new upstream release.
  292. - switched to cmake.
  293. - disable ocaml binding as default.
  294. - updated Patch1000 and 1002.
  295. - disabled Patch1000 as default.
  296. - cleanup patches.
  297. * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-2
  298. - rebuild with gcc-5.4.0
  299. * Sat Sep 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.2-1
  300. - new upstream release
  301. - added BR: ocaml-ctypes
  302. * Thu Jun 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
  303. - new upstream release
  304. - dropt Patch 1, 201 and 1001
  305. - updated Patch 1000
  306. * Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.5.1-1
  307. - updated to 3.5.1
  308. - added Patch1, 2, 100, 101, 200, 201 and 202 from Fedora
  309. - added clang-libs, lldb, lldb-devel and compat32-llvm-libs subpackage
  310. - obsoleted clang-doc
  311. - built with ocaml 4.02.1
  312. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  313. - fix <BTS:2832>
  314. - fix configure option "--with-c-include-dirs"
  315. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  316. - update Patch1001: clang-3.5.0-driver-lib64.patch
  317. - update Patch1002: clang-3.5.0-driver-vine.patch
  318. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  319. - update to 3.5.0
  320. - remove Patch11 (clang-hardfloat-hack.patch)
  321. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  322. - rebuild with libffi-3.0.13
  323. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  324. - update to 3.3
  325. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  326. - ld.gold (patch1000,1001)
  327. - add /%{_lib} to ld search path
  328. - add support *-vine-linux gcc (patch1002)
  329. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  330. - update to 3.1
  331. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  332. - updated to 3.0 release
  333. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  334. - added patch 2-4 to support -O4 link-time optimization
  335. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  336. - disable -fno-var-tracking-assignments on ppc
  337. (seems like gcc-4.4.5 still doesn't support this)
  338. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  339. - new upstream release
  340. - add BR: libffi-devel
  341. - add R: libffi-devel to -devel
  342. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  343. - initial build for Vine Linux
  344. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  345. - Update to final 2.7 release
  346. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  347. - Update to first 2.7 pre-release
  348. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  349. - Update to 2.6 pre-release2
  350. - -devel subpackage now virtually provides -static
  351. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  352. - Disable var tracking assignments on PPC
  353. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  354. - Don't adjust clang include dir; files there are noarch (bz#521893)
  355. - Enable clang unit tests
  356. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  357. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  358. - Package Clang's static analyzer tools
  359. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  360. - PIC is now enabled by default; explicitly disable on %%{ix86}
  361. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  362. - First 2.6 prerelease
  363. - Enable Clang front-end
  364. - Enable debuginfo generation
  365. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  366. - Disable assertions (needed by OpenGTL, bz#521261)
  367. - Align spec file with upstream build instructions
  368. - Enable unit tests
  369. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  370. - Only disable PIC on %%ix86; ppc actually needs it
  371. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  372. - Disable use of position-independent code on 32-bit platforms
  373. (buggy in LLVM <= 2.5)
  374. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  375. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  376. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  377. - Remove build scripts; they require the build directory to work
  378. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  379. - Update to 2.5
  380. - Package build scripts (bug #457881)
  381. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  382. - Patched build process for the OCaml binding
  383. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  384. - Update to 2.4
  385. - Package Ocaml binding
  386. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  387. - Add dependency on groff
  388. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  389. - LLVM 2.3
  390. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  391. - fix license tags
  392. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  393. - Fix compilation problems with gcc 4.3
  394. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  395. - Autorebuild for GCC 4.3
  396. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  397. - Fix review comments
  398. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  399. - Initial version