source: spec/trunk/SPECS/gcc4.spec

Last change on this file was 508, checked in by Yuri Dario, 11 years ago

spec: gcc4,

  • updated source code to gcc 4.9.2.
  • create gccXXX forwarders to gcc1 runtime dll, use libc06 exports for non-standard symbols.
  • use --enable-frame-pointer to disable unwinding table generation.
  • build requires patched builtin.h and stddef.h (libc-0.6.6-25).
  • use standard toolchain to build gcc runtime dll, use named exports only.
  • Property svn:eol-style set to native
File size: 11.2 KB
RevLine 
[370]1%define ver_major 4
[508]2%define ver_minor 9
3%define ver_patch 2
[370]4
5%define os2_release 1
6
[508]7%define rpm_release 3
[370]8
9%global gcc_version %{ver_major}.%{ver_minor}.%{ver_patch}
[249]10%global gcc_target_platform %{_target_cpu}
[11]11
[353]12# New package version scheme: X.Y.Z.N-R, where X.Y.Z is the GCC release (e.g.
13# 4.5.4, matches gcc_version above), N is the OS/2 release (1, 2, etc) and R is
14# the RPM release (1, 2, etc). The OS/2 release number increases with each
15# OS/2 specific update to the sources followed by a new build, the RPM repease
16# number increases with each new RPM build (which may use the same source tree
17# but fix only some RPM-specific things). Note that the RPM release number
18# resets to 1 each time the OS/2 release increases (which is reset to 1 in turn
19# when the GCC release changes.
20
[11]21Summary: Various compilers (C, C++, Objective-C, Java, ...)
22Name: gcc
[370]23Version: %{gcc_version}.%{os2_release}
24Release: %{rpm_release}%{?dist}
[109]25
[11]26# libgcc, libgfortran, libmudflap, libgomp, libstdc++ and crtstuff have
27# GCC Runtime Exception.
28License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
29Group: Development/Languages
30URL: http://gcc.gnu.org
31
[508]32Source0: gcc-gcc-4_9-branch-os2.tar.bz2
33Source1: gcc-libgcc-fwd.zip
[109]34
[11]35Obsoletes: gcc < %{gcc_version}
[249]36
[353]37BuildRequires: binutils make
[357]38BuildRequires: os2-base-fhs
[353]39BuildRequires: ash gcc gcc-wlink gcc-wrc grep gettext-devel diffutils gawk flex sed
[370]40BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1, mpc-devel
[508]41BuildRequires: libc-devel >= 0.6.6-25
42BuildRequires: rpm >= 4.8.1-22
[249]43
[508]44Requires: libgcc1 = %{version}-%{release}
[353]45Requires: libssp = %{version}-%{release}
[370]46Requires: libstdc++6 = %{version}-%{release}
47Requires: libsupc++6 = %{version}-%{release}
[508]48# libc header fixes
49Requires: libc-devel >= 0.6.6-25
50# rpm color workaround
51Requires: rpm >= 4.8.1-22
[228]52Requires: binutils
[11]53
54%description
[370]55The gcc package contains the GNU Compiler Collection version %{ver_major}.%{ver_minor}.
[11]56You'll need this package in order to compile C code.
57
[508]58%package -n libgcc-fwd
59Summary: GCC version shared support forwarder library
[11]60Group: System Environment/Libraries
61Autoreq: false
[508]62Obsoletes: libgcc335 libgcc432 libgcc433 libgcc434 libgcc440 libgcc441
63Obsoletes: libgcc442 libgcc444 libgcc445 libgcc446 libgcc452 libgcc453
64Obsoletes: libgcc473 libgcc490 libgcc492
[11]65
[508]66%description -n libgcc-fwd
67This package contains GCC shared support forwarder library which is needed
68e.g. for exception handling support.
69
70%package -n libgcc1
71Summary: GCC version 1 shared support library
72Group: System Environment/Libraries
73Autoreq: false
74
75%description -n libgcc1
[11]76This package contains GCC shared support library which is needed
77e.g. for exception handling support.
78
[277]79%package -n libssp
[173]80Summary: GCC stack protector shared library
81Group: System Environment/Libraries
[353]82Obsoletes: gcc-stack-protector
[173]83
[277]84%description -n libssp
[173]85This package contains GCC shared library which is needed
86for stack protector.
87
[370]88%package -n libstdc++6
[270]89Summary: GNU Standard C++ Library v3
90Group: System Environment/Libraries
91
[370]92%description -n libstdc++6
[270]93This package contains GNU Standard C++ Library v3 shared library.
94
[370]95%package -n libsupc++6
[270]96Summary: GNU Standard C++ Library v3 subset
97Group: System Environment/Libraries
98
[370]99%description -n libsupc++6
[270]100This package contains GNU Standard C++ Library v3 subset shared library.
101
[191]102%package wlink
103Summary: GCC configuration changes for Watcom linker support.
104Group: Development/Languages
105Requires: watcom-wlink-hll
106
107%description wlink
108This package triggers the required config.sys settings to allow use of Watcom
109Linker instead of ld.
110
111%package wrc
112Summary: GCC configuration changes for Watcom resource compiler support.
113Group: Development/Languages
114Requires: watcom-wrc
115
116%description wrc
117This package triggers the required config.sys settings to allow use of Watcom
118resource compiler instead of IBM one.
119
[508]120%package debug
121Summary: HLL debug data for exception handling support.
122
123%description debug
124HLL debug data for exception handling support.
125
126
[11]127%prep
[508]128%setup -q -c -a 1
[11]129
[508]130
[249]131%build
132rm -fr obj-%{gcc_target_platform}
133mkdir obj-%{gcc_target_platform}
134cd obj-%{gcc_target_platform}
135
136script_dir=%{_topdir}/BUILD/%{name}-%{version}/obj-%{gcc_target_platform}
137export PATH="$script_dir/gcc${PATH:+;$PATH}"
138export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
[508]139export LIBPATHSTRICT=T
[249]140
[251]141export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
142export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
[249]143export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
[370]144export LANG=en_US
145export GREP=grep
[353]146
[508]147export PATH_SEPARATOR=;
148export CONFIG_SITE=/@unixroot/usr/share/config.legacy
149
[249]150../configure --prefix=%{_prefix} \
151 --with-sysroot=/@unixroot \
152 --enable-shared \
153 --enable-languages=c,c++ \
[508]154 --enable-frame-pointer \
[249]155 --with-gnu-as \
156 --disable-bootstrap \
157 --disable-multilib \
158 --disable-libstdcxx-pch \
[370]159 --enable-threads
[249]160
[508]161make %{?_smp_mflags}
[249]162
[370]163
[11]164%install
165rm -rf $RPM_BUILD_ROOT
[249]166cd obj-%{gcc_target_platform}
[109]167
[249]168# There are some MP bugs in libstdc++ Makefiles
169#make -C %{gcc_target_platform}/libstdc++-v3
[109]170
[249]171#make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
172# infodir=%{buildroot}%{_infodir} install
[109]173
[249]174make DESTDIR=${RPM_BUILD_ROOT} install
[109]175
[370]176# copy runtime files
177emxomf -o i386-pc-os2-emx/libgcc/libgcc_so_d.lib i386-pc-os2-emx/libgcc/libgcc_so_d.a
[508]178#cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.a %{buildroot}%{_libdir}
179#cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.lib %{buildroot}%{_libdir}
180#cp -p i386-pc-os2-emx/libgcc/gcc%{ver_major}%{ver_minor}%{ver_patch}.dll %{buildroot}%{_libdir}
[370]181
[249]182#build dll
[370]183dllar -o stdcpp6.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/libstdc++.a \
[508]184 -d "GNU stdc++ %{version}-%{release}" \
[370]185 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
[249]186 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
187 -libf "INITINSTANCE TERMINSTANCE" \
188 -libd "DATA MULTIPLE"
[370]189cp -p stdcpp6.dll %{buildroot}%{_libdir}
190cp -p stdcpp6.a %{buildroot}%{_libdir}/stdc++.a
191cp -p stdcpp6.lib %{buildroot}%{_libdir}/stdc++.lib
192mv %{buildroot}%{_libdir}/libstdc++.a %{buildroot}%{_libdir}/stdc++_s.a
[249]193
194#build dll
[370]195dllar -o supcpp6.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/libsupc++.a \
[508]196 -d "GNU supc++ %{version}-%{release}" \
[370]197 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
[249]198 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
199 -libf "INITINSTANCE TERMINSTANCE" \
200 -libd "DATA MULTIPLE"
[370]201cp -p supcpp6.dll %{buildroot}%{_libdir}
202cp -p supcpp6.a %{buildroot}%{_libdir}/supc++.a
203cp -p supcpp6.lib %{buildroot}%{_libdir}/supc++.lib
204mv %{buildroot}%{_libdir}/libsupc++.a %{buildroot}%{_libdir}/supc++_s.a
[249]205
206#build dll
207dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
[508]208 -d "GNU Stack Protector %{version}-%{release}" \
[370]209 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
[249]210 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
211 -libf "INITINSTANCE TERMINSTANCE" \
212 -libd "DATA MULTIPLE"
213cp -p ssp.dll %{buildroot}%{_libdir}
214cp -p ssp.a %{buildroot}%{_libdir}
215cp -p ssp.lib %{buildroot}%{_libdir}
216mv %{buildroot}%{_libdir}/ssp.a %{buildroot}%{_libdir}/ssp_s.a
217
218cd ..
219
[508]220#build gccXXX forwarders
221for bld in 335 432 433 434 435 440 441 442 444 445 446 452 453 454 464 473 474 482 483 490 491 492; do
222 sed -i 's/Forwarder/Forwarder %{version}-%{release}/' gcc${bld}.def
223 gcc -Zomf -Zmap -Zdll -nostdlib -o gcc${bld}.dll gcc${bld}.def fwdstub.s obj-%{gcc_target_platform}/gcc/libgcc_so_d.a -llibc
224 cp -p gcc${bld}.dll %{buildroot}%{_libdir}
225done
226
[249]227echo dummy for virtual package > gcc-wrc.txt
228echo dummy for virtual package > gcc-wlink.txt
229
230#mkdir -p %{buildroot}%{_usr}
231
232rm %{buildroot}%{_libdir}/*.la
[370]233rm %{buildroot}%{_libdir}/*.py
[249]234
[353]235ln -s ./cc1.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/cc1
236ln -s ./cc1plus.exe %{buildroot}%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/cc1plus
[249]237
[228]238#yd fix attributes for executables
239chmod 0755 %{buildroot}%{_bindir}/*.exe
[109]240
[11]241%clean
242rm -rf %{buildroot}
243
[191]244%post wrc
245if [ "$1" = 1 ] ; then
246#execute only on first install
247%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
248%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
249%cube {ADDLINE "SET EMXOMFLD_RC=wrc.exe"} c:\config.sys > NUL
250%cube {ADDLINE "SET EMXOMFLD_RC_TYPE=WRC"} c:\config.sys > NUL
251fi
252
253%postun wrc
254if [ "$1" = 0 ] ; then
255#execute only on last uninstall
256%cube {DELLINE "SET EMXOMFLD_RC="} c:\config.sys > NUL
257%cube {DELLINE "SET EMXOMFLD_RC_TYPE="} c:\config.sys > NUL
258fi
259
260%post wlink
261if [ "$1" = 1 ] ; then
262#execute only on first install
263%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
264%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
265%cube {ADDLINE "SET EMXOMFLD_LINKER=wl.exe"} c:\config.sys > NUL
266%cube {ADDLINE "SET EMXOMFLD_TYPE=WLINK"} c:\config.sys > NUL
267fi
268
269%postun wlink
270if [ "$1" = 0 ] ; then
271#execute only on last uninstall
272%cube {DELLINE "SET EMXOMFLD_LINKER="} c:\config.sys > NUL
273%cube {DELLINE "SET EMXOMFLD_TYPE="} c:\config.sys > NUL
274fi
275
[11]276%files
277%defattr(-,root,root,-)
278%{_usr}/bin
[508]279%exclude %{_bindir}/*.dbg
[11]280%{_usr}/include
281%{_libdir}/*.*a
[249]282%{_libdir}/*.lib
[270]283%exclude %{_libdir}/*.dll
[508]284%exclude %{_libdir}/*.dbg
[11]285%{_libdir}/gcc/*
[508]286%{_libexecdir}
287%exclude %{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/*.dbg
288%exclude %{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/install-tools/*.dbg
289%{_datadir}/gcc-%{gcc_version}
290%{_datadir}/locale
291%{_datadir}/info
292%{_datadir}/man
[353]293%doc ChangeLog ChangeLog.*
294%doc README README.*
295%doc COPYING COPYING.*
296%doc MAINTAINERS
[11]297
[277]298%files -n libssp
[173]299%defattr(-,root,root,-)
300%{_libdir}/ssp.dll
[11]301
[370]302%files -n libstdc++6
[270]303%defattr(-,root,root,-)
[370]304%{_libdir}/stdcp*.dll
[270]305
[370]306%files -n libsupc++6
[270]307%defattr(-,root,root,-)
[370]308%{_libdir}/supcp*.dll
[270]309
[193]310%files wlink
311%doc gcc-wlink.txt
312
313%files wrc
314%doc gcc-wrc.txt
315
[508]316%files -n libgcc-fwd
[11]317%defattr(-,root,root,-)
[508]318%{_libdir}/gcc???.dll
[11]319
[508]320%files -n libgcc1
321%defattr(-,root,root,-)
322%{_libdir}/gcc1.dll
[370]323
[508]324%files debug
325%defattr(-,root,root)
326%{_bindir}/*.dbg
327%{_libdir}/*.dbg
328%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/*.dbg
329%{_libexecdir}/gcc/i386-pc-os2-emx/%{gcc_version}/install-tools/*.dbg
330
[11]331%changelog
[508]332* Tue Jan 30 2015 yd <yd@os2power.com> 4.9.2.1-3
333- updated source code to gcc 4.9.2.
334- create gccXXX forwarders to gcc1 runtime dll, use libc06 exports for
335 non-standard symbols.
336- use --enable-frame-pointer to disable unwinding table generation.
337- build requires patched builtin.h and stddef.h (libc-0.6.6-25).
338- use standard toolchain to build gcc runtime dll, use named exports only.
339
[370]340* Wed Nov 27 2013 yd
341- Rename the following packages to avoid ABI breaks (using gcc versioning policy):
342 + libstdc++ => libstdc++6
343 + libsupc++ => libsupc++6
344- updated source code to gcc 4.7.3.
[277]345
[357]346* Mon Jul 25 2013 Dmitriy Kuminov <coding@dmik.org> - 4.4.6.17-1
347- New OS/2 Release 17 of 4.4.6. See ChangeLog.OS2 for more information.
348
[353]349* Mon Jul 23 2013 Dmitriy Kuminov <coding@dmik.org> - 4.4.6.16-1
350- New OS/2 Release 16 of 4.4.6. See ChangeLog.OS2 for more information.
351- Rename the following packages to better match the conventions:
352 + gcc-stack-protector => libssp
353 + gcc-stdc++-shared-library => libstdc++
354 + gcc-supc++-shared-library => libsupc++
355
[275]356* Mon Jan 09 2012 yd
357- install also dlls with main package.
358
[270]359* Sun Jan 08 2012 yd
360- moved dlls out from main package.
361
[259]362* Fri Dec 23 2011 yd
363- fixed spawn internal error report.
364- fixed handling of big command lines (fixes OOo building).
365- fixed Optlink calls.
366
[249]367* Fri Dec 9 2011 yd
368- updated source code to 4.4.6, github tree
Note: See TracBrowser for help on using the repository browser.