robertd

gcc

Aug 14th, 2016
180
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # SourcePath: gcc-4.1.2/20100125
  2. Summary: GNU Compiler Collection
  3. Name: sony-cross-gcc-for-dev
  4. %define pkgname %{sony_tool_triplet}-cross-gcc-for-dev
  5. Version: 4.1.2
  6. Release: 05000204
  7. License: GPL2 / LGPL2.1/ special exception
  8. Distribution: %{sony_distribution}
  9. Vendor: %{sony_vendor}
  10. Packager: %{sony_packager}
  11. Group: %{sony_group}
  12. URL: http://www.gnu.org/software/gcc
  13. Source0: gcc-%{version}.tar.bz2
  14.  
  15. # patches from gcc bugzilla, carry over from gcc-4.1.1
  16. Patch001: gcc-4.1.1-pr28516.patch
  17. Patch002: gcc-4.1.1-pr29877.patch
  18. Patch003: gcc-4.1.1-pr30468.patch
  19. Patch004: gcc-4.1.1-pr31809.patch
  20. Patch005: gcc-4.1.1-pr33142.patch
  21. Patch006: gcc-4.1.2-pr29413.patch
  22.  
  23. # patches from gcc bugzilla, from gcc-4.2.1 testsuite gcc.sum ICE
  24. Patch007: gcc-4.1.2-pr31632.patch
  25. Patch008: gcc-4.1.2-pr28905.patch
  26. Patch009: gcc-4.1.2-pr30433.patch
  27. Patch010: gcc-4.1.2-pr30984.patch
  28. Patch011: gcc-4.1.2-pr31448.patch
  29. Patch012: gcc-4.1.2-pr28935.patch
  30. Patch013: gcc-4.1.2-pr30045.patch
  31. Patch014: gcc-4.1.2-pr30189.patch
  32. Patch015: gcc-4.1.2-pr30473.patch
  33.  
  34. # patches from gcc bugzilla, from gcc-4.2.1 testsuite g++.sum ICE
  35. Patch016: gcc-4.1.2-pr32109.patch
  36. Patch017: gcc-4.1.2-pr227376.patch
  37. Patch018: gcc-4.1.2-pr30221.patch
  38. Patch019: gcc-4.1.2-pr30168.patch
  39. Patch020: gcc-4.1.2-pr11468.patch
  40. Patch021: gcc-4.1.2-pr30847.patch
  41. Patch022: gcc-4.1.2-pr30895.patch
  42. Patch023: gcc-4.1.2-pr19606.patch
  43. Patch024: gcc-4.1.2-pr28011.patch
  44. Patch025: gcc41-pr27144.patch
  45.  
  46. # ARM
  47. Patch100: gcc-4.1.0-arm-nolibfloat.patch
  48. Patch101: gcc-4.0.2-arm-lib1asm.patch
  49. Patch102: gcc-4.1.1-arm-type_info-comparison.patch
  50. Patch103: gcc-4.1.1-arm-incorrect-promotion-arguments.patch
  51. Patch104: gcc-4.1.1-arm-eabi-object-attribute.patch
  52. Patch105: gcc-4.1.1-arm__cxa_type_match.patch
  53. Patch106: gcc-4.1.1-arm-tls-debug-info.patch
  54. Patch107: gcc-4.1.1-arm-eabi-wchar_t-markings.patch
  55. Patch108: gcc-4.1.2-arm-eabi-destructor-type.patch
  56. Patch109: gcc-4.1-arm-fix__cxa_begin_cleanup.patch
  57. Patch110: gcc-4.1.2-arm-exchange_and_add-thread-safe.patch
  58.  
  59. # PowerPC
  60. # soft-fp patch http://sourceware.org/bugzilla/show_bug.cgi?id=2749
  61. Patch200: gcc-41-20060515.patch
  62. Patch201: sfp-long-double-gcc412.patch
  63. Patch202: gcc-4.1.2-Power-object-attributes.patch
  64.  
  65. # MIPS
  66. Patch300: gcc-4.1.1-mips-enable-vr5500-condmov.patch
  67. # compile MIPS crtstuff with -mxgot option, to support multigot
  68. Patch301: gcc-4.1.2-mips-crtstuff-mxgot.patch
  69. Patch302: gcc-4.1.2-MIPS-Add-new-cpu-names.patch
  70. Patch303: gcc-4.1.2-mips-libgcc-mxgot.patch
  71. Patch305: gcc-4.1.2-MIPS-object-attributes.patch
  72.  
  73. # x86
  74.  
  75. # other
  76. Patch500: gcc-4.1.2-adjust-ld-version.patch
  77. Patch501: gcc-gxx-sysroot.patch
  78. Patch502: gcc-4.1.2-pr19319.patch
  79. Patch503: gcc-4.1.2-mudflap-cpp-O0-test.patch
  80.  
  81. # SSlibc
  82.  
  83. # spec file specific
  84.  
  85. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
  86. Prefix: %{sony_cross_dir}
  87.  
  88. BuildArch: %{sony_host_arch}
  89. BuildRequires: %{sony_tool_triplet}-cross-binutils
  90.  
  91. %description
  92. This is the GNU C compiler, a fairly portable optimizing compiler which
  93. supports multiple languages. This package includes support for C. It also
  94. includes the GNU C preprocessor.
  95.  
  96. %package -n %{pkgname}
  97. Summary: GNU Compiler Collection
  98. Group: %{sony_group}
  99. AutoReqProv: no
  100.  
  101. Requires: %{sony_tool_triplet}-cross-binutils
  102. Conflicts: %{sony_tool_triplet}-cross-gcc-core
  103.  
  104. %description -n %{pkgname}
  105. This is the GNU C compiler, a fairly portable optimizing compiler which
  106. supports multiple languages. This package includes support for C. It also
  107. includes the GNU C preprocessor.
  108.  
  109. %prep
  110. %setup -q -n gcc-%{version}
  111.  
  112. %patch001 -p0
  113. %patch002 -p2
  114. %patch003 -p1
  115. %patch004 -p2
  116. %patch005 -p1
  117. %patch006 -p1
  118. %patch007 -p2
  119. %patch008 -p1
  120. %patch009 -p2
  121. %patch010 -p2
  122. %patch011 -p2
  123. %patch012 -p1
  124. %patch013 -p2
  125. %patch014 -p2
  126. %patch015 -p2
  127. %patch016 -p2
  128. %patch017 -p2
  129. %patch018 -p2
  130. %patch019 -p2
  131. %patch020 -p1
  132. %patch021 -p2
  133. %patch022 -p2
  134. %patch023 -p1
  135. %patch024 -p1
  136. %patch025 -p0
  137.  
  138. %patch100 -p1
  139. %patch101 -p1
  140. %patch102 -p0
  141. %patch103 -p1
  142. %patch104 -p0
  143. %patch105 -p0
  144. %patch106 -p0
  145. %patch107 -p0
  146. %patch108 -p1
  147. %patch109 -p0
  148. %patch110 -p1
  149.  
  150. %patch200 -p1
  151. %patch201 -p1
  152. %patch202 -p1
  153.  
  154. %patch300 -p1
  155. %if %{sony_target_cpu} == "mips"
  156. %patch301 -p1
  157. %endif
  158. %patch302 -p1
  159. %if %{sony_target_cpu} == "mips"
  160. %patch303 -p1
  161. %endif
  162.  
  163. %patch305 -p1
  164.  
  165. %patch500 -p1
  166. %patch501 -p1
  167. %patch502 -p1
  168. %patch503 -p1
  169.  
  170. %build
  171. %sony_cross_dev_setup
  172.  
  173. VERSION_SUFFIX=" `date +%Y%m%d` (Sony CE Linux %{sony_linux_release_version})"
  174. sed "s,define VERSUFFIX.*,define VERSUFFIX \"${VERSION_SUFFIX}\";," gcc/version.c > gcc/version.c-scel
  175. mv gcc/version.c{,-orig}
  176. mv gcc/version.c{-scel,}
  177.  
  178. ( cd gcc && autoconf ) &&
  179. # automake 1.8.3 miss generates Makefile.in for arm-sony-linux.
  180. # ( cd libstdc++-v3 && autoconf && aclocal && automake ) &&
  181. ( cd libstdc++-v3 && autoconf && aclocal ) &&
  182. ( cd gcc && autoheader ) &&
  183. %sony_cross_dev_configure \
  184. --prefix=%{sony_cross_dev_dir} \
  185. --program-transform-name='s,^,%{sony_target_toolprefix},' \
  186. --enable-languages=c,c++ \
  187. %if "%{sony_target_cpu_id}" != "%%%{sony_target_cpu_id}"
  188. %if "%{sony_target_cpu}" == "arm"
  189. --with-cpu=arm926ej-s \
  190. %else
  191. --with-cpu=%{sony_target_cpu_id} \
  192. %endif
  193. %endif
  194. %if "%{sony_target_arch_id}" != "%%%{sony_target_arch_id}"
  195. --with-arch=%{sony_target_arch_id} \
  196. %endif
  197. %if "%{sony_target_tune_id}" != "%%%{sony_target_tune_id}"
  198. --with-tune=%{sony_target_tune_id} \
  199. %endif
  200. %if "%{sony_target_fpu}" == "no"
  201. --with-float=soft \
  202. %endif
  203. %if "%{sony_target_altivec}" == "yes"
  204. --enable-altivec \
  205. %else
  206. --disable-altivec \
  207. %endif
  208. --with-sysroot=%{sony_cross_dev_target_dir} \
  209. --enable-__cxa_atexit \
  210. --disable-multilib \
  211. --enable-threads=posix \
  212. --enable-shared \
  213. --with-gxx-include-dir=%{sony_target_rel_include_dir}/c++/%{version} &&
  214. make
  215.  
  216. %install
  217. %sony_cross_dev_setup
  218.  
  219. rm -rf %{buildroot}
  220.  
  221. cd %{sony_objdir} &&
  222. make DESTDIR=%{buildroot} install-no-fixedincludes
  223.  
  224. # libiberty.a is also included in binutils, and we use it.
  225. rm -f %{buildroot}%{sony_cross_dev_lib_dir}/libiberty.a
  226. rm -f %{buildroot}%{sony_cross_dev_dir}/%{sony_target_config}/lib/libiberty.a
  227.  
  228. # move libgcc to target dir.
  229. %define _libgcc_dir %{sony_cross_target_dir}%{sony_target_dev_prefix}
  230. mkdir -p %{buildroot}%{_libgcc_dir}
  231. mv -f %{buildroot}%{sony_cross_dev_dir}/%{sony_target_config}/lib \
  232. %{buildroot}%{_libgcc_dir}
  233. rmdir %{buildroot}%{sony_cross_dev_dir}/%{sony_target_config}
  234.  
  235. # move libgcc header to target dir.
  236. mkdir -p %{buildroot}%{sony_cross_target_dir}%{sony_target_dev_include_dir}
  237. mv -f %{buildroot}%{sony_cross_dev_dir}/include/* \
  238. %{buildroot}%{sony_cross_target_dir}%{sony_target_dev_include_dir}
  239. rm -rf %{buildroot}%{sony_cross_dev_dir}/include
  240.  
  241. # move C++ headers to target dir.
  242. mkdir -p %{buildroot}%{sony_cross_target_dir}%{sony_target_dev_include_dir}
  243. mv -f %{buildroot}%{sony_target_rel_include_dir}/c++ \
  244. %{buildroot}%{sony_cross_target_dir}%{sony_target_dev_include_dir}
  245. rm -rf %{buildroot}%{sony_target_rel_include_dir}
  246.  
  247. # replace dynamic linker in specs.
  248. %define _specs %{sony_cross_dev_lib_dir}/gcc/%{sony_target_config}/%{version}/specs
  249. %{buildroot}%{sony_cross_dev_bin_dir}/%{sony_target_toolprefix}gcc -dumpspecs \
  250. | sed -e \
  251. %if "%{sony_target_config}" == "arm-sony-linux-gnueabi"
  252. 's,\(/lib/ld-linux\.so\.3\),%{sony_target_dev_dir}\1,' \
  253. %endif
  254. %if "%{sony_target_cpu}" == "i386" || "%{sony_target_cpu}" == "i686"
  255. 's,\(/lib/ld-linux\.so\.2\),%{sony_target_dev_dir}\1,' \
  256. %endif
  257. %if "%{sony_target_cpu}" == "mips"
  258. 's,\(/lib/ld\.so\.1\),%{sony_target_dev_dir}\1,' \
  259. %endif
  260. %if "%{sony_target_cpu}" == "ppc"
  261. 's,\(/lib/ld\.so\.1\),%{sony_target_dev_dir}\1,' \
  262. %endif
  263. > %{buildroot}%{_specs}
  264.  
  265. # remove gcc with versioned filename.
  266. rm -f %{buildroot}%{sony_cross_dev_bin_dir}/%{sony_target_toolprefix}gcc-%{version}
  267. # remove c++
  268. rm -f %{buildroot}%{sony_cross_dev_bin_dir}/%{sony_target_toolprefix}c++
  269. # create symbolic link c++ to g++.
  270. ln -s %{sony_target_toolprefix}g++ \
  271. %{buildroot}%{sony_cross_dev_bin_dir}/%{sony_target_toolprefix}c++
  272.  
  273. # create symbolic links in sslibc tools directory.
  274. mkdir -p %{buildroot}%{sony_cross_bin_dir}
  275. for f in gccbug gcov
  276. do
  277. ln -s ../devel/bin/%{sony_target_toolprefix}$f %{buildroot}%{sony_cross_bin_dir}/
  278. done
  279.  
  280. # Remove info/dir created by install-info.
  281. rm -f %{buildroot}%{sony_cross_dev_info_dir}/dir
  282.  
  283. %demangle_libtool
  284.  
  285. for la in `find %{buildroot}%{sony_cross_target_dir}/%{sony_target_dev_lib_dir} -name '*.la' -print`
  286. do
  287. grep -v libdir $la > $la.tmp
  288. echo "libdir=\$CROSS_COMPILE_PREFIX'/devel/usr/lib'" >> $la.tmp
  289. mv $la.tmp $la
  290. done
  291.  
  292.  
  293. %clean
  294. rm -rf %{buildroot}
  295.  
  296. %files -n %{pkgname}
  297. %defattr(-,root,root,-)
  298.  
  299. %{sony_cross_dir}
  300.  
  301. %changelog
  302. * Mon Jan 25 2010 Sony Corporation
  303. - Add pr27144 fix patch.
  304.  
  305. * Wed Mar 11 2009 Sony Corporation
  306. - MIPS and Power object attributes support is added.
  307.  
  308. * Thu Jan 29 2009 Sony Corporation
  309. - Add pr19606, pr28011 fix patch.
  310.  
  311. * Fri Jan 16 2009 Sony Corporation
  312. - MIPS: Add new cpu names.
  313.  
  314. * Thu Jan 08 2009 Sony Corporation
  315. - MIPS build crtstuff with -mxgot option
  316.  
  317. * Fri Sep 12 2008 Sony Corporation
  318. - ARM libstdc++ bugfix patch is added.
  319.  
  320. * Mon Jun 9 2008 Sony Corporation
  321. - ARM __cxa_begin_cleanup bugfix for RVCT C++ EH.
  322.  
  323. * Wed Apr 30 2008 Sony Corporation
  324. - Added i686 support
  325.  
  326. * Fri Apr 25 2008 Sony Corporation
  327. - Version up to gcc-4.1.2
  328.  
  329. * Thu Apr 10 2008 Sony Corporation
  330. - Add Sony CE Linux info into VERSUFFIX of version.c
  331.  
  332. * Tue Oct 09 2007 Sony Corporation
  333. - Add Vr5500 conditional move support.
  334.  
  335. * Wed Sep 19 2007 Sony Corporation
  336. - Add pr31809, pr33142 fix patch
  337.  
  338. * Thu Sep 3 2007 Sony Corporation
  339. - Add ARM EABI wchar fix patch.
  340.  
  341. * Thu Aug 1 2007 Sony Corporation
  342. - Add ARM tls debug info patch.
  343.  
  344. * Thu Jul 17 2007 Sony Corporation
  345. - Add ARM __cxa_type_match fix patch.
  346.  
  347. * Mon Jun 25 2007 Sony Corporation
  348. - Add binutils ld version adjust patch
  349.  
  350. * Wed May 23 2007 Sony Corporation
  351. - Add ARM EABI destructor type fix patch.
  352.  
  353. * Wed Mar 14 2007 Sony Corporation
  354. - Add ARM EABI attribute patch.
  355.  
  356. * Wed Mar 14 2007 Sony Corporation
  357. - Add prfix backport from gcc-4.1.2
  358.  
  359. * Wed Feb 7 2007 Sony Corporation
  360. - Changed program name
  361.  
  362. * Wed Feb 5 2007 Sony Corporation
  363. - Add patch10[67].
  364.  
  365. * Fri Feb 2 2007 Sony Corporation
  366. - Add patch105.
  367.  
  368. * Sat Sep 21 2006 Sony Corporation
  369. - Initial build.
RAW Paste Data