llvm-vl.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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.0
  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. * Fri Oct 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 13.0.0-1
  243. - new upstream release.
  244. - dropped Patch0.
  245. * Wed Aug 11 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.0.1-1
  246. - new upstream release.
  247. * Sat Apr 17 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 12.0.0-1
  248. - new upstream release.
  249. - separated into some packages.
  250. * Fri Oct 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-2
  251. - enabled to build utils.
  252. * Thu Oct 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-1
  253. - new upstream release.
  254. * Mon Aug 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.1-1
  255. - new upstream release.
  256. * Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-2
  257. - rebuilt with libffi-3.3.
  258. * Fri Mar 27 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-1
  259. - new upstream release.
  260. * Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
  261. - new upstream release.
  262. * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-2
  263. - dropped all patches.
  264. - switched build-system to ninja.
  265. - switched python to python3.
  266. * Fri Sep 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-1
  267. - new upstream release.
  268. - added OpenMP.
  269. * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
  270. - fixed %%files.
  271. * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
  272. - new upstream release.
  273. - dropped Patch0, 4, 5, 100 and 200.
  274. - imported Patch3, 7, 12, 15, 100, 101, 102 and 400 from rawhide.
  275. - renamed a subpackage "llvm-libs".
  276. - added a subpackage "lld".
  277. * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
  278. - added subpackages "llvm-static", "python-lldb" and "python-clang".
  279. * Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  280. - new upstream release.
  281. - dropped Patch1 and 2: fixed in upstream.
  282. - imported Patch0, 3-5, 100 and 200 from rawhide.
  283. - disabled Patch1002: no longer needed?
  284. * Fri Aug 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  285. - new upstream release.
  286. - switched to cmake.
  287. - disable ocaml binding as default.
  288. - updated Patch1000 and 1002.
  289. - disabled Patch1000 as default.
  290. - cleanup patches.
  291. * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-2
  292. - rebuild with gcc-5.4.0
  293. * Sat Sep 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.2-1
  294. - new upstream release
  295. - added BR: ocaml-ctypes
  296. * Thu Jun 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
  297. - new upstream release
  298. - dropt Patch 1, 201 and 1001
  299. - updated Patch 1000
  300. * Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.5.1-1
  301. - updated to 3.5.1
  302. - added Patch1, 2, 100, 101, 200, 201 and 202 from Fedora
  303. - added clang-libs, lldb, lldb-devel and compat32-llvm-libs subpackage
  304. - obsoleted clang-doc
  305. - built with ocaml 4.02.1
  306. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  307. - fix <BTS:2832>
  308. - fix configure option "--with-c-include-dirs"
  309. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  310. - update Patch1001: clang-3.5.0-driver-lib64.patch
  311. - update Patch1002: clang-3.5.0-driver-vine.patch
  312. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  313. - update to 3.5.0
  314. - remove Patch11 (clang-hardfloat-hack.patch)
  315. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  316. - rebuild with libffi-3.0.13
  317. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  318. - update to 3.3
  319. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  320. - ld.gold (patch1000,1001)
  321. - add /%{_lib} to ld search path
  322. - add support *-vine-linux gcc (patch1002)
  323. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  324. - update to 3.1
  325. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  326. - updated to 3.0 release
  327. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  328. - added patch 2-4 to support -O4 link-time optimization
  329. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  330. - disable -fno-var-tracking-assignments on ppc
  331. (seems like gcc-4.4.5 still doesn't support this)
  332. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  333. - new upstream release
  334. - add BR: libffi-devel
  335. - add R: libffi-devel to -devel
  336. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  337. - initial build for Vine Linux
  338. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  339. - Update to final 2.7 release
  340. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  341. - Update to first 2.7 pre-release
  342. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  343. - Update to 2.6 pre-release2
  344. - -devel subpackage now virtually provides -static
  345. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  346. - Disable var tracking assignments on PPC
  347. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  348. - Don't adjust clang include dir; files there are noarch (bz#521893)
  349. - Enable clang unit tests
  350. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  351. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  352. - Package Clang's static analyzer tools
  353. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  354. - PIC is now enabled by default; explicitly disable on %%{ix86}
  355. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  356. - First 2.6 prerelease
  357. - Enable Clang front-end
  358. - Enable debuginfo generation
  359. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  360. - Disable assertions (needed by OpenGTL, bz#521261)
  361. - Align spec file with upstream build instructions
  362. - Enable unit tests
  363. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  364. - Only disable PIC on %%ix86; ppc actually needs it
  365. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  366. - Disable use of position-independent code on 32-bit platforms
  367. (buggy in LLVM <= 2.5)
  368. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  369. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  370. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  371. - Remove build scripts; they require the build directory to work
  372. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  373. - Update to 2.5
  374. - Package build scripts (bug #457881)
  375. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  376. - Patched build process for the OCaml binding
  377. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  378. - Update to 2.4
  379. - Package Ocaml binding
  380. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  381. - Add dependency on groff
  382. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  383. - LLVM 2.3
  384. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  385. - fix license tags
  386. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  387. - Fix compilation problems with gcc 4.3
  388. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  389. - Autorebuild for GCC 4.3
  390. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  391. - Fix review comments
  392. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  393. - Initial version