llvm-vl.spec 15 KB

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