llvm-vl.spec 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  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: 11.0.0
  19. Release: 2%{?_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. %debug_package
  328. %prep
  329. %setup -q -a1 -a2 -a3 -a4 -a6 -n llvm-%{version}.src
  330. #%patch0 -p2
  331. #%patch1 -p2
  332. #%patch2 -p2
  333. ##patch3 -p2
  334. rm -rf tools/clang tools/lld tools/lldb projects/compiler-rt
  335. mv clang-%{version}.src tools/clang
  336. mv compiler-rt-%{version}.src projects/compiler-rt
  337. mv lldb-%{version}.src tools/lldb
  338. mv lld-%{version}.src tools/lld
  339. mv openmp-%{version}.src projects/openmp
  340. %if %{with clang_tools_extra}
  341. tar xvf %{SOURCE5}
  342. mv clang-tools-extra-%{version}.src tools/clang/tools/extra
  343. %endif
  344. pushd tools/clang
  345. ##patch100 -p1
  346. #%patch101 -p2
  347. #%patch102 -p1
  348. #%patch103 -p2
  349. popd
  350. pushd projects/compiler-rt
  351. #%patch200 -p1
  352. popd
  353. pushd tools/lld
  354. #%patch400 -p1
  355. popd
  356. # Vine Linux
  357. %if %{with force_gold}
  358. pushd tools/clang
  359. %patch1000 -p1 -b .driver-ld.gold
  360. popd
  361. %endif
  362. #%patch1002 -p1 -b .driver-vine
  363. sed -i -e 's/"i686-linux-gnu",/"i686-linux-gnu","i686-vine-linux","i686-vine-linux-gnu",/' tools/clang/lib/Driver/ToolChains/Gnu.cpp
  364. 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
  365. sed -i -e 's/"ld"/"ld.gold"/' tools/clang/include/clang/Driver/ToolChain.h
  366. %build
  367. mkdir build
  368. cd build
  369. %ifarch s390 s390x %{arm} %ix86
  370. # Decrease debuginfo verbosity to reduce memory consumption during final library linking
  371. %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
  372. %endif
  373. #CFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fPIC"
  374. #CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fPIC -std=c++11"
  375. #TMP_PWD=$(pwd)
  376. #LDFLAGS="%{?__global_ldflags} -L$TMP_PWD/%{_lib} -lpthread -ldl"
  377. %cmake .. \
  378. -GNinja \
  379. -DBUILD_SHARED_LIBS:BOOL=OFF \
  380. -DLLVM_PARALLEL_LINK_JOBS=1 \
  381. -DCMAKE_BUILD_TYPE=Release \
  382. -DCMAKE_INSTALL_RPATH=";" \
  383. %if 0%{?__isa_bits} == 64
  384. -DLLVM_LIBDIR_SUFFIX=64 \
  385. %else
  386. -DLLVM_LIBDIR_SUFFIX= \
  387. %endif
  388. -DLLVM_TARGETS_TO_BUILD=all \
  389. -DLLVM_ENABLE_LIBCXX:BOOL=OFF \
  390. -DLLVM_ENABLE_ZLIB:BOOL=ON \
  391. -DLLVM_ENABLE_FFI:BOOL=ON \
  392. -DLLVM_ENABLE_RTTI:BOOL=ON \
  393. -DLLVM_ENABLE_EH=ON \
  394. -DLLVM_BINUTILS_INCDIR=%{_includedir} \
  395. -DLLVM_BUILD_RUNTIME:BOOL=ON \
  396. \
  397. -DLLVM_INCLUDE_TOOLS:BOOL=ON \
  398. -DLLVM_BUILD_TOOLS:BOOL=ON \
  399. \
  400. -DLLVM_INCLUDE_TESTS:BOOL=ON \
  401. -DLLVM_BUILD_TESTS:BOOL=ON \
  402. \
  403. -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
  404. -DLLVM_BUILD_EXAMPLES:BOOL=OFF \
  405. \
  406. -DLLVM_INCLUDE_UTILS:BOOL=ON \
  407. -DLLVM_INSTALL_UTILS:BOOL=ON \
  408. -DLLVM_UTILS_INSTALL_DIR:PATH=%{_bindir} \
  409. -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \
  410. \
  411. -DLLVM_INCLUDE_DOCS:BOOL=ON \
  412. -DLLVM_ENABLE_SPHINX:BOOL=OFF \
  413. %if %{with doxygen}
  414. -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
  415. %else
  416. -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
  417. %endif
  418. -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
  419. -DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
  420. -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
  421. -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
  422. -DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
  423. \
  424. -DCLANG_ENABLE_ARCMT:BOOL=ON \
  425. -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
  426. -DCLANG_INCLUDE_DOCS:BOOL=ON \
  427. -DCLANG_INCLUDE_TESTS:BOOL=ON \
  428. -DCLANG_PLUGIN_SUPPORT:BOOL=ON \
  429. -DCLANG_BUILD_EXAMPLES:BOOL=OFF \
  430. -DCLANG_LINK_CLANG_DYLIB=ON \
  431. -DCLANG_REPOSITORY_STRING="Vine Linux %{version}-%{release}" \
  432. -DLIB_SUFFIX= \
  433. \
  434. -DLLDB_DISABLE_CURSES:BOOL=OFF \
  435. -DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
  436. -DLLDB_DISABLE_PYTHON:BOOL=OFF \
  437. \
  438. -DLLDB_LINK_LLVM_DYLIB:BOOL=ON \
  439. \
  440. -DLIBOMP_INSTALL_ALIASES=OFF \
  441. -DLIBOMP_HEADERS_INSTALL_PATH:PATH=%{_libdir}/clang/%{version}/include \
  442. \
  443. -DPYTHON_EXECUTABLE:STRING=%{__python3} \
  444. -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on?
  445. # workaround for all-in-one build
  446. #TMP_PWD=$(pwd)
  447. #LD_LIBRARY_PATH="$TMP_PWD/%{_lib}" make %{?_smp_mflags}
  448. %ninja_build
  449. %install
  450. rm -rf %{buildroot}
  451. cd build
  452. %ninja_install
  453. # llvm
  454. install -m755 ./bin/lli-child-target %{buildroot}%{_bindir}/lli-child-target
  455. # fix multi-lib
  456. mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  457. ln -sf llvm-config-%{__isa_bits} %{buildroot}%{_bindir}/llvm-config
  458. mv -v %{buildroot}%{_includedir}/llvm/Config/llvm-config{,-%{__isa_bits}}.h
  459. install -m 0644 %{SOURCE10} %{buildroot}%{_includedir}/llvm/Config/llvm-config.h
  460. # clang
  461. # remove static libraries
  462. rm -fv %{buildroot}%{_libdir}/libclang*.a
  463. # install clang python bindings
  464. mkdir -p %{buildroot}%{python3_sitelib}/clang/
  465. install -p -m644 ../tools/clang/bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/
  466. mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
  467. install -m 0644 %{SOURCE11} %{buildroot}%{_includedir}/clang/Config/config.h
  468. # remove git integration
  469. rm -vf %{buildroot}%{_bindir}/git-clang-format
  470. # remove editor integrations (bbedit, sublime, emacs, vim)
  471. rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
  472. rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
  473. rm -vf %{buildroot}%{_datadir}/clang/clang-format.el
  474. rm -vf %{buildroot}%{_datadir}/clang/clang-format.py*
  475. # remove diff reformatter
  476. rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
  477. # lldb
  478. # remove static libraries
  479. rm -fv %{buildroot}%{_libdir}/liblldb*.a
  480. # python: fix binary libraries location
  481. liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so))
  482. ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so
  483. # remove bundled six.py
  484. rm -f %{buildroot}%{python3_sitearch}/six.*
  485. # lld
  486. # remove static libraries
  487. rm -fv %{buildroot}%{_libdir}/liblld*.a
  488. # Remove rpath
  489. chrpath --delete %{buildroot}%{_bindir}/*lld
  490. chrpath --delete %{buildroot}%{_bindir}/lld-link
  491. chrpath --delete %{buildroot}%{_bindir}/wasm-ld
  492. find %{buildroot}%{_libdir} -type f -name 'liblld*.so*' | \
  493. grep -v 'liblldb' | \
  494. xargs chrpath --delete
  495. %if !%{with lld_libs}
  496. rm -rf %{buildroot}%{_includedir}/lld
  497. %endif
  498. # compiler-rt
  499. # move sanitizer lists to better place
  500. mkdir -p %{buildroot}%{_libdir}/clang/%{version}
  501. for file in asan_blacklist.txt msan_blacklist.txt dfsan_blacklist.txt cfi_blacklist.txt dfsan_abilist.txt; do
  502. mv -v %{buildroot}%{_prefix}/${file} %{buildroot}%{_libdir}/clang/%{version}/ || :
  503. done
  504. # move sanitizer libs to better place
  505. #mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib
  506. #mv -v %{buildroot}%{_prefix}/lib/linux/libclang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib
  507. #mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/
  508. #pushd %{buildroot}%{_libdir}/clang/%{version}/lib
  509. #for i in *.a *.syms *.so; do
  510. # ln -s ../$i linux/$i
  511. #done
  512. #rm -rf %{buildroot}%{_libdir}/python*
  513. rm -f %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
  514. rm -f %{buildroot}%{_datadir}/clang/clang-rename.el
  515. rm -f %{buildroot}%{_datadir}/clang/clang-rename.py
  516. %if %{with test}
  517. %check
  518. ninja -C build check
  519. ninja -C build check-clang
  520. ninja -C build check-lldb
  521. ninja -C build check-lld
  522. %endif
  523. %clean
  524. rm -rf %{buildroot}
  525. %post -n llvm%{ver_suffix}-libs -p /sbin/ldconfig
  526. %postun -n llvm%{ver_suffix}-libs -p /sbin/ldconfig
  527. %post -n clang-libs -p /sbin/ldconfig
  528. %postun -n clang-libs -p /sbin/ldconfig
  529. %post -n lldb -p /sbin/ldconfig
  530. %postun -n lldb -p /sbin/ldconfig
  531. %post -n lld
  532. /sbin/alternatives --install /usr/bin/ld ld \
  533. /usr/bin/ld.lld 20
  534. %preun -n lld
  535. if [ $1 = 0 ]; then
  536. /sbin/alternatives --remove ld /usr/bin/ld.lld
  537. fi
  538. %if %{with lld_libs}
  539. %post -n lld-libs -p /sbin/ldconfig
  540. %postun -n lld-libs -p /sbin/ldconfig
  541. %endif
  542. %posttrans devel
  543. # link llvm-config to the platform-specific file;
  544. # use ISA bits as priority so that 64-bit is preferred
  545. # over 32-bit if both are installed
  546. alternatives \
  547. --install \
  548. %{_bindir}/llvm-config \
  549. llvm-config \
  550. %{_bindir}/llvm-config-%{__isa_bits} \
  551. %{__isa_bits}
  552. %postun devel
  553. if [ $1 -eq 0 ]; then
  554. alternatives --remove llvm-config \
  555. %{_bindir}/llvm-config-%{__isa_bits}
  556. fi
  557. exit 0
  558. %files
  559. %defattr(-,root,root,-)
  560. %doc CREDITS.TXT README.txt
  561. %{_bindir}/FileCheck
  562. %{_bindir}/bugpoint
  563. %{_bindir}/dsymutil
  564. %{_bindir}/llc
  565. %{_bindir}/lli
  566. %{_bindir}/lli-child-target
  567. %{_bindir}/obj2yaml
  568. %{_bindir}/sancov
  569. %{_bindir}/sanstats
  570. %{_bindir}/verify-uselistorder
  571. %{_bindir}/yaml2obj
  572. %{_bindir}/count
  573. %{_bindir}/not
  574. %{_bindir}/yaml-bench
  575. %exclude %{_bindir}/llvm-config
  576. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  577. %{_bindir}/llvm*
  578. %{_bindir}/opt
  579. %exclude %{_mandir}/man1/scan-build.1.*
  580. %doc %{_mandir}/man1/*.1.*
  581. %{_datadir}/opt-viewer
  582. %files -n llvm%{ver_suffix}-libs
  583. %defattr(-,root,root,-)
  584. %license LICENSE.TXT
  585. #config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  586. #dir %{_libdir}/%{name}
  587. %{_libdir}/libLLVM-*.so
  588. %{_libdir}/LLVMgold.so
  589. %{_libdir}/libLTO.so*
  590. %{_libdir}/libRemarks.so*
  591. %files devel
  592. %defattr(-,root,root,-)
  593. #doc %{llvmdocdir %{name}-devel}/
  594. %{_bindir}/llvm-config
  595. %{_bindir}/llvm-config-%{__isa_bits}
  596. %{_includedir}/%{name}
  597. %{_includedir}/%{name}-c
  598. #{_libdir}/BugpointPasses.so
  599. %{_libdir}/libLLVM.so
  600. %{_libdir}/cmake/llvm
  601. #exclude %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
  602. %files static
  603. %{_libdir}/*.a
  604. #{_libdir}/cmake/llvm/LLVMStaticExports.cmake
  605. %files -n clang
  606. %defattr(-,root,root,-)
  607. #doc %{llvmdocdir clang}/
  608. %{_bindir}/clang*
  609. %{_bindir}/c-index-test
  610. %{_bindir}/diagtool
  611. %{_bindir}/hmaptool
  612. %{_libdir}/clang
  613. %files -n clang-libs
  614. %defattr(-,root,root,-)
  615. %{_libdir}/libclang.so
  616. %{_libdir}/libclang.so.*
  617. %{_libdir}/libclang-cpp.so
  618. %{_libdir}/libclang-cpp.so.*
  619. %files -n clang-devel
  620. %defattr(-,root,root,-)
  621. #doc %{llvmdocdir clang-devel}/
  622. %{_includedir}/clang
  623. %{_includedir}/clang-c
  624. %dir %{_datadir}/clang/
  625. %{_libdir}/cmake/*
  626. %files -n clang-analyzer
  627. %defattr(-,root,root,-)
  628. %{_bindir}/scan-build
  629. %{_bindir}/scan-view
  630. #%{_libdir}/CheckerDependencyHandlingAnalyzerPlugin.so
  631. #%{_libdir}/CheckerOptionHandlingAnalyzerPlugin.so
  632. #%{_libdir}/SampleAnalyzerPlugin.so
  633. %{_libexecdir}/ccc-analyzer
  634. %{_libexecdir}/c++-analyzer
  635. %{_datadir}/scan-view
  636. %{_datadir}/scan-build
  637. %{_mandir}/man1/scan-build.1.*
  638. %files -n python3-clang
  639. %{python3_sitelib}/clang/
  640. %files -n lldb
  641. %defattr(-,root,root,-)
  642. #doc %{llvmdocdir lldb}/
  643. %{_bindir}/lldb*
  644. %{_libdir}/liblldb*.so.*
  645. %files -n lldb-devel
  646. %defattr(-,root,root,-)
  647. %{_includedir}/lldb
  648. %{_libdir}/liblldb*.so
  649. %files -n python3-lldb
  650. %{python3_sitearch}/lldb
  651. %files -n lld
  652. %defattr(-,root,root,-)
  653. %{_bindir}/lld*
  654. %{_bindir}/ld.lld
  655. %{_bindir}/ld64.lld
  656. %{_bindir}/wasm-ld
  657. %exclude %{_bindir}/lldb*
  658. %if %{with lld_libs}
  659. %files -n lld-libs
  660. %{_libdir}/liblld*.so.*
  661. %exclude %{_libdir}/liblldb*.so.*
  662. %files -n lld-devel
  663. %{_includedir}/lld
  664. %{_libdir}/liblld*.so
  665. %exclude %{_libdir}/liblldb*.so
  666. %endif
  667. %files -n libomp
  668. %{_libdir}/libarcher.so
  669. %{_libdir}/libomp.so
  670. %{_libdir}/libomptarget.so
  671. %files -n libomp-devel
  672. %{_libdir}/clang/%{version}/include/omp.h
  673. %{_libdir}/clang/%{version}/include/omp-tools.h
  674. %{_libdir}/clang/%{version}/include/ompt.h
  675. %{_includedir}/ompt-multiplex.h
  676. %files doc
  677. %defattr(-,root,root,-)
  678. %doc docs/*
  679. #doc %{llvmdocdir %{name}-doc}/
  680. %if %{with ocaml}
  681. %files ocaml
  682. %defattr(-,root,root,-)
  683. %{_libdir}/ocaml/*.cma
  684. %{_libdir}/ocaml/*.cmi
  685. %{_libdir}/ocaml/*.so
  686. %{_libdir}/ocaml/META.llvm*
  687. %files ocaml-devel
  688. %defattr(-,root,root,-)
  689. %{_libdir}/ocaml/*.a
  690. %{_libdir}/ocaml/*.cmx*
  691. %{_libdir}/ocaml/*.mli
  692. %files ocaml-doc
  693. %defattr(-,root,root,-)
  694. #doc %{llvmdocdir %{name}-ocaml-doc}/
  695. %endif
  696. %if 0%{?_with_doxygen}
  697. %files apidoc
  698. %defattr(-,root,root,-)
  699. %doc %{llvmdocdir %{name}-apidoc}/
  700. %files -n clang-apidoc
  701. %defattr(-,root,root,-)
  702. %doc %{llvmdocdir clang-apidoc}/
  703. %endif
  704. %if %{build_compat32}
  705. %files -n compat32-%{name}%{ver_suffix}-libs
  706. %defattr(-,root,root)
  707. %license LICENSE.TXT
  708. #config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  709. %exclude %{_libdir}/libLTO.so
  710. #exclude %{_libdir}/BugpointPasses.so
  711. %exclude %{_libdir}/libclang*.so
  712. %exclude %{_libdir}/liblld*.so
  713. %exclude %{_libdir}/LLVMgold.so
  714. %{_libdir}/*.so
  715. %{_libdir}/libRemarks.so.*
  716. %endif
  717. %changelog
  718. * Fri Oct 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-2
  719. - enabled to build utils.
  720. * Thu Oct 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 11.0.0-1
  721. - new upstream release.
  722. * Mon Aug 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.1-1
  723. - new upstream release.
  724. * Thu Apr 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-2
  725. - rebuilt with libffi-3.3.
  726. * Fri Mar 27 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.0.0-1
  727. - new upstream release.
  728. * Sun Dec 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.1-1
  729. - new upstream release.
  730. * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-2
  731. - dropped all patches.
  732. - switched build-system to ninja.
  733. - switched python to python3.
  734. * Fri Sep 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-1
  735. - new upstream release.
  736. - added OpenMP.
  737. * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
  738. - fixed %%files.
  739. * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
  740. - new upstream release.
  741. - dropped Patch0, 4, 5, 100 and 200.
  742. - imported Patch3, 7, 12, 15, 100, 101, 102 and 400 from rawhide.
  743. - renamed a subpackage "llvm-libs".
  744. - added a subpackage "lld".
  745. * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
  746. - added subpackages "llvm-static", "python-lldb" and "python-clang".
  747. * Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  748. - new upstream release.
  749. - dropped Patch1 and 2: fixed in upstream.
  750. - imported Patch0, 3-5, 100 and 200 from rawhide.
  751. - disabled Patch1002: no longer needed?
  752. * Fri Aug 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  753. - new upstream release.
  754. - switched to cmake.
  755. - disable ocaml binding as default.
  756. - updated Patch1000 and 1002.
  757. - disabled Patch1000 as default.
  758. - cleanup patches.
  759. * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-2
  760. - rebuild with gcc-5.4.0
  761. * Sat Sep 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.2-1
  762. - new upstream release
  763. - added BR: ocaml-ctypes
  764. * Thu Jun 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
  765. - new upstream release
  766. - dropt Patch 1, 201 and 1001
  767. - updated Patch 1000
  768. * Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.5.1-1
  769. - updated to 3.5.1
  770. - added Patch1, 2, 100, 101, 200, 201 and 202 from Fedora
  771. - added clang-libs, lldb, lldb-devel and compat32-llvm-libs subpackage
  772. - obsoleted clang-doc
  773. - built with ocaml 4.02.1
  774. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  775. - fix <BTS:2832>
  776. - fix configure option "--with-c-include-dirs"
  777. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  778. - update Patch1001: clang-3.5.0-driver-lib64.patch
  779. - update Patch1002: clang-3.5.0-driver-vine.patch
  780. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  781. - update to 3.5.0
  782. - remove Patch11 (clang-hardfloat-hack.patch)
  783. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  784. - rebuild with libffi-3.0.13
  785. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  786. - update to 3.3
  787. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  788. - ld.gold (patch1000,1001)
  789. - add /%{_lib} to ld search path
  790. - add support *-vine-linux gcc (patch1002)
  791. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  792. - update to 3.1
  793. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  794. - updated to 3.0 release
  795. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  796. - added patch 2-4 to support -O4 link-time optimization
  797. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  798. - disable -fno-var-tracking-assignments on ppc
  799. (seems like gcc-4.4.5 still doesn't support this)
  800. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  801. - new upstream release
  802. - add BR: libffi-devel
  803. - add R: libffi-devel to -devel
  804. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  805. - initial build for Vine Linux
  806. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  807. - Update to final 2.7 release
  808. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  809. - Update to first 2.7 pre-release
  810. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  811. - Update to 2.6 pre-release2
  812. - -devel subpackage now virtually provides -static
  813. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  814. - Disable var tracking assignments on PPC
  815. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  816. - Don't adjust clang include dir; files there are noarch (bz#521893)
  817. - Enable clang unit tests
  818. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  819. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  820. - Package Clang's static analyzer tools
  821. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  822. - PIC is now enabled by default; explicitly disable on %%{ix86}
  823. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  824. - First 2.6 prerelease
  825. - Enable Clang front-end
  826. - Enable debuginfo generation
  827. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  828. - Disable assertions (needed by OpenGTL, bz#521261)
  829. - Align spec file with upstream build instructions
  830. - Enable unit tests
  831. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  832. - Only disable PIC on %%ix86; ppc actually needs it
  833. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  834. - Disable use of position-independent code on 32-bit platforms
  835. (buggy in LLVM <= 2.5)
  836. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  837. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  838. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  839. - Remove build scripts; they require the build directory to work
  840. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  841. - Update to 2.5
  842. - Package build scripts (bug #457881)
  843. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  844. - Patched build process for the OCaml binding
  845. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  846. - Update to 2.4
  847. - Package Ocaml binding
  848. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  849. - Add dependency on groff
  850. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  851. - LLVM 2.3
  852. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  853. - fix license tags
  854. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  855. - Fix compilation problems with gcc 4.3
  856. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  857. - Autorebuild for GCC 4.3
  858. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  859. - Fix review comments
  860. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  861. - Initial version