llvm-vl.spec 29 KB

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