llvm-vl.spec 16 KB

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