llvm-vl.spec 30 KB

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