llvm-vl.spec 28 KB

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