llvm-vl.spec 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. # Build options:
  2. #
  3. # --with doxygen
  4. # The doxygen docs are HUGE, so they are not built by default.
  5. %define build_apidoc %{?_with_doxygen:1}%{!?_with_doxygen:0}
  6. Name: llvm
  7. Version: 3.5.0
  8. Release: 2%{?_dist_release}
  9. Summary: The Low Level Virtual Machine
  10. Summary(ja): LLVM - 低レベルバーチャルマシン
  11. Group: Development/Languages
  12. License: NCSA
  13. URL: http://llvm.org/
  14. Source0: http://llvm.org/releases/%{version}/llvm-%{version}.src.tar.xz
  15. Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz
  16. Source2: http://llvm.org/releases/%{version}/compiler-rt-%{version}.src.tar.xz
  17. # multilib fixes
  18. Source10: llvm-Config-config.h
  19. Source11: llvm-Config-llvm-config.h
  20. # Data files should be installed with timestamps preserved
  21. Patch0: llvm-2.6-timestamp.patch
  22. # hack the link flags for the shared libs for speed and memory usage
  23. Patch21: llvm-3.2-symbolic-shlib.patch
  24. # Vine Patch
  25. Patch1000: clang-3.5.0-driver-ld.gold.patch
  26. Patch1001: clang-3.5.0-driver-lib64.patch
  27. Patch1002: clang-3.5.0-driver-vine.patch
  28. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  29. BuildRequires: binutils-devel
  30. BuildRequires: bison
  31. BuildRequires: chrpath
  32. BuildRequires: flex
  33. BuildRequires: gcc-c++ >= 3.4
  34. BuildRequires: groff
  35. BuildRequires: libffi-devel
  36. BuildRequires: libtool-ltdl-devel
  37. BuildRequires: ocaml
  38. # for DejaGNU test suite
  39. BuildRequires: dejagnu tcl python
  40. %if %{build_apidoc}
  41. BuildRequires: doxygen graphviz
  42. %endif
  43. Requires: llvm-libs = %{version}-%{release}
  44. # LLVM is not supported on PPC64
  45. # http://llvm.org/bugs/show_bug.cgi?id=3729
  46. ExcludeArch: ppc64
  47. %description
  48. LLVM is a compiler infrastructure designed for compile-time,
  49. link-time, runtime, and idle-time optimization of programs from
  50. arbitrary programming languages. The compiler infrastructure includes
  51. mirror sets of programming tools as well as libraries with equivalent
  52. functionality.
  53. %package devel
  54. Summary: Libraries and header files for LLVM
  55. Summary(ja): LLVM のライブラリおよびヘッダファイル
  56. Group: Development/Languages
  57. Requires: %{name} = %{version}-%{release}
  58. Requires: libstdc++-devel
  59. Requires: libffi-devel
  60. Provides: llvm-static = %{version}-%{release}
  61. %description devel
  62. This package contains library and header files needed to develop new
  63. native programs that use the LLVM infrastructure.
  64. %package doc
  65. Summary: Documentation for LLVM
  66. Summary(ja): LLVM のドキュメント
  67. Group: Documentation
  68. Requires: %{name} = %{version}-%{release}
  69. %description doc
  70. Documentation for the LLVM compiler infrastructure.
  71. %package libs
  72. Summary: LLVM shared libraries
  73. Summary(ja): LLVM シェアードライブラリ
  74. Group: System Environment/Libraries
  75. %description libs
  76. Shared libraries for the LLVM compiler infrastructure.
  77. %package -n clang
  78. Summary: A C language family front-end for LLVM
  79. Summary(ja): LLVM の C 言語用フロントエンド
  80. License: NCSA
  81. Group: Development/Languages
  82. Requires: gcc
  83. %(rpm -q --qf 'Requires: %{name} = %{version}' libstdc++-devel)
  84. %description -n clang
  85. clang: noun
  86. 1. A loud, resonant, metallic sound.
  87. 2. The strident call of a crane or goose.
  88. 3. C-language family front-end toolkit.
  89. The goal of the Clang project is to create a new C, C++, Objective C
  90. and Objective C++ front-end for the LLVM compiler. Its tools are built
  91. as libraries and designed to be loosely-coupled and extensible.
  92. %package -n clang-devel
  93. Summary: Header files for clang
  94. Summary(ja): clang のヘッダファイル
  95. Group: Development/Languages
  96. Requires: clang = %{version}-%{release}
  97. %description -n clang-devel
  98. This package contains header files for the Clang compiler.
  99. %package -n clang-analyzer
  100. Summary: A source code analysis framework
  101. Summary(ja): ソースコー分析フレームワーク
  102. License: NCSA
  103. Group: Development/Languages
  104. Requires: clang = %{version}-%{release}
  105. # not picked up automatically since files are currently not instaled
  106. # in standard Python hierarchies yet
  107. Requires: python
  108. %description -n clang-analyzer
  109. The Clang Static Analyzer consists of both a source code analysis
  110. framework and a standalone tool that finds bugs in C and Objective-C
  111. programs. The standalone tool is invoked from the command-line, and is
  112. intended to run in tandem with a build of a project or code base.
  113. %package -n clang-doc
  114. Summary: Documentation for Clang
  115. Summary(ja): Clang のドキュメント
  116. Group: Documentation
  117. Requires: %{name} = %{version}-%{release}
  118. %description -n clang-doc
  119. Documentation for the Clang compiler front-end.
  120. %if %{build_apidoc}
  121. %package apidoc
  122. Summary: API documentation for LLVM
  123. Summary(ja): LLVM の API ドキュメント
  124. Group: Development/Languages
  125. Requires: %{name}-docs = %{version}-%{release}
  126. %description apidoc
  127. API documentation for the LLVM compiler infrastructure.
  128. %endif
  129. %package ocaml
  130. Summary: OCaml binding for LLVM
  131. Summary(ja): LLVM の OCaml バインディング
  132. Group: Development/Libraries
  133. Requires: %{name} = %{version}-%{release}
  134. Requires: ocaml
  135. %description ocaml
  136. OCaml binding for LLVM.
  137. %package ocaml-devel
  138. Summary: Development files for %{name}-ocaml
  139. Summary(ja): %{name}-ocaml の開発ファイル
  140. Group: Development/Libraries
  141. Requires: %{name}-devel = %{version}-%{release}
  142. Requires: %{name}-ocaml = %{version}-%{release}
  143. Requires: ocaml
  144. %description ocaml-devel
  145. The %{name}-ocaml-devel package contains libraries and signature files
  146. for developing applications that use %{name}-ocaml.
  147. %package ocaml-doc
  148. Summary: Documentation for %{name}-ocaml
  149. Summary(ja): %{name}-ocaml のドキュメント
  150. Group: Documentation
  151. Requires: %{name}-ocaml = %{version}-%{release}
  152. %description ocaml-doc
  153. HTML documentation for LLVM's OCaml binding.
  154. %prep
  155. %setup -q -n llvm-%{version}.src -a1 -a2
  156. rm -f tools/clang
  157. mv cfe-%{version}.src tools/clang
  158. # llvm patches
  159. %patch0 -p1 -b .timestamp
  160. # fix llvm-config --libs
  161. %patch21 -p1 -b .orig
  162. %patch1000 -p1 -b .driver-ld.gold
  163. %ifarch x86_64
  164. %patch1001 -p1 -b .driver-lib64
  165. %endif
  166. %patch1002 -p1 -b .driver-vine
  167. # fix ld search path
  168. sed -i 's|/lib /usr/lib $lt_ld_extra|/%{_lib} %{_libdir} $lt_ld_extra|' \
  169. ./configure
  170. sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config.in
  171. sed -i 's|/lib\>|/%{_lib}/%{name}|g' tools/llvm-config/llvm-config.cpp
  172. %build
  173. export CC=/usr/bin/gcc
  174. export CXX=/usr/bin/g++
  175. # Disabling assertions now, rec. by pure and needed for OpenGTL
  176. # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
  177. %configure \
  178. --prefix=%{_prefix} \
  179. --libdir=%{_libdir}/%{name} \
  180. --datadir=%{_libdir}/%{name} \
  181. %if %{?_with_doxygen:1}%{!?_with_doxygen:0}
  182. --enable-doxygen \
  183. %endif
  184. %ifarch armv7hl armv7l
  185. --with-cpu=cortex-a8 \
  186. --with-tune=cortex-a8 \
  187. --with-arch=armv7-a \
  188. --with-float=hard \
  189. --with-fpu=vfpv3-d16 \
  190. --with-abi=aapcs-linux \
  191. %endif
  192. --enable-targets=host \
  193. --disable-assertions \
  194. --enable-optimized \
  195. --enable-jit \
  196. --enable-libffi \
  197. --enable-shared \
  198. --enable-pic \
  199. --with-c-include-dirs=%{_includedir}:$(echo %{_prefix}/lib/gcc/%{_target_cpu}*/*/include) \
  200. --with-binutils-include=%{_includedir} \
  201. --enable-targets=x86,powerpc,arm,aarch64,cpp,nvptx \
  202. --enable-experimental-targets=R600
  203. make %{_smp_mflags} \
  204. REQUIRES_RTTI=1 \
  205. OPTIMIZE_OPTION="%{optflags}"
  206. %install
  207. rm -rf %{buildroot}
  208. make install DESTDIR=%{buildroot} \
  209. PROJ_docsdir=/moredocs
  210. # you have got to be kidding me
  211. rm -f %{buildroot}%{_bindir}/{FileCheck,count,not}
  212. # multilib fixes
  213. mv %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
  214. pushd %{buildroot}%{_includedir}/llvm/Config
  215. mv config.h config-%{__isa_bits}.h
  216. cp -p %{SOURCE10} config.h
  217. mv llvm-config.h llvm-config-%{__isa_bits}.h
  218. cp -p %{SOURCE11} llvm-config.h
  219. popd
  220. # Create ld.so.conf.d entry
  221. mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
  222. cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
  223. %{_libdir}/llvm
  224. EOF
  225. # Static analyzer not installed by default:
  226. # http://clang-analyzer.llvm.org/installation#OtherPlatforms
  227. mkdir -p %{buildroot}%{_libdir}/clang-analyzer
  228. # create launchers
  229. for f in scan-{build,view}; do
  230. ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
  231. done
  232. (cd tools/clang/tools && cp -pr scan-{build,view} \
  233. %{buildroot}%{_libdir}/clang-analyzer/)
  234. # Move documentation back to build directory
  235. #
  236. pwd
  237. mv %{buildroot}/moredocs .
  238. rm -f moredocs/*.tar.gz
  239. rm -f moredocs/ocamldoc/html/*.tar.gz
  240. # and separate the apidoc
  241. %if %{build_apidoc}
  242. mv moredocs/html/doxygen apidoc
  243. mv tools/clang/docs/doxygen/html clang-apidoc
  244. %endif
  245. # And prepare Clang documentation
  246. #
  247. mkdir clang-docs
  248. for f in LICENSE.TXT NOTES.txt README.txt; do
  249. ln tools/clang/$f clang-docs/
  250. done
  251. rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
  252. #find %%{buildroot} -name .dir -print0 | xargs -0r rm -f
  253. file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
  254. file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
  255. #chrpath -d %%{buildroot}/%%{_libexecdir}/clang-cc
  256. # Get rid of erroneously installed example files.
  257. rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
  258. # FIXME file this bug
  259. sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \
  260. %{buildroot}%{_bindir}/llvm-config-%{__isa_bits}
  261. chmod -x %{buildroot}%{_libdir}/%{name}/*.a
  262. # remove documentation makefiles:
  263. # they require the build directory to work
  264. find examples -name 'Makefile' | xargs -0r rm -f
  265. %check
  266. make check 2>&1 | tee ../llvm-testlog.txt
  267. make -C tools/clang/test 2>&1 | tee ../llvm-testlog.txt
  268. %clean
  269. rm -rf %{buildroot}
  270. %post libs -p /sbin/ldconfig
  271. %post -n clang -p /sbin/ldconfig
  272. %postun libs -p /sbin/ldconfig
  273. %postun -n clang -p /sbin/ldconfig
  274. %posttrans devel
  275. # link llvm-config to the platform-specific file;
  276. # use ISA bits as priority so that 64-bit is preferred
  277. # over 32-bit if both are installed
  278. alternatives \
  279. --install \
  280. %{_bindir}/llvm-config \
  281. llvm-config \
  282. %{_bindir}/llvm-config-%{__isa_bits} \
  283. %{__isa_bits}
  284. %postun devel
  285. if [ $1 -eq 0 ]; then
  286. alternatives --remove llvm-config \
  287. %{_bindir}/llvm-config-%{__isa_bits}
  288. fi
  289. exit 0
  290. %files
  291. %defattr(-,root,root,-)
  292. %doc CREDITS.TXT LICENSE.TXT README.txt
  293. %{_bindir}/bugpoint
  294. %{_bindir}/llc
  295. %{_bindir}/lli
  296. %{_bindir}/lli-child-target
  297. %exclude %{_bindir}/llvm-config-%{__isa_bits}
  298. %{_bindir}/llvm*
  299. %{_bindir}/macho-dump
  300. %{_bindir}/opt
  301. %exclude %{_mandir}/man1/clang.1.*
  302. %doc %{_mandir}/man1/*.1.*
  303. %files devel
  304. %defattr(-,root,root,-)
  305. %{_bindir}/llvm-config-%{__isa_bits}
  306. %{_includedir}/%{name}
  307. %{_includedir}/%{name}-c
  308. %{_libdir}/%{name}/*.a
  309. %{_datadir}/%{name}/cmake
  310. %files libs
  311. %defattr(-,root,root,-)
  312. %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
  313. %dir %{_libdir}/%{name}
  314. %exclude %{_libdir}/%{name}/libclang.so
  315. %{_libdir}/%{name}/*.so
  316. %files -n clang
  317. %defattr(-,root,root,-)
  318. %doc clang-docs/*
  319. %{_bindir}/clang*
  320. %{_bindir}/c-index-test
  321. %{_libdir}/%{name}/libclang.so
  322. %{_prefix}/lib/clang
  323. %doc %{_mandir}/man1/clang.1.*
  324. %files -n clang-devel
  325. %defattr(-,root,root,-)
  326. %{_includedir}/clang
  327. %{_includedir}/clang-c
  328. %files -n clang-analyzer
  329. %defattr(-,root,root,-)
  330. %{_bindir}/scan-build
  331. %{_bindir}/scan-view
  332. %{_libdir}/clang-analyzer
  333. %files -n clang-doc
  334. %defattr(-,root,root,-)
  335. %doc tools/clang/docs/*
  336. %files doc
  337. %defattr(-,root,root,-)
  338. %doc examples moredocs/html
  339. %files ocaml
  340. %defattr(-,root,root,-)
  341. %{_libdir}/ocaml/*.cma
  342. %{_libdir}/ocaml/*.cmi
  343. %{_libdir}/ocaml/*.so
  344. %{_libdir}/ocaml/META.llvm*
  345. %files ocaml-devel
  346. %defattr(-,root,root,-)
  347. %{_libdir}/ocaml/*.a
  348. %{_libdir}/ocaml/*.cmx*
  349. %{_libdir}/ocaml/*.mli
  350. %files ocaml-doc
  351. %defattr(-,root,root,-)
  352. %doc moredocs/ocamldoc/html/*
  353. %if 0%{?_with_doxygen}
  354. %files apidoc
  355. %defattr(-,root,root,-)
  356. %doc apidoc/*
  357. %files -n clang-apidoc
  358. %defattr(-,root,root,-)
  359. %doc clang-apidoc/*
  360. %endif
  361. %changelog
  362. * Sat Nov 29 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-2
  363. - fix <BTS:2832>
  364. - fix configure option "--with-c-include-dirs"
  365. - update Patch1000: clang-3.5.0-driver-ld.gold.patch
  366. - update Patch1001: clang-3.5.0-driver-lib64.patch
  367. - update Patch1002: clang-3.5.0-driver-vine.patch
  368. * Tue Oct 28 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.5.0-1
  369. - update to 3.5.0
  370. - remove Patch11 (clang-hardfloat-hack.patch)
  371. * Sun Jul 06 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.3-2
  372. - rebuild with libffi-3.0.13
  373. * Mon Oct 28 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.3-1
  374. - update to 3.3
  375. * Mon Dec 03 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-2
  376. - ld.gold (patch1000,1001)
  377. - add /%{_lib} to ld search path
  378. - add support *-vine-linux gcc (patch1002)
  379. * Fri Nov 30 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.1-1
  380. - update to 3.1
  381. * Tue Jan 24 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 3.0-1
  382. - updated to 3.0 release
  383. * Sun Jan 15 2012 NAKAMURA Kenta <kenta@vinelinux.org> - 2.9-3
  384. - added patch 2-4 to support -O4 link-time optimization
  385. * Fri Sep 9 2011 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.9-2
  386. - disable -fno-var-tracking-assignments on ppc
  387. (seems like gcc-4.4.5 still doesn't support this)
  388. * Thu Aug 25 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.9-1
  389. - new upstream release
  390. - add BR: libffi-devel
  391. - add R: libffi-devel to -devel
  392. * Sun May 23 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.7-1
  393. - initial build for Vine Linux
  394. * Sun May 2 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-1
  395. - Update to final 2.7 release
  396. * Sun Mar 28 2010 Michel Salim <salimma@fedoraproject.org> - 2.7-0.1.pre1
  397. - Update to first 2.7 pre-release
  398. * Fri Sep 18 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.6.pre2
  399. - Update to 2.6 pre-release2
  400. - -devel subpackage now virtually provides -static
  401. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.5.pre1
  402. - Disable var tracking assignments on PPC
  403. * Wed Sep 9 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.4.pre1
  404. - Don't adjust clang include dir; files there are noarch (bz#521893)
  405. - Enable clang unit tests
  406. - clang and clang-analyzer renamed; no longer depend on llvm at runtime
  407. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.3.pre1
  408. - Package Clang's static analyzer tools
  409. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.2.pre1
  410. - PIC is now enabled by default; explicitly disable on %%{ix86}
  411. * Mon Sep 7 2009 Michel Salim <salimma@fedoraproject.org> - 2.6-0.1.pre1
  412. - First 2.6 prerelease
  413. - Enable Clang front-end
  414. - Enable debuginfo generation
  415. * Sat Sep 5 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-6
  416. - Disable assertions (needed by OpenGTL, bz#521261)
  417. - Align spec file with upstream build instructions
  418. - Enable unit tests
  419. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-5
  420. - Only disable PIC on %%ix86; ppc actually needs it
  421. * Sat Aug 22 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-4
  422. - Disable use of position-independent code on 32-bit platforms
  423. (buggy in LLVM <= 2.5)
  424. * Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
  425. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  426. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-2
  427. - Remove build scripts; they require the build directory to work
  428. * Wed Mar 4 2009 Michel Salim <salimma@fedoraproject.org> - 2.5-1
  429. - Update to 2.5
  430. - Package build scripts (bug #457881)
  431. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-2
  432. - Patched build process for the OCaml binding
  433. * Tue Dec 2 2008 Michel Salim <salimma@fedoraproject.org> - 2.4-1
  434. - Update to 2.4
  435. - Package Ocaml binding
  436. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-2
  437. - Add dependency on groff
  438. * Wed Jun 18 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.3-1
  439. - LLVM 2.3
  440. * Thu May 29 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 2.2-4
  441. - fix license tags
  442. * Wed Mar 5 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.2-3
  443. - Fix compilation problems with gcc 4.3
  444. * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.2-2
  445. - Autorebuild for GCC 4.3
  446. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-2
  447. - Fix review comments
  448. * Sun Jan 20 2008 Bryan O'Sullivan <bos@serpentine.com> - 2.1-1
  449. - Initial version