llvm-vl.spec 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041
  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: 9.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: http://llvm.org/
  23. Vendor: Project Vine
  24. Distribution: Vine Linux
  25. Source0: http://releases.llvm.org/%{version}/llvm-%{version}.src.tar.xz
  26. Source1: http://releases.llvm.org/%{version}/cfe-%{version}.src.tar.xz
  27. Source2: http://releases.llvm.org/%{version}/compiler-rt-%{version}.src.tar.xz
  28. Source3: http://releases.llvm.org/%{version}/lldb-%{version}.src.tar.xz
  29. Source4: http://releases.llvm.org/%{version}/lld-%{version}.src.tar.xz
  30. %if %{with clang_tools_extra}
  31. Source5: http://releases.llvm.org/%{version}/clang-tools-extra-%{version}.src.tar.xz
  32. %endif
  33. Source6: http://releases.llvm.org/%{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
  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 cfe-%{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}/LLVMgold.so
  574. %{_libdir}/libLLVM.so
  575. %{_libdir}/libLTO.so*
  576. %{_libdir}/libRemarks.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}/libomp.so
  654. %{_libdir}/libomptarget.so
  655. %files -n libomp-devel
  656. %{_libdir}/clang/%{version}/include/omp.h
  657. %{_libdir}/clang/%{version}/include/omp-tools.h
  658. %{_libdir}/clang/%{version}/include/ompt.h
  659. %files doc
  660. %defattr(-,root,root,-)
  661. %doc docs/*
  662. #doc %{llvmdocdir %{name}-doc}/
  663. %if %{with ocaml}
  664. %files ocaml
  665. %defattr(-,root,root,-)
  666. %{_libdir}/ocaml/*.cma
  667. %{_libdir}/ocaml/*.cmi
  668. %{_libdir}/ocaml/*.so
  669. %{_libdir}/ocaml/META.llvm*
  670. %files ocaml-devel
  671. %defattr(-,root,root,-)
  672. %{_libdir}/ocaml/*.a
  673. %{_libdir}/ocaml/*.cmx*
  674. %{_libdir}/ocaml/*.mli
  675. %files ocaml-doc
  676. %defattr(-,root,root,-)
  677. #doc %{llvmdocdir %{name}-ocaml-doc}/
  678. %endif
  679. %if 0%{?_with_doxygen}
  680. %files apidoc
  681. %defattr(-,root,root,-)
  682. %doc %{llvmdocdir %{name}-apidoc}/
  683. %files -n clang-apidoc
  684. %defattr(-,root,root,-)
  685. %doc %{llvmdocdir clang-apidoc}/
  686. %endif
  687. %if %{build_compat32}
  688. %files -n compat32-%{name}%{ver_suffix}-libs
  689. %defattr(-,root,root)
  690. %doc LICENSE.TXT
  691. #config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  692. %exclude %{_libdir}/libLTO.so
  693. #exclude %{_libdir}/BugpointPasses.so
  694. %exclude %{_libdir}/libclang*.so
  695. %exclude %{_libdir}/liblld*.so
  696. %exclude %{_libdir}/LLVMGold.so
  697. %exclude %{_libdir}/LLVMHello.so
  698. %{_libdir}/*.so
  699. %{_libdir}/libLTO.so.*
  700. %endif
  701. %changelog
  702. * Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-2
  703. - dropped all patches.
  704. - switched build-system to ninja.
  705. - switched python to python3.
  706. * Fri Sep 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 9.0.0-1
  707. - new upstream release.
  708. - added OpenMP.
  709. * Sun Dec 16 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.1-1
  710. - fixed %%files.
  711. * Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.0.0-1
  712. - new upstream release.
  713. - dropped Patch0, 4, 5, 100 and 200.
  714. - imported Patch3, 7, 12, 15, 100, 101, 102 and 400 from rawhide.
  715. - renamed a subpackage "llvm-libs".
  716. - added a subpackage "lld".
  717. * Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
  718. - added subpackages "llvm-static", "python-lldb" and "python-clang".
  719. * Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
  720. - new upstream release.
  721. - dropped Patch1 and 2: fixed in upstream.
  722. - imported Patch0, 3-5, 100 and 200 from rawhide.
  723. - disabled Patch1002: no longer needed?
  724. * Fri Aug 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  725. - new upstream release.
  726. - switched to cmake.
  727. - disable ocaml binding as default.
  728. - updated Patch1000 and 1002.
  729. - disabled Patch1000 as default.
  730. - cleanup patches.
  731. * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.6.2-2
  732. - rebuild with gcc-5.4.0
  733. * Sat Sep 5 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.2-1
  734. - new upstream release
  735. - added BR: ocaml-ctypes
  736. * Thu Jun 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
  737. - new upstream release
  738. - dropt Patch 1, 201 and 1001
  739. - updated Patch 1000
  740. * Tue Mar 24 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.5.1-1
  741. - updated to 3.5.1
  742. - added Patch1, 2, 100, 101, 200, 201 and 202 from Fedora
  743. - added clang-libs, lldb, lldb-devel and compat32-llvm-libs subpackage
  744. - obsoleted clang-doc
  745. - built with ocaml 4.02.1
  746. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  747. - fix <BTS:2832>
  748. - fix configure option "--with-c-include-dirs"
  749. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  750. - update Patch1001: clang-3.5.0-driver-lib64.patch
  751. - update Patch1002: clang-3.5.0-driver-vine.patch
  752. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  753. - update to 3.5.0
  754. - remove Patch11 (clang-hardfloat-hack.patch)
  755. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  756. - rebuild with libffi-3.0.13
  757. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  758. - update to 3.3
  759. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  760. - ld.gold (patch1000,1001)
  761. - add /%{_lib} to ld search path
  762. - add support *-vine-linux gcc (patch1002)
  763. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  764. - update to 3.1
  765. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  766. - updated to 3.0 release
  767. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  768. - added patch 2-4 to support -O4 link-time optimization
  769. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  770. - disable -fno-var-tracking-assignments on ppc
  771. (seems like gcc-4.4.5 still doesn't support this)
  772. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  773. - new upstream release
  774. - add BR: libffi-devel
  775. - add R: libffi-devel to -devel
  776. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  777. - initial build for Vine Linux
  778. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  779. - Update to final 2.7 release
  780. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  781. - Update to first 2.7 pre-release
  782. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  783. - Update to 2.6 pre-release2
  784. - -devel subpackage now virtually provides -static
  785. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  786. - Disable var tracking assignments on PPC
  787. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  788. - Don't adjust clang include dir; files there are noarch (bz#521893)
  789. - Enable clang unit tests
  790. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  791. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  792. - Package Clang's static analyzer tools
  793. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  794. - PIC is now enabled by default; explicitly disable on %%{ix86}
  795. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  796. - First 2.6 prerelease
  797. - Enable Clang front-end
  798. - Enable debuginfo generation
  799. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  800. - Disable assertions (needed by OpenGTL, bz#521261)
  801. - Align spec file with upstream build instructions
  802. - Enable unit tests
  803. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  804. - Only disable PIC on %%ix86; ppc actually needs it
  805. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  806. - Disable use of position-independent code on 32-bit platforms
  807. (buggy in LLVM <= 2.5)
  808. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  809. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  810. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  811. - Remove build scripts; they require the build directory to work
  812. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  813. - Update to 2.5
  814. - Package build scripts (bug #457881)
  815. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  816. - Patched build process for the OCaml binding
  817. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  818. - Update to 2.4
  819. - Package Ocaml binding
  820. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  821. - Add dependency on groff
  822. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  823. - LLVM 2.3
  824. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  825. - fix license tags
  826. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  827. - Fix compilation problems with gcc 4.3
  828. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  829. - Autorebuild for GCC 4.3
  830. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  831. - Fix review comments
  832. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  833. - Initial version