llvm-vl.spec 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  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. %bcond_with ocaml
  9. %bcond_with force_gold
  10. %bcond_with lld_libs
  11. %bcond_with clang_tools_extra
  12. # Documentation install path
  13. %global llvmdocdir() %{_docdir}/%1-%{version}
  14. %define _unpackaged_files_terminate_build 1
  15. Summary: The Low Level Virtual Machine
  16. Summary(ja): LLVM - 低レベルバーチャルマシン
  17. Name: llvm
  18. Version: 10.0.1
  19. Release: 1%{?_dist_release}
  20. Group: programming
  21. Vendor: Project Vine
  22. Distribution: Vine Linux
  23. License: NCSA
  24. URL: https://llvm.org/
  25. Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz
  26. Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz
  27. Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/compiler-rt-%{version}.src.tar.xz
  28. Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lldb-%{version}.src.tar.xz
  29. Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz
  30. %if %{with clang_tools_extra}
  31. Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-tools-extra-%{version}.src.tar.xz
  32. %endif
  33. Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/openmp-%{version}.src.tar.xz
  34. # multilib fixes
  35. Source10: llvm-config.h
  36. Source11: clang-config.h
  37. # patches
  38. # llvm
  39. Patch0: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
  40. # TODO: I'm not sure why this is needed. Could be a change in newer version
  41. # of gold.
  42. Patch1: 0001-Pass-target-to-gold-linker-to-avoid-faliures-on-i686.patch
  43. Patch2: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
  44. Patch3: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
  45. # clang
  46. Patch100: 0002-gtest-reorg.patch
  47. Patch101: 0001-Fix-uninitialized-value-in-ABIArgInfo.patch
  48. Patch102: 0001-ToolChain-Add-lgcc_s-to-the-linker-flags-when-using-.patch
  49. Patch103: 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch
  50. # compiler-rt
  51. Patch200: 0001-PATCH-std-thread-copy.patch
  52. # lld
  53. Patch400: 0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch
  54. # Vine Patch
  55. Patch1000: clang-3.8.1-driver-ld.gold.patch
  56. Patch1002: clang-3.8.1-driver-vine.patch
  57. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  58. BuildRequires: binutils-devel
  59. BuildRequires: cmake
  60. BuildRequires: ninja
  61. BuildRequires: bison
  62. BuildRequires: python3
  63. BuildRequires: python3-rpm-macros
  64. BuildRequires: chrpath
  65. BuildRequires: flex
  66. BuildRequires: git
  67. BuildRequires: gcc-c++ >= 3.4
  68. BuildRequires: groff
  69. BuildRequires: libffi-devel >= 3.3
  70. BuildRequires: libstdc++-devel
  71. BuildRequires: libstdc++-static
  72. BuildRequires: libtool-ltdl-devel
  73. BuildRequires: libxml2-devel
  74. %if %{with ocaml}
  75. BuildRequires: ocaml-findlib
  76. BuildRequires: ocaml-ctypes
  77. BuildRequires: ocaml-ounit
  78. %endif
  79. # for DejaGNU test suite
  80. BuildRequires: dejagnu tcl-devel
  81. %if %{with doxygen}
  82. BuildRequires: doxygen graphviz
  83. %endif
  84. # pod2man
  85. BuildRequires: perl
  86. # lldb
  87. BuildRequires: swig
  88. BuildRequires: libedit-devel
  89. BuildRequires: python3-devel
  90. # lld
  91. BuildRequires: ncurses-devel
  92. BuildRequires: zlib-devel
  93. Requires: llvm%{ver_suffix}-libs = %{version}-%{release}
  94. # LLVM is not supported on PPC64
  95. # http://llvm.org/bugs/show_bug.cgi?id=3729
  96. ExcludeArch: ppc64
  97. %description
  98. LLVM is a compiler infrastructure designed for compile-time,
  99. link-time, runtime, and idle-time optimization of programs from
  100. arbitrary programming languages. The compiler infrastructure includes
  101. mirror sets of programming tools as well as libraries with equivalent
  102. functionality.
  103. %package devel
  104. Summary: Libraries and header files for LLVM
  105. Summary(ja): LLVM のライブラリおよびヘッダファイル
  106. Group: programming
  107. Requires: %{name} = %{version}-%{release}
  108. Requires: libstdc++-devel
  109. Requires: libffi-devel
  110. Requires: libedit-devel
  111. %description devel
  112. This package contains library and header files needed to develop new
  113. native programs that use the LLVM infrastructure.
  114. %package doc
  115. Summary: Documentation for LLVM
  116. Summary(ja): LLVM のドキュメント
  117. Group: documentation
  118. BuildArch: noarch
  119. Requires: %{name} = %{version}-%{release}
  120. # might seem redundant, but needed to kill off the old arch-ed -doc subpackage
  121. Obsoletes: %{name}-doc < %{version}-%{release}
  122. %description doc
  123. Documentation for the LLVM compiler infrastructure.
  124. %package -n llvm%{ver_suffix}-libs
  125. Summary: LLVM shared libraries
  126. Summary(ja): LLVM 共有ライブラリ
  127. Group: system
  128. Provides: llvm-libs = %{version}-%{release}
  129. Obsoletes: llvm-libs <= 7.0.0
  130. %description -n llvm%{ver_suffix}-libs
  131. Shared libraries for the LLVM compiler infrastructure.
  132. %description -n llvm%{ver_suffix}-libs -l ja
  133. LLVM コンパイラ基盤の共有ライブラリです.
  134. %package static
  135. Summary: LLVM static libraries
  136. Summary(ja): LLVM 静的ライブラリ
  137. Group: programming
  138. Requires: llvm-devel = %{version}-%{release}
  139. %description static
  140. Static libraries for the LLVM compiler infrastructure.
  141. %description static -l ja
  142. LLVM コンパイラ基盤の静的ライブラリです.
  143. %package -n clang
  144. Summary: A C language family front-end for LLVM
  145. Summary(ja): LLVM の C 言語フロントエンド
  146. License: NCSA
  147. Group: programming
  148. Requires: %{name} = %{version}-%{release}
  149. # clang requires gcc, clang++ requires libstdc++-devel
  150. Requires: libstdc++-devel
  151. # remove clang-doc pacakge
  152. Obsoletes: clang-doc < %{version}-%{release}
  153. %description -n clang
  154. clang: noun
  155. 1. A loud, resonant, metallic sound.
  156. 2. The strident call of a crane or goose.
  157. 3. C-language family front-end toolkit.
  158. The goal of the Clang project is to create a new C, C++, Objective C
  159. and Objective C++ front-end for the LLVM compiler. Its tools are built
  160. as libraries and designed to be loosely-coupled and extensible.
  161. %Package -n clang-libs
  162. Summary: Runtime library for clang
  163. Summary(ja): Clang のランタイムライブラリ
  164. Group: system
  165. %description -n clang-libs
  166. Runtime library for clang.
  167. %description -n clang-libs -l ja
  168. Clang のランタイムライブラリです.
  169. %package -n clang-devel
  170. Summary: Header files for clang
  171. Summary(ja): Clang のヘッダファイル
  172. Group: programming
  173. Requires: clang = %{version}-%{release}
  174. %description -n clang-devel
  175. This package contains header files for the Clang compiler.
  176. %description -n clang-devel -l ja
  177. Clang コンパイラのヘッダファイル集です.
  178. %package -n clang-analyzer
  179. Summary: A source code analysis framework
  180. Summary(ja): ソースコード分析フレームワーク
  181. License: NCSA
  182. Group: programming
  183. Requires: clang = %{version}-%{release}
  184. # not picked up automatically since files are currently not instaled
  185. # in standard Python hierarchies yet
  186. Requires: python3
  187. %description -n clang-analyzer
  188. The Clang Static Analyzer consists of both a source code analysis
  189. framework and a standalone tool that finds bugs in C and Objective-C
  190. programs. The standalone tool is invoked from the command-line, and is
  191. intended to run in tandem with a build of a project or code base.
  192. %package -n python3-clang
  193. Summary: Python3 bindings for clang
  194. Group: programming
  195. Requires: %{name}%{ver_suffix}-libs%{?_isa} = %{version}-%{release}
  196. Requires: python3
  197. %description -n python3-clang
  198. Python3 bindings for clang
  199. #%package -n clang-doc
  200. #Summary: Documentation for Clang
  201. #Summary(ja): Clang のドキュメント
  202. #Group: Documentation
  203. #Requires: %{name} = %{version}-%{release}
  204. #
  205. #%description -n clang-doc
  206. #Documentation for the Clang compiler front-end.
  207. %package -n lldb
  208. Summary: Next generation high-performance debugger
  209. Summary(ja): 高性能デバッガー
  210. License: NCSA
  211. Group: programming
  212. Requires: %{name} = %{version}-%{release}
  213. %description -n lldb
  214. LLDB is a next generation, high-performance debugger. It is built as a set
  215. of reusable components which highly leverage existing libraries in the
  216. larger LLVM Project, such as the Clang expression parser and LLVM
  217. disassembler.
  218. %package -n lldb-devel
  219. Summary: Header files for LLDB
  220. Summary(ja): LLDB のヘッダファイル
  221. Group: programming
  222. Requires: lldb = %{version}-%{release}
  223. %description -n lldb-devel
  224. This package contains header files for the LLDB debugger.
  225. %package -n lld
  226. Summary: The LLVM Linker
  227. Summary(ja): LLVMリンカー
  228. License: NCSA
  229. Group: programming
  230. %description -n lld
  231. The LLVM project linker.
  232. %if %{with lld_libs}
  233. %package -n lld-libs
  234. Summary: LLD shared libraries
  235. Summary(ja): LLD 共有ライブラリ
  236. License: NCSA
  237. Group: programming
  238. %description -n lld-libs
  239. Shared libraries for LLD.
  240. %package -n lld-devel
  241. Summary: Libraries and header files for LLD
  242. Summary(ja): LLD 用ライブラリとヘッダファイル
  243. License: NCSA
  244. Group: programming
  245. Requires: lld-libs = %{version}-%{release}
  246. %description -n lld-devel
  247. This package contains library and header files needed to develop new native
  248. programs that use the LLD infrastructure.
  249. %endif
  250. %if %{with doxygen}
  251. %package apidoc
  252. Summary: API documentation for LLVM
  253. Summary(ja): LLVM の API ドキュメント
  254. Group: documentation
  255. BuildArch: noarch
  256. Requires: %{name}-docs = %{version}-%{release}
  257. %description apidoc
  258. API documentation for the LLVM compiler infrastructure.
  259. %package -n clang-apidoc
  260. Summary: API documentation for Clang
  261. Summary(ja): Clang の API ドキュメント
  262. Group: Documentation
  263. BuildArch: noarch
  264. %description -n clang-apidoc
  265. API documentation for the Clang compiler.
  266. %endif
  267. %package -n python3-lldb
  268. Summary: Python3 module for LLDB
  269. Summary(ja): LLDB用Python3モジュール
  270. Group: programming
  271. BuildRequires: python-devel
  272. Requires: python-six
  273. %description -n python3-lldb
  274. The package contains the LLDB Python3 module.
  275. %package -n libomp
  276. Summary: OpenMP runtime for clang
  277. Summary(ja): clang用OpenMPランタイム
  278. Group: system
  279. %description -n libomp
  280. The package contains the OpenMP runtime for clang.
  281. %package -n libomp-devel
  282. Summary: OpenMP header files
  283. Summary(ja): OpenMPヘッダファイル
  284. Group: programming
  285. Requires: clang-devel%{?isa} = %{version}
  286. %description -n libomp-devel
  287. The package contains the OpenMP header files.
  288. %if %{with ocaml}
  289. %package ocaml
  290. Summary: OCaml binding for LLVM
  291. Summary(ja): LLVM の OCaml バインディング
  292. Group: system
  293. Requires: %{name} = %{version}-%{release}
  294. Requires: ocaml
  295. %description ocaml
  296. OCaml binding for LLVM.
  297. %package ocaml-devel
  298. Summary: Development files for %{name}-ocaml
  299. Summary(ja): %{name}-ocaml の開発ファイル
  300. Group: programming
  301. Requires: %{name}-devel = %{version}-%{release}
  302. Requires: %{name}-ocaml = %{version}-%{release}
  303. Requires: ocaml
  304. %description ocaml-devel
  305. The %{name}-ocaml-devel package contains libraries and signature files
  306. for developing applications that use %{name}-ocaml.
  307. %package ocaml-doc
  308. Summary: Documentation for %{name}-ocaml
  309. Summary(ja): %{name}-ocaml のドキュメント
  310. Group: documentation
  311. BuildArch: noarch
  312. Requires: %{name}-ocaml = %{version}-%{release}
  313. # might seem redundant, but needed to kill off the old arch-ed -doc subpackage
  314. Obsoletes: %{name}-ocaml-doc < %{version}-%{release}
  315. %description ocaml-doc
  316. HTML documentation for LLVM's OCaml binding.
  317. %endif
  318. # compat32'
  319. %package -n compat32-%{name}%{ver_suffix}-libs
  320. Summary: LLVM shared libraries
  321. Summary(ja): LLVM 共有ライブラリ
  322. Group: system
  323. Provides: compat32-llvm-libs = %{version}-%{release}
  324. Requires: %{name}%{ver_suffix}-libs = %{version}-%{release}
  325. %description -n compat32-%{name}%{ver_suffix}-libs
  326. Shared libraries for the LLVM compiler infrastructure.
  327. %prep
  328. %setup -q -a1 -a2 -a3 -a4 -a6 -n llvm-%{version}.src
  329. #%patch0 -p2
  330. #%patch1 -p2
  331. #%patch2 -p2
  332. ##patch3 -p2
  333. rm -rf tools/clang tools/lld tools/lldb projects/compiler-rt
  334. mv clang-%{version}.src tools/clang
  335. mv compiler-rt-%{version}.src projects/compiler-rt
  336. mv lldb-%{version}.src tools/lldb
  337. mv lld-%{version}.src tools/lld
  338. mv openmp-%{version}.src projects/openmp
  339. %if %{with clang_tools_extra}
  340. tar xvf %{SOURCE5}
  341. mv clang-tools-extra-%{version}.src tools/clang/tools/extra
  342. %endif
  343. pushd tools/clang
  344. ##patch100 -p1
  345. #%patch101 -p2
  346. #%patch102 -p1
  347. #%patch103 -p2
  348. popd
  349. pushd projects/compiler-rt
  350. #%patch200 -p1
  351. popd
  352. pushd tools/lld
  353. #%patch400 -p1
  354. popd
  355. # Vine Linux
  356. %if %{with force_gold}
  357. pushd tools/clang
  358. %patch1000 -p1 -b .driver-ld.gold
  359. popd
  360. %endif
  361. #%patch1002 -p1 -b .driver-vine
  362. sed -i -e 's/"i686-linux-gnu",/"i686-linux-gnu","i686-vine-linux","i686-vine-linux-gnu",/' tools/clang/lib/Driver/ToolChains/Gnu.cpp
  363. sed -i -e 's/"x86_64-linux-gnu",/"x86_64-linux-gnu","x86_64-vine-linux","x86_64-vine-linux-gnu",/' tools/clang/lib/Driver/ToolChains/Gnu.cpp
  364. sed -i -e 's/"ld"/"ld.gold"/' tools/clang/include/clang/Driver/ToolChain.h
  365. %build
  366. mkdir build
  367. cd build
  368. %ifarch s390 s390x %{arm} %ix86
  369. # Decrease debuginfo verbosity to reduce memory consumption during final library linking
  370. %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
  371. %endif
  372. #CFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fPIC"
  373. #CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fPIC -std=c++11"
  374. #TMP_PWD=$(pwd)
  375. #LDFLAGS="%{?__global_ldflags} -L$TMP_PWD/%{_lib} -lpthread -ldl"
  376. %cmake .. \
  377. -GNinja \
  378. -DBUILD_SHARED_LIBS:BOOL=OFF \
  379. -DLLVM_PARALLEL_LINK_JOBS=1 \
  380. -DCMAKE_BUILD_TYPE=Release \
  381. -DCMAKE_INSTALL_RPATH=";" \
  382. %if 0%{?__isa_bits} == 64
  383. -DLLVM_LIBDIR_SUFFIX=64 \
  384. %else
  385. -DLLVM_LIBDIR_SUFFIX= \
  386. %endif
  387. -DLLVM_TARGETS_TO_BUILD=all \
  388. -DLLVM_ENABLE_LIBCXX:BOOL=OFF \
  389. -DLLVM_ENABLE_ZLIB:BOOL=ON \
  390. -DLLVM_ENABLE_FFI:BOOL=ON \
  391. -DLLVM_ENABLE_RTTI:BOOL=ON \
  392. -DLLVM_ENABLE_EH=ON \
  393. -DLLVM_BINUTILS_INCDIR=%{_includedir} \
  394. -DLLVM_BUILD_RUNTIME:BOOL=ON \
  395. -DLLVM_INCLUDE_TOOLS:BOOL=ON \
  396. -DLLVM_BUILD_TOOLS:BOOL=ON \
  397. -DLLVM_INCLUDE_TESTS:BOOL=ON \
  398. -DLLVM_BUILD_TESTS:BOOL=ON \
  399. -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
  400. -DLLVM_BUILD_EXAMPLES:BOOL=OFF \
  401. -DLLVM_INCLUDE_UTILS:BOOL=ON \
  402. -DLLVM_INSTALL_UTILS:BOOL=OFF \
  403. -DLLVM_INCLUDE_DOCS:BOOL=ON \
  404. -DLLVM_ENABLE_SPHINX:BOOL=OFF \
  405. %if %{with doxygen}
  406. -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
  407. %else
  408. -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
  409. %endif
  410. -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
  411. -DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
  412. -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
  413. -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
  414. -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
  415. \
  416. -DCLANG_ENABLE_ARCMT:BOOL=ON \
  417. -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
  418. -DCLANG_INCLUDE_DOCS:BOOL=ON \
  419. -DCLANG_INCLUDE_TESTS:BOOL=ON \
  420. -DCLANG_PLUGIN_SUPPORT:BOOL=ON \
  421. -DCLANG_BUILD_EXAMPLES:BOOL=OFF \
  422. -DCLANG_LINK_CLANG_DYLIB=ON \
  423. -DCLANG_REPOSITORY_STRING="Vine Linux %{version}-%{release}" \
  424. -DLIB_SUFFIX= \
  425. \
  426. -DLLDB_DISABLE_CURSES:BOOL=OFF \
  427. -DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
  428. -DLLDB_DISABLE_PYTHON:BOOL=OFF \
  429. \
  430. -DLLDB_LINK_LLVM_DYLIB:BOOL=ON \
  431. \
  432. -DLIBOMP_INSTALL_ALIASES=OFF \
  433. -DLIBOMP_HEADERS_INSTALL_PATH:PATH=%{_libdir}/clang/%{version}/include \
  434. \
  435. -DPYTHON_EXECUTABLE:STRING=%{__python3} \
  436. -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on?
  437. # workaround for all-in-one build
  438. #TMP_PWD=$(pwd)
  439. #LD_LIBRARY_PATH="$TMP_PWD/%{_lib}" make %{?_smp_mflags}
  440. %ninja_build
  441. %install
  442. rm -rf %{buildroot}
  443. cd build
  444. %ninja_install
  445. # llvm
  446. install -m755 ./bin/lli-child-target %{buildroot}%{_bindir}/lli-child-target
  447. # fix multi-lib
  448. mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  449. ln -sf llvm-config-%{__isa_bits} %{buildroot}%{_bindir}/llvm-config
  450. mv -v %{buildroot}%{_includedir}/llvm/Config/llvm-config{,-%{__isa_bits}}.h
  451. install -m 0644 %{SOURCE10} %{buildroot}%{_includedir}/llvm/Config/llvm-config.h
  452. # clang
  453. # remove static libraries
  454. rm -fv %{buildroot}%{_libdir}/libclang*.a
  455. # install clang python bindings
  456. mkdir -p %{buildroot}%{python3_sitelib}/clang/
  457. install -p -m644 ../tools/clang/bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/
  458. mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
  459. install -m 0644 %{SOURCE11} %{buildroot}%{_includedir}/clang/Config/config.h
  460. # remove git integration
  461. rm -vf %{buildroot}%{_bindir}/git-clang-format
  462. # remove editor integrations (bbedit, sublime, emacs, vim)
  463. rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
  464. rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
  465. rm -vf %{buildroot}%{_datadir}/clang/clang-format.el
  466. rm -vf %{buildroot}%{_datadir}/clang/clang-format.py*
  467. # remove diff reformatter
  468. rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
  469. # lldb
  470. # remove static libraries
  471. rm -fv %{buildroot}%{_libdir}/liblldb*.a
  472. # python: fix binary libraries location
  473. liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so))
  474. ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so
  475. # remove bundled six.py
  476. rm -f %{buildroot}%{python3_sitearch}/six.*
  477. # lld
  478. # remove static libraries
  479. rm -fv %{buildroot}%{_libdir}/liblld*.a
  480. # Remove rpath
  481. chrpath --delete %{buildroot}%{_bindir}/*lld
  482. chrpath --delete %{buildroot}%{_bindir}/lld-link
  483. chrpath --delete %{buildroot}%{_bindir}/wasm-ld
  484. find %{buildroot}%{_libdir} -type f -name 'liblld*.so*' | \
  485. grep -v 'liblldb' | \
  486. xargs chrpath --delete
  487. %if !%{with lld_libs}
  488. rm -rf %{buildroot}%{_includedir}/lld
  489. %endif
  490. # compiler-rt
  491. # move sanitizer lists to better place
  492. mkdir -p %{buildroot}%{_libdir}/clang/%{version}
  493. for file in asan_blacklist.txt msan_blacklist.txt dfsan_blacklist.txt cfi_blacklist.txt dfsan_abilist.txt; do
  494. mv -v %{buildroot}%{_prefix}/${file} %{buildroot}%{_libdir}/clang/%{version}/ || :
  495. done
  496. # move sanitizer libs to better place
  497. #mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib
  498. #mv -v %{buildroot}%{_prefix}/lib/linux/libclang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib
  499. #mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/
  500. #pushd %{buildroot}%{_libdir}/clang/%{version}/lib
  501. #for i in *.a *.syms *.so; do
  502. # ln -s ../$i linux/$i
  503. #done
  504. #rm -rf %{buildroot}%{_libdir}/python*
  505. rm -f %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
  506. rm -f %{buildroot}%{_datadir}/clang/clang-rename.el
  507. rm -f %{buildroot}%{_datadir}/clang/clang-rename.py
  508. %if %{with test}
  509. %check
  510. ninja -C build check
  511. ninja -C build check-clang
  512. ninja -C build check-lldb
  513. ninja -C build check-lld
  514. %endif
  515. %clean
  516. rm -rf %{buildroot}
  517. %post -n llvm%{ver_suffix}-libs -p /sbin/ldconfig
  518. %postun -n llvm%{ver_suffix}-libs -p /sbin/ldconfig
  519. %post -n clang-libs -p /sbin/ldconfig
  520. %postun -n clang-libs -p /sbin/ldconfig
  521. %post -n lldb -p /sbin/ldconfig
  522. %postun -n lldb -p /sbin/ldconfig
  523. %post -n lld
  524. /sbin/alternatives --install /usr/bin/ld ld \
  525. /usr/bin/ld.lld 20
  526. %preun -n lld
  527. if [ $1 = 0 ]; then
  528. /sbin/alternatives --remove ld /usr/bin/ld.lld
  529. fi
  530. %if %{with lld_libs}
  531. %post -n lld-libs -p /sbin/ldconfig
  532. %postun -n lld-libs -p /sbin/ldconfig
  533. %endif
  534. %posttrans devel
  535. # link llvm-config to the platform-specific file;
  536. # use ISA bits as priority so that 64-bit is preferred
  537. # over 32-bit if both are installed
  538. alternatives \
  539. --install \
  540. %{_bindir}/llvm-config \
  541. llvm-config \
  542. %{_bindir}/llvm-config-%{__isa_bits} \
  543. %{__isa_bits}
  544. %postun devel
  545. if [ $1 -eq 0 ]; then
  546. alternatives --remove llvm-config \
  547. %{_bindir}/llvm-config-%{__isa_bits}
  548. fi
  549. exit 0
  550. %files
  551. %defattr(-,root,root,-)
  552. %doc CREDITS.TXT README.txt
  553. %{_bindir}/bugpoint
  554. %{_bindir}/dsymutil
  555. %{_bindir}/llc
  556. %{_bindir}/lli
  557. %{_bindir}/lli-child-target
  558. %{_bindir}/obj2yaml
  559. %{_bindir}/sancov
  560. %{_bindir}/sanstats
  561. %{_bindir}/verify-uselistorder
  562. %{_bindir}/yaml2obj
  563. %exclude %{_bindir}/llvm-config
  564. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  565. %{_bindir}/llvm*
  566. %{_bindir}/opt
  567. %exclude %{_mandir}/man1/scan-build.1.*
  568. %doc %{_mandir}/man1/*.1.*
  569. %{_datadir}/opt-viewer
  570. %files devel
  571. %defattr(-,root,root,-)
  572. #doc %{llvmdocdir %{name}-devel}/
  573. %{_bindir}/llvm-config
  574. %{_bindir}/llvm-config-%{__isa_bits}
  575. %{_includedir}/%{name}
  576. %{_includedir}/%{name}-c
  577. #{_libdir}/BugpointPasses.so
  578. %{_libdir}/libLLVM.so
  579. %{_libdir}/libLTO.so*
  580. %{_libdir}/libRemarks.so
  581. %{_libdir}/LLVMgold.so
  582. %{_libdir}/cmake/llvm
  583. #exclude %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
  584. %files -n llvm%{ver_suffix}-libs
  585. %defattr(-,root,root,-)
  586. %doc LICENSE.TXT
  587. #config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  588. #dir %{_libdir}/%{name}
  589. %{_libdir}/libLLVM-*.so
  590. %{_libdir}/libRemarks.so.*
  591. #exclude %{_libdir}/LLVMHello.so
  592. %files static
  593. %{_libdir}/*.a
  594. #{_libdir}/cmake/llvm/LLVMStaticExports.cmake
  595. %files -n clang
  596. %defattr(-,root,root,-)
  597. #doc %{llvmdocdir clang}/
  598. %{_bindir}/clang*
  599. %{_bindir}/c-index-test
  600. %{_bindir}/diagtool
  601. %{_bindir}/hmaptool
  602. %{_libdir}/clang
  603. %files -n clang-libs
  604. %defattr(-,root,root,-)
  605. %{_libdir}/libclang.so
  606. %{_libdir}/libclang.so.*
  607. %{_libdir}/libclang-cpp.so
  608. %{_libdir}/libclang-cpp.so.*
  609. %files -n clang-devel
  610. %defattr(-,root,root,-)
  611. #doc %{llvmdocdir clang-devel}/
  612. %{_includedir}/clang
  613. %{_includedir}/clang-c
  614. %dir %{_datadir}/clang/
  615. %{_libdir}/cmake/*
  616. %files -n clang-analyzer
  617. %defattr(-,root,root,-)
  618. %{_bindir}/scan-build
  619. %{_bindir}/scan-view
  620. #%{_libdir}/CheckerDependencyHandlingAnalyzerPlugin.so
  621. #%{_libdir}/CheckerOptionHandlingAnalyzerPlugin.so
  622. #%{_libdir}/SampleAnalyzerPlugin.so
  623. %{_libexecdir}/ccc-analyzer
  624. %{_libexecdir}/c++-analyzer
  625. %{_datadir}/scan-view
  626. %{_datadir}/scan-build
  627. %{_mandir}/man1/scan-build.1.*
  628. %files -n python3-clang
  629. %{python3_sitelib}/clang/
  630. %files -n lldb
  631. %defattr(-,root,root,-)
  632. #doc %{llvmdocdir lldb}/
  633. %{_bindir}/lldb*
  634. %{_libdir}/liblldb*.so.*
  635. %files -n lldb-devel
  636. %defattr(-,root,root,-)
  637. %{_includedir}/lldb
  638. %{_libdir}/liblldb*.so
  639. %files -n python3-lldb
  640. %{python3_sitearch}/lldb
  641. %files -n lld
  642. %defattr(-,root,root,-)
  643. %{_bindir}/lld*
  644. %{_bindir}/ld.lld
  645. %{_bindir}/ld64.lld
  646. %{_bindir}/wasm-ld
  647. %exclude %{_bindir}/lldb*
  648. %if %{with lld_libs}
  649. %files -n lld-libs
  650. %{_libdir}/liblld*.so.*
  651. %exclude %{_libdir}/liblldb*.so.*
  652. %files -n lld-devel
  653. %{_includedir}/lld
  654. %{_libdir}/liblld*.so
  655. %exclude %{_libdir}/liblldb*.so
  656. %endif
  657. %files -n libomp
  658. %{_libdir}/libarcher.so
  659. %{_libdir}/libomp.so
  660. %{_libdir}/libomptarget.so
  661. %files -n libomp-devel
  662. %{_libdir}/clang/%{version}/include/omp.h
  663. %{_libdir}/clang/%{version}/include/omp-tools.h
  664. %{_libdir}/clang/%{version}/include/ompt.h
  665. %files doc
  666. %defattr(-,root,root,-)
  667. %doc docs/*
  668. #doc %{llvmdocdir %{name}-doc}/
  669. %if %{with ocaml}
  670. %files ocaml
  671. %defattr(-,root,root,-)
  672. %{_libdir}/ocaml/*.cma
  673. %{_libdir}/ocaml/*.cmi
  674. %{_libdir}/ocaml/*.so
  675. %{_libdir}/ocaml/META.llvm*
  676. %files ocaml-devel
  677. %defattr(-,root,root,-)
  678. %{_libdir}/ocaml/*.a
  679. %{_libdir}/ocaml/*.cmx*
  680. %{_libdir}/ocaml/*.mli
  681. %files ocaml-doc
  682. %defattr(-,root,root,-)
  683. #doc %{llvmdocdir %{name}-ocaml-doc}/
  684. %endif
  685. %if 0%{?_with_doxygen}
  686. %files apidoc
  687. %defattr(-,root,root,-)
  688. %doc %{llvmdocdir %{name}-apidoc}/
  689. %files -n clang-apidoc
  690. %defattr(-,root,root,-)
  691. %doc %{llvmdocdir clang-apidoc}/
  692. %endif
  693. %if %{build_compat32}
  694. %files -n compat32-%{name}%{ver_suffix}-libs
  695. %defattr(-,root,root)
  696. %doc LICENSE.TXT
  697. #config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  698. %exclude %{_libdir}/libLTO.so
  699. #exclude %{_libdir}/BugpointPasses.so
  700. %exclude %{_libdir}/libclang*.so
  701. %exclude %{_libdir}/liblld*.so
  702. %exclude %{_libdir}/LLVMGold.so
  703. %exclude %{_libdir}/LLVMHello.so
  704. %{_libdir}/*.so
  705. %{_libdir}/libLTO.so.*
  706. %endif
  707. %changelog
  708. * Mon Aug 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.1-1
  709. - new upstream release.
  710. * Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-2
  711. - rebuilt with libffi-3.3.
  712. * Fri Mar 27 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-1
  713. - new upstream release.
  714. * Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
  715. - new upstream release.
  716. * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-2
  717. - dropped all patches.
  718. - switched build-system to ninja.
  719. - switched python to python3.
  720. * Fri Sep 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-1
  721. - new upstream release.
  722. - added OpenMP.
  723. * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
  724. - fixed %%files.
  725. * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
  726. - new upstream release.
  727. - dropped Patch0, 4, 5, 100 and 200.
  728. - imported Patch3, 7, 12, 15, 100, 101, 102 and 400 from rawhide.
  729. - renamed a subpackage "llvm-libs".
  730. - added a subpackage "lld".
  731. * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
  732. - added subpackages "llvm-static", "python-lldb" and "python-clang".
  733. * Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  734. - new upstream release.
  735. - dropped Patch1 and 2: fixed in upstream.
  736. - imported Patch0, 3-5, 100 and 200 from rawhide.
  737. - disabled Patch1002: no longer needed?
  738. * Fri Aug 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  739. - new upstream release.
  740. - switched to cmake.
  741. - disable ocaml binding as default.
  742. - updated Patch1000 and 1002.
  743. - disabled Patch1000 as default.
  744. - cleanup patches.
  745. * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-2
  746. - rebuild with gcc-5.4.0
  747. * Sat Sep 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.2-1
  748. - new upstream release
  749. - added BR: ocaml-ctypes
  750. * Thu Jun 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
  751. - new upstream release
  752. - dropt Patch 1, 201 and 1001
  753. - updated Patch 1000
  754. * Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.5.1-1
  755. - updated to 3.5.1
  756. - added Patch1, 2, 100, 101, 200, 201 and 202 from Fedora
  757. - added clang-libs, lldb, lldb-devel and compat32-llvm-libs subpackage
  758. - obsoleted clang-doc
  759. - built with ocaml 4.02.1
  760. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  761. - fix <BTS:2832>
  762. - fix configure option "--with-c-include-dirs"
  763. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  764. - update Patch1001: clang-3.5.0-driver-lib64.patch
  765. - update Patch1002: clang-3.5.0-driver-vine.patch
  766. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  767. - update to 3.5.0
  768. - remove Patch11 (clang-hardfloat-hack.patch)
  769. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  770. - rebuild with libffi-3.0.13
  771. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  772. - update to 3.3
  773. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  774. - ld.gold (patch1000,1001)
  775. - add /%{_lib} to ld search path
  776. - add support *-vine-linux gcc (patch1002)
  777. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  778. - update to 3.1
  779. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  780. - updated to 3.0 release
  781. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  782. - added patch 2-4 to support -O4 link-time optimization
  783. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  784. - disable -fno-var-tracking-assignments on ppc
  785. (seems like gcc-4.4.5 still doesn't support this)
  786. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  787. - new upstream release
  788. - add BR: libffi-devel
  789. - add R: libffi-devel to -devel
  790. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  791. - initial build for Vine Linux
  792. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  793. - Update to final 2.7 release
  794. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  795. - Update to first 2.7 pre-release
  796. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  797. - Update to 2.6 pre-release2
  798. - -devel subpackage now virtually provides -static
  799. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  800. - Disable var tracking assignments on PPC
  801. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  802. - Don't adjust clang include dir; files there are noarch (bz#521893)
  803. - Enable clang unit tests
  804. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  805. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  806. - Package Clang's static analyzer tools
  807. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  808. - PIC is now enabled by default; explicitly disable on %%{ix86}
  809. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  810. - First 2.6 prerelease
  811. - Enable Clang front-end
  812. - Enable debuginfo generation
  813. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  814. - Disable assertions (needed by OpenGTL, bz#521261)
  815. - Align spec file with upstream build instructions
  816. - Enable unit tests
  817. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  818. - Only disable PIC on %%ix86; ppc actually needs it
  819. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  820. - Disable use of position-independent code on 32-bit platforms
  821. (buggy in LLVM <= 2.5)
  822. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  823. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  824. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  825. - Remove build scripts; they require the build directory to work
  826. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  827. - Update to 2.5
  828. - Package build scripts (bug #457881)
  829. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  830. - Patched build process for the OCaml binding
  831. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  832. - Update to 2.4
  833. - Package Ocaml binding
  834. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  835. - Add dependency on groff
  836. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  837. - LLVM 2.3
  838. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  839. - fix license tags
  840. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  841. - Fix compilation problems with gcc 4.3
  842. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  843. - Autorebuild for GCC 4.3
  844. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  845. - Fix review comments
  846. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  847. - Initial version