llvm-vl.spec 28 KB

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