llvm-vl.spec 16 KB

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