gcc.spec 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. %global gmp_version 6.1.2
  2. %global mpfr_version 4.1.0
  3. %global mpc_version 1.2.1
  4. %global isl_version 0.24
  5. #%global DATE 20220409
  6. #%global gcc_version 11.2.1
  7. %global gcc_version 11.3.0-RC-20220414
  8. Name: gcc
  9. Version: 11.2.1
  10. Release: 1%{?dist}
  11. Summary: GNU compiler collection
  12. Provides: cpp = %{version}-%{release}
  13. License: GPLv3+
  14. URL: https://gcc.gnu.org
  15. Source0: https://gcc.gnu.org/pub/gcc/snapshots/11.3.0-RC-20220414/gcc-11.3.0-RC-20220414.tar.xz
  16. Source1: https://gmplib.org/download/gmp/gmp-%{gmp_version}.tar.lz
  17. Source2: https://ftp.gnu.org/gnu/mpfr/mpfr-%{mpfr_version}.tar.xz
  18. Source3: https://ftp.gnu.org/gnu/mpc/mpc-%{mpc_version}.tar.gz
  19. Source4: https://gcc.gnu.org/pub/gcc/infrastructure/isl-%{isl_version}.tar.bz2
  20. BuildRequires: gcc-c++ gcc-gnat lzip texinfo
  21. %description
  22. GNU compiler collection
  23. %package -n libgcc
  24. Summary: GCC version 11 shared support library
  25. Autoreq: false
  26. Provides: libatomic = %{version}-%{release}
  27. Provides: libatomic-static = %{version}-%{release}
  28. Provides: libgomp = %{version}-%{release}
  29. Provides: libgomp-static = %{version}-%{release}
  30. Provides: libquadmath = %{version}-%{release}
  31. Provides: libquadmath-static = %{version}-%{release}
  32. Provides: libitm = %{version}-%{release}
  33. Provides: libitm-static = %{version}-%{release}
  34. Provides: libasan= %{version}-%{release}
  35. Provides: libasan-static = %{version}-%{release}
  36. Provides: libubsan= %{version}-%{release}
  37. Provides: libubsan-static = %{version}-%{release}
  38. Provides: libtsan= %{version}-%{release}
  39. Provides: libtsan-static = %{version}-%{release}
  40. %description -n libgcc
  41. This package contains GCC shared support library which is needed
  42. e.g. for exception handling support.
  43. %package c++
  44. Summary: C++ support for GCC version 11
  45. Requires: gcc = %{version}-%{release}
  46. Requires: libstdc++ = %{version}-%{release}
  47. Autoreq: true
  48. %description c++
  49. This package adds C++ support to the GNU Compiler Collection
  50. version 11. It includes support for most of the current C++ specification
  51. and a lot of support for the upcoming C++ specification.
  52. %package -n libstdc++
  53. Summary: GNU Standard C++ Library
  54. Autoreq: true
  55. Requires: glibc >= 2.10.90-7
  56. Provides: libstdc++-devel = %{version}-%{release}
  57. %description -n libstdc++
  58. The libstdc++ package contains a rewritten standard compliant GCC Standard
  59. C++ Library.
  60. %package gnat
  61. Summary: GCC Ada
  62. Requires: gcc = %{version}-%{release}
  63. %description gnat
  64. GCC Ada frontend
  65. %prep
  66. %setup -q -n gcc-%{gcc_version} -a 1 -a 2 -a 3 -a 4
  67. mv gmp-%{gmp_version} gmp
  68. mv mpfr-%{mpfr_version} mpfr
  69. mv mpc-%{mpc_version} mpc
  70. mv isl-%{isl_version} isl
  71. # --with-build-config=bootstrap-lto \
  72. %build
  73. mkdir build-gcc
  74. cd build-gcc
  75. ../configure --prefix=%{_prefix} --libdir=%{_libdir} \
  76. --disable-multilib \
  77. --enable-bootstrap \
  78. --with-linker-hash-style=gnu \
  79. --enable-languages=c,c++,ada,lto \
  80. --enable-lto \
  81. --enable-plugin \
  82. --enable-shared \
  83. --enable-threads=posix \
  84. --enable-__cxa_atexit \
  85. --enable-cet=auto \
  86. --enable-clocale=gnu \
  87. --enable-gnu-indirect-function \
  88. --enable-gnu-unique-object \
  89. --enable-linker-build-id \
  90. --disable-libssp \
  91. --disable-libstdcxx-pch \
  92. --disable-werror \
  93. --enable-link-serialization=1
  94. make %{?_smp_mflags}
  95. %install
  96. cd build-gcc
  97. make DESTDIR=%{buildroot} install
  98. rm -f %{buildroot}/%{_infodir}/dir
  99. rm -rf %{buildroot}/%{_mandir}/man7
  100. find %{buildroot} -name '*.la' -delete
  101. ln -sf gcc %{buildroot}%{_prefix}/bin/cc
  102. mv %{buildroot}%{_libdir}/libgcc_s.so.1 %{buildroot}%{_libdir}/libgcc_s-%{version}-%{DATE}.so.1
  103. chmod 755 %{buildroot}%{_libdir}/libgcc_s-%{version}-%{DATE}.so.1
  104. ln -sf libgcc_s-%{version}-%{DATE}.so.1 %{buildroot}%{_libdir}/libgcc_s.so.1
  105. cat > %{buildroot}%{_prefix}/bin/c89 <<"EOF"
  106. #!/bin/sh
  107. fl="-std=c89"
  108. for opt; do
  109. case "$opt" in
  110. -ansi|-std=c89|-std=iso9899:1990) fl="";;
  111. -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
  112. exit 1;;
  113. esac
  114. done
  115. exec gcc $fl ${1+"$@"}
  116. EOF
  117. cat > %{buildroot}%{_prefix}/bin/c99 <<"EOF"
  118. #!/bin/sh
  119. fl="-std=c99"
  120. for opt; do
  121. case "$opt" in
  122. -std=c99|-std=iso9899:1999) fl="";;
  123. -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
  124. exit 1;;
  125. esac
  126. done
  127. exec gcc $fl ${1+"$@"}
  128. EOF
  129. chmod 755 %{buildroot}%{_prefix}/bin/c89
  130. chmod 755 %{buildroot}%{_prefix}/bin/c99
  131. %files
  132. /usr/bin/gcc
  133. /usr/bin/cc
  134. /usr/bin/c89
  135. /usr/bin/c99
  136. /usr/bin/lto-dump
  137. /usr/bin/gcc-ar
  138. /usr/bin/gcc-nm
  139. /usr/bin/gcov
  140. /usr/bin/x86_64-pc-linux-gnu-gcc
  141. /usr/bin/cpp
  142. /usr/bin/gcc-ranlib
  143. /usr/bin/x86_64-pc-linux-gnu-gcc-ranlib
  144. /usr/bin/x86_64-pc-linux-gnu-gcc-nm
  145. /usr/bin/gcov-dump
  146. /usr/bin/x86_64-pc-linux-gnu-gcc-11.2.1
  147. /usr/bin/gcov-tool
  148. /usr/bin/x86_64-pc-linux-gnu-gcc-ar
  149. /usr/share/gcc-11.2.1/python/libstdcxx
  150. %{_infodir}/gcc.*
  151. %{_infodir}/cppinternals.*
  152. %{_infodir}/gccint.*
  153. %{_infodir}/cpp.*
  154. %{_infodir}/gccinstall.*
  155. /usr/share/locale/*/LC_MESSAGES/gcc.mo
  156. /usr/share/locale/*/LC_MESSAGES/cpplib.mo
  157. /usr/share/man/man1/lto-dump.*
  158. /usr/share/man/man1/gcov-dump.*
  159. /usr/share/man/man1/gcc.*
  160. /usr/share/man/man1/gcov.*
  161. /usr/share/man/man1/cpp.*
  162. /usr/share/man/man1/gcov-tool.*
  163. %{_libdir}/libcc1.*
  164. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/crt*.o
  165. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/libgcov.a
  166. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/libgcc.a
  167. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/libgcc_eh.a
  168. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/install-tools
  169. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/plugin
  170. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/include-fixed
  171. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/include
  172. %{_libdir}/libsanitizer.spec
  173. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/lto-wrapper
  174. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/install-tools
  175. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/plugin
  176. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/lto1
  177. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/liblto_plugin.so
  178. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/collect2
  179. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/cc1
  180. %files -n libgcc
  181. %{_libdir}/lib*san*
  182. %{_libdir}/libquadmath*
  183. %{_libdir}/libgomp*
  184. %{_libdir}/libitm*
  185. %{_libdir}/libatomic*
  186. %{_libdir}/libgcc*
  187. %{_infodir}/libquadmath.info*
  188. %{_infodir}/libgomp.info*
  189. %{_infodir}/libitm.info*
  190. %post -n libgcc
  191. /sbin/ldconfig
  192. /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libquadmath.info.gz
  193. /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libgomp.info.gz
  194. /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libitm.info.gz
  195. %postun -n libgcc
  196. /sbin/ldconfig
  197. /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libquadmath.info.gz
  198. /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libgomp.info.gz
  199. /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libitm.info.gz
  200. %files c++
  201. /usr/bin/g++
  202. /usr/bin/c++
  203. /usr/bin/x86_64-pc-linux-gnu-g++
  204. /usr/bin/x86_64-pc-linux-gnu-c++
  205. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/g++-mapper-server
  206. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/cc1plus
  207. %{_includedir}/c++
  208. %{_mandir}/man1/g++.*
  209. %files -n libstdc++
  210. %{_libdir}/libstdc++*
  211. %{_libdir}/libsupc++*
  212. /usr/share/locale/*/LC_MESSAGES/libstdc++.mo
  213. %post -n libstdc++
  214. /sbin/ldconfig
  215. %postun -n libstdc++
  216. /sbin/ldconfig
  217. %files gnat
  218. /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.1/gnat1
  219. /usr/bin/gnatclean
  220. /usr/bin/gnatchop
  221. /usr/bin/gnatfind
  222. /usr/bin/gnatls
  223. /usr/bin/gnatname
  224. /usr/bin/gnatbind
  225. /usr/bin/gnatkr
  226. /usr/bin/gnat
  227. /usr/bin/gnatmake
  228. /usr/bin/gnatxref
  229. /usr/bin/gnatlink
  230. /usr/bin/gnatprep
  231. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/adalib
  232. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/adainclude
  233. %{_libdir}/gcc/x86_64-pc-linux-gnu/11.2.1/ada_target_properties
  234. %{_infodir}/gnat-style.*
  235. %{_infodir}/gnat_ugn.*
  236. %{_infodir}/gnat_rm.*
  237. %post gnat
  238. /sbin/ldconfig
  239. /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gnat-style.info.gz
  240. /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gnat_ugn.info.gz
  241. /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gnat_rm.info.gz
  242. %postun gnat
  243. /sbin/ldconfig
  244. /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gnat-style.info.gz
  245. /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gnat_ugn.info.gz
  246. /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gnat_rm.info.gz
  247. %changelog