llvm-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  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: 13.0.1
  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_UTILS:BOOL=ON \
  144. -DLLVM_INSTALL_UTILS:BOOL=ON \
  145. -DLLVM_UTILS_INSTALL_DIR:PATH=%{_bindir} \
  146. -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \
  147. \
  148. -DLLVM_INCLUDE_DOCS:BOOL=ON \
  149. -DLLVM_ENABLE_SPHINX:BOOL=OFF \
  150. %if %{with doxygen}
  151. -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
  152. %else
  153. -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
  154. %endif
  155. -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
  156. -DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
  157. -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
  158. -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
  159. -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
  160. \
  161. -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
  162. # Build libLLVM.so first. This ensures that when libLLVM.so is linking, there
  163. # are no other compile jobs running. This will help reduce OOM errors on the
  164. # builders without having to artificially limit the number of concurrent jobs.
  165. %cmake_build --target LLVM
  166. %cmake_build
  167. %install
  168. rm -rf %{buildroot}
  169. %cmake_install
  170. pushd %{_vpath_builddir}
  171. #install -m755 ./bin/lli-child-target %{buildroot}%{_bindir}/lli-child-target
  172. # fix multi-lib
  173. mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  174. ln -sf llvm-config-%{__isa_bits} %{buildroot}%{_bindir}/llvm-config
  175. mv -v %{buildroot}%{_includedir}/llvm/Config/llvm-config{,-%{__isa_bits}}.h
  176. install -m 0644 %{SOURCE10} %{buildroot}%{_includedir}/llvm/Config/llvm-config.h
  177. # Add symlink to lto plugin in the binutils plugin directory.
  178. %{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/
  179. ln -s ../LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/LLVMgold.so
  180. popd
  181. %if %{with test}
  182. %check
  183. ninja -C build check
  184. %endif
  185. %clean
  186. rm -rf %{buildroot}
  187. %posttrans devel
  188. # link llvm-config to the platform-specific file;
  189. # use ISA bits as priority so that 64-bit is preferred
  190. # over 32-bit if both are installed
  191. alternatives \
  192. --install \
  193. %{_bindir}/llvm-config \
  194. llvm-config \
  195. %{_bindir}/llvm-config-%{__isa_bits} \
  196. %{__isa_bits}
  197. %postun devel
  198. if [ $1 -eq 0 ]; then
  199. alternatives --remove llvm-config \
  200. %{_bindir}/llvm-config-%{__isa_bits}
  201. fi
  202. exit 0
  203. %files
  204. %defattr(-,root,root,-)
  205. %doc CREDITS.TXT README.txt
  206. %{_bindir}/*
  207. %exclude %{_bindir}/llvm-config
  208. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  209. %doc %{_mandir}/man1/*
  210. %{_datadir}/opt-viewer
  211. %files -n llvm%{ver_suffix}-libs
  212. %defattr(-,root,root,-)
  213. %license LICENSE.TXT
  214. %{_libdir}/libLLVM-*.so
  215. %{_libdir}/libLTO.so.*
  216. %{_libdir}/libRemarks.so.*
  217. %files devel
  218. %defattr(-,root,root,-)
  219. %{_bindir}/llvm-config
  220. %{_bindir}/llvm-config-%{__isa_bits}
  221. %{_includedir}/%{name}
  222. %{_includedir}/%{name}-c
  223. %{_libdir}/libLLVM.so
  224. %{_libdir}/libLTO.so
  225. %{_libdir}/libRemarks.so
  226. %{_libdir}/LLVMgold.so
  227. %{_libdir}/bfd-plugins/LLVMgold.so
  228. %{_libdir}/cmake/llvm
  229. %files static
  230. %{_libdir}/*.a
  231. %files doc
  232. %defattr(-,root,root,-)
  233. %doc docs/*
  234. %if %{build_compat32}
  235. %files -n compat32-%{name}%{ver_suffix}-libs
  236. %defattr(-,root,root)
  237. %license LICENSE.TXT
  238. %{_libdir}/libLLVM-*.so
  239. %{_libdir}/libRemarks.so.*
  240. %endif
  241. %changelog
  242. * Thu Feb 03 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 13.0.1-1
  243. - new upstream release.
  244. * Fri Oct 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 13.0.0-1
  245. - new upstream release.
  246. - dropped Patch0.
  247. * Wed Aug 11 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.0.1-1
  248. - new upstream release.
  249. * Sat Apr 17 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.0.0-1
  250. - new upstream release.
  251. - separated into some packages.
  252. * Fri Oct 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-2
  253. - enabled to build utils.
  254. * Thu Oct 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-1
  255. - new upstream release.
  256. * Mon Aug 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.1-1
  257. - new upstream release.
  258. * Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-2
  259. - rebuilt with libffi-3.3.
  260. * Fri Mar 27 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-1
  261. - new upstream release.
  262. * Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
  263. - new upstream release.
  264. * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-2
  265. - dropped all patches.
  266. - switched build-system to ninja.
  267. - switched python to python3.
  268. * Fri Sep 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-1
  269. - new upstream release.
  270. - added OpenMP.
  271. * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
  272. - fixed %%files.
  273. * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
  274. - new upstream release.
  275. - dropped Patch0, 4, 5, 100 and 200.
  276. - imported Patch3, 7, 12, 15, 100, 101, 102 and 400 from rawhide.
  277. - renamed a subpackage "llvm-libs".
  278. - added a subpackage "lld".
  279. * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
  280. - added subpackages "llvm-static", "python-lldb" and "python-clang".
  281. * Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  282. - new upstream release.
  283. - dropped Patch1 and 2: fixed in upstream.
  284. - imported Patch0, 3-5, 100 and 200 from rawhide.
  285. - disabled Patch1002: no longer needed?
  286. * Fri Aug 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  287. - new upstream release.
  288. - switched to cmake.
  289. - disable ocaml binding as default.
  290. - updated Patch1000 and 1002.
  291. - disabled Patch1000 as default.
  292. - cleanup patches.
  293. * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-2
  294. - rebuild with gcc-5.4.0
  295. * Sat Sep 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.2-1
  296. - new upstream release
  297. - added BR: ocaml-ctypes
  298. * Thu Jun 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
  299. - new upstream release
  300. - dropt Patch 1, 201 and 1001
  301. - updated Patch 1000
  302. * Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.5.1-1
  303. - updated to 3.5.1
  304. - added Patch1, 2, 100, 101, 200, 201 and 202 from Fedora
  305. - added clang-libs, lldb, lldb-devel and compat32-llvm-libs subpackage
  306. - obsoleted clang-doc
  307. - built with ocaml 4.02.1
  308. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  309. - fix <BTS:2832>
  310. - fix configure option "--with-c-include-dirs"
  311. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  312. - update Patch1001: clang-3.5.0-driver-lib64.patch
  313. - update Patch1002: clang-3.5.0-driver-vine.patch
  314. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  315. - update to 3.5.0
  316. - remove Patch11 (clang-hardfloat-hack.patch)
  317. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  318. - rebuild with libffi-3.0.13
  319. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  320. - update to 3.3
  321. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  322. - ld.gold (patch1000,1001)
  323. - add /%{_lib} to ld search path
  324. - add support *-vine-linux gcc (patch1002)
  325. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  326. - update to 3.1
  327. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  328. - updated to 3.0 release
  329. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  330. - added patch 2-4 to support -O4 link-time optimization
  331. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  332. - disable -fno-var-tracking-assignments on ppc
  333. (seems like gcc-4.4.5 still doesn't support this)
  334. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  335. - new upstream release
  336. - add BR: libffi-devel
  337. - add R: libffi-devel to -devel
  338. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  339. - initial build for Vine Linux
  340. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  341. - Update to final 2.7 release
  342. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  343. - Update to first 2.7 pre-release
  344. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  345. - Update to 2.6 pre-release2
  346. - -devel subpackage now virtually provides -static
  347. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  348. - Disable var tracking assignments on PPC
  349. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  350. - Don't adjust clang include dir; files there are noarch (bz#521893)
  351. - Enable clang unit tests
  352. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  353. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  354. - Package Clang's static analyzer tools
  355. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  356. - PIC is now enabled by default; explicitly disable on %%{ix86}
  357. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  358. - First 2.6 prerelease
  359. - Enable Clang front-end
  360. - Enable debuginfo generation
  361. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  362. - Disable assertions (needed by OpenGTL, bz#521261)
  363. - Align spec file with upstream build instructions
  364. - Enable unit tests
  365. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  366. - Only disable PIC on %%ix86; ppc actually needs it
  367. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  368. - Disable use of position-independent code on 32-bit platforms
  369. (buggy in LLVM <= 2.5)
  370. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  371. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  372. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  373. - Remove build scripts; they require the build directory to work
  374. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  375. - Update to 2.5
  376. - Package build scripts (bug #457881)
  377. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  378. - Patched build process for the OCaml binding
  379. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  380. - Update to 2.4
  381. - Package Ocaml binding
  382. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  383. - Add dependency on groff
  384. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  385. - LLVM 2.3
  386. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  387. - fix license tags
  388. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  389. - Fix compilation problems with gcc 4.3
  390. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  391. - Autorebuild for GCC 4.3
  392. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  393. - Fix review comments
  394. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  395. - Initial version