source: spec/trunk/SPECS/gcc4.spec@ 1010

Last change on this file since 1010 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
Line 
1%define ver_major 4
2%define ver_minor 9
3%define ver_patch 2
4
5%define os2_release 1
6
7%define rpm_release 3
8
9%global gcc_version %{ver_major}.%{ver_minor}.%{ver_patch}
10%global gcc_target_platform %{_target_cpu}
11
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
21Summary: Various compilers (C, C++, Objective-C, Java, ...)
22Name: gcc
23Version: %{gcc_version}.%{os2_release}
24Release: %{rpm_release}%{?dist}
25
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
32Source0: gcc-gcc-4_9-branch-os2.tar.bz2
33Source1: gcc-libgcc-fwd.zip
34
35Obsoletes: gcc < %{gcc_version}
36
37BuildRequires: binutils make
38BuildRequires: os2-base-fhs
39BuildRequires: ash gcc gcc-wlink gcc-wrc grep gettext-devel diffutils gawk flex sed
40BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1, mpc-devel
41BuildRequires: libc-devel >= 0.6.6-25
42BuildRequires: rpm >= 4.8.1-22
43
44Requires: libgcc1 = %{version}-%{release}
45Requires: libssp = %{version}-%{release}
46Requires: libstdc++6 = %{version}-%{release}
47Requires: libsupc++6 = %{version}-%{release}
48# libc header fixes
49Requires: libc-devel >= 0.6.6-25
50# rpm color workaround
51Requires: rpm >= 4.8.1-22
52Requires: binutils
53
54%description
55The gcc package contains the GNU Compiler Collection version %{ver_major}.%{ver_minor}.
56You'll need this package in order to compile C code.
57
58%package -n libgcc-fwd
59Summary: GCC version shared support forwarder library
60Group: System Environment/Libraries
61Autoreq: false
62Obsoletes: libgcc335 libgcc432 libgcc433 libgcc434 libgcc440 libgcc441
63Obsoletes: libgcc442 libgcc444 libgcc445 libgcc446 libgcc452 libgcc453
64Obsoletes: libgcc473 libgcc490 libgcc492
65
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
76This package contains GCC shared support library which is needed
77e.g. for exception handling support.
78
79%package -n libssp
80Summary: GCC stack protector shared library
81Group: System Environment/Libraries
82Obsoletes: gcc-stack-protector
83
84%description -n libssp
85This package contains GCC shared library which is needed
86for stack protector.
87
88%package -n libstdc++6
89Summary: GNU Standard C++ Library v3
90Group: System Environment/Libraries
91
92%description -n libstdc++6
93This package contains GNU Standard C++ Library v3 shared library.
94
95%package -n libsupc++6
96Summary: GNU Standard C++ Library v3 subset
97Group: System Environment/Libraries
98
99%description -n libsupc++6
100This package contains GNU Standard C++ Library v3 subset shared library.
101
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
120%package debug
121Summary: HLL debug data for exception handling support.
122
123%description debug
124HLL debug data for exception handling support.
125
126
127%prep
128%setup -q -c -a 1
129
130
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}"
139export LIBPATHSTRICT=T
140
141export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
142export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
143export LDFLAGS="-g -Zexe -Zomf -Zmap -Zargs-wild -Zhigh-mem"
144export LANG=en_US
145export GREP=grep
146
147export PATH_SEPARATOR=;
148export CONFIG_SITE=/@unixroot/usr/share/config.legacy
149
150../configure --prefix=%{_prefix} \
151 --with-sysroot=/@unixroot \
152 --enable-shared \
153 --enable-languages=c,c++ \
154 --enable-frame-pointer \
155 --with-gnu-as \
156 --disable-bootstrap \
157 --disable-multilib \
158 --disable-libstdcxx-pch \
159 --enable-threads
160
161make %{?_smp_mflags}
162
163
164%install
165rm -rf $RPM_BUILD_ROOT
166cd obj-%{gcc_target_platform}
167
168# There are some MP bugs in libstdc++ Makefiles
169#make -C %{gcc_target_platform}/libstdc++-v3
170
171#make prefix=%{buildroot}%{_prefix} mandir=%{buildroot}%{_mandir} \
172# infodir=%{buildroot}%{_infodir} install
173
174make DESTDIR=${RPM_BUILD_ROOT} install
175
176# copy runtime files
177emxomf -o i386-pc-os2-emx/libgcc/libgcc_so_d.lib i386-pc-os2-emx/libgcc/libgcc_so_d.a
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}
181
182#build dll
183dllar -o stdcpp6.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/libstdc++.a \
184 -d "GNU stdc++ %{version}-%{release}" \
185 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
186 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
187 -libf "INITINSTANCE TERMINSTANCE" \
188 -libd "DATA MULTIPLE"
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
193
194#build dll
195dllar -o supcpp6.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/libsupc++.a \
196 -d "GNU supc++ %{version}-%{release}" \
197 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
198 -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
199 -libf "INITINSTANCE TERMINSTANCE" \
200 -libd "DATA MULTIPLE"
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
205
206#build dll
207dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
208 -d "GNU Stack Protector %{version}-%{release}" \
209 -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
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
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
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
233rm %{buildroot}%{_libdir}/*.py
234
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
237
238#yd fix attributes for executables
239chmod 0755 %{buildroot}%{_bindir}/*.exe
240
241%clean
242rm -rf %{buildroot}
243
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
276%files
277%defattr(-,root,root,-)
278%{_usr}/bin
279%exclude %{_bindir}/*.dbg
280%{_usr}/include
281%{_libdir}/*.*a
282%{_libdir}/*.lib
283%exclude %{_libdir}/*.dll
284%exclude %{_libdir}/*.dbg
285%{_libdir}/gcc/*
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
293%doc ChangeLog ChangeLog.*
294%doc README README.*
295%doc COPYING COPYING.*
296%doc MAINTAINERS
297
298%files -n libssp
299%defattr(-,root,root,-)
300%{_libdir}/ssp.dll
301
302%files -n libstdc++6
303%defattr(-,root,root,-)
304%{_libdir}/stdcp*.dll
305
306%files -n libsupc++6
307%defattr(-,root,root,-)
308%{_libdir}/supcp*.dll
309
310%files wlink
311%doc gcc-wlink.txt
312
313%files wrc
314%doc gcc-wrc.txt
315
316%files -n libgcc-fwd
317%defattr(-,root,root,-)
318%{_libdir}/gcc???.dll
319
320%files -n libgcc1
321%defattr(-,root,root,-)
322%{_libdir}/gcc1.dll
323
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
331%changelog
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
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.
345
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
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
356* Mon Jan 09 2012 yd
357- install also dlls with main package.
358
359* Sun Jan 08 2012 yd
360- moved dlls out from main package.
361
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
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.