Ignore:
Timestamp:
Feb 1, 2015, 11:35:01 PM (11 years ago)
Author:
Yuri Dario
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • spec/trunk/SPECS/gcc4.spec

    r370 r508  
    11%define ver_major   4
    2 %define ver_minor   7
    3 %define ver_patch   3
     2%define ver_minor   9
     3%define ver_patch   2
    44
    55%define os2_release 1
    66
    7 %define rpm_release 1
     7%define rpm_release 3
    88
    99%global gcc_version %{ver_major}.%{ver_minor}.%{ver_patch}
     
    3030URL: http://gcc.gnu.org
    3131
    32 Source0: gcc-gcc-4_7-branch-os2.zip
    33 Patch0: gcc-os2.diff
     32Source0: gcc-gcc-4_9-branch-os2.tar.bz2
     33Source1: gcc-libgcc-fwd.zip
    3434
    3535Obsoletes: gcc < %{gcc_version}
     
    3939BuildRequires: ash gcc gcc-wlink gcc-wrc grep gettext-devel diffutils gawk flex sed
    4040BuildRequires: gmp-devel >= 4.1.2-8, mpfr-devel >= 2.2.1, mpc-devel
    41 
    42 Requires: libgcc%{ver_major}%{ver_minor}%{ver_patch} = %{version}-%{release}
     41BuildRequires: libc-devel >= 0.6.6-25
     42BuildRequires: rpm >= 4.8.1-22
     43
     44Requires: libgcc1 = %{version}-%{release}
    4345Requires: libssp = %{version}-%{release}
    4446Requires: libstdc++6 = %{version}-%{release}
    4547Requires: libsupc++6 = %{version}-%{release}
    46 Requires: libc-devel >= 0.6.3
     48# libc header fixes
     49Requires: libc-devel >= 0.6.6-25
     50# rpm color workaround
     51Requires: rpm >= 4.8.1-22
    4752Requires: binutils
    4853
     
    5156You'll need this package in order to compile C code.
    5257
    53 %package -n libgcc%{ver_major}%{ver_minor}%{ver_patch}
    54 Summary: GCC version %{ver_major}.%{ver_minor} shared support library
     58%package -n libgcc-fwd
     59Summary: GCC version shared support forwarder library
    5560Group: System Environment/Libraries
    5661Autoreq: false
    57 
    58 %description -n libgcc%{ver_major}%{ver_minor}%{ver_patch}
     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
    5976This package contains GCC shared support library which is needed
    6077e.g. for exception handling support.
     
    101118resource compiler instead of IBM one.
    102119
     120%package debug
     121Summary: HLL debug data for exception handling support.
     122
     123%description debug
     124HLL debug data for exception handling support.
     125
     126
    103127%prep
    104 %setup -q -c
    105 %patch0 -p1 -b .os2~
     128%setup -q -c -a 1
     129
    106130
    107131%build
     
    113137export PATH="$script_dir/gcc${PATH:+;$PATH}"
    114138export BEGINLIBPATH="$script_dir/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
    115 
    116 export CONFIG_SHELL=%{_bindir}/sh.exe
     139export LIBPATHSTRICT=T
     140
    117141export CFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
    118142export CXXFLAGS="$RPM_OPT_FLAGS -DEMX -DOS2"
     
    121145export GREP=grep
    122146
     147export PATH_SEPARATOR=;
     148export CONFIG_SITE=/@unixroot/usr/share/config.legacy
     149
    123150../configure --prefix=%{_prefix} \
    124151    --with-sysroot=/@unixroot \
    125152    --enable-shared \
    126153    --enable-languages=c,c++ \
     154    --enable-frame-pointer \
    127155    --with-gnu-as \
    128156    --disable-bootstrap \
     
    131159    --enable-threads
    132160
    133 make
    134 # %{?_smp_mflags}
     161make %{?_smp_mflags}
    135162
    136163
    137164%install
    138165rm -rf $RPM_BUILD_ROOT
    139 
    140166cd obj-%{gcc_target_platform}
    141167
     
    150176# copy runtime files
    151177emxomf -o i386-pc-os2-emx/libgcc/libgcc_so_d.lib i386-pc-os2-emx/libgcc/libgcc_so_d.a
    152 cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.a %{buildroot}%{_libdir}
    153 cp -p i386-pc-os2-emx/libgcc/libgcc_so_d.lib %{buildroot}%{_libdir}
    154 cp -p i386-pc-os2-emx/libgcc/gcc%{ver_major}%{ver_minor}%{ver_patch}.dll %{buildroot}%{_libdir}
     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}
    155181
    156182#build dll
    157183dllar -o stdcpp6.dll i386-pc-os2-emx/libstdc++-v3/src/.libs/libstdc++.a \
    158         -d "GNU stdc++ %{gcc_version}" \
     184        -d "GNU stdc++ %{version}-%{release}" \
    159185        -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
    160186        -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
     
    168194#build dll
    169195dllar -o supcpp6.dll i386-pc-os2-emx/libstdc++-v3/libsupc++/.libs/libsupc++.a \
    170         -d "GNU supc++ %{gcc_version}" \
     196        -d "GNU supc++ %{version}-%{release}" \
    171197        -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
    172198        -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
     
    180206#build dll
    181207dllar -o ssp.dll i386-pc-os2-emx/libssp/.libs/ssp.a \
    182         -d "GNU Stack Protector %{gcc_version}" \
     208        -d "GNU Stack Protector %{version}-%{release}" \
    183209        -nolxlite -flags "-Zmap -Zhigh-mem -Zomf -g -L%{buildroot}%{_libdir}" \
    184210        -ex "___main ___do_global_* ___ctordtor* ___eh* ___pop* _DLL_InitTerm" \
     
    192218cd ..
    193219
     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
    194227echo dummy for virtual package > gcc-wrc.txt
    195228echo dummy for virtual package > gcc-wlink.txt
     
    244277%defattr(-,root,root,-)
    245278%{_usr}/bin
     279%exclude %{_bindir}/*.dbg
    246280%{_usr}/include
    247281%{_libdir}/*.*a
    248282%{_libdir}/*.lib
    249283%exclude %{_libdir}/*.dll
    250 %{_libdir}/*.spec
     284%exclude %{_libdir}/*.dbg
    251285%{_libdir}/gcc/*
    252 %{_usr}/libexec
    253 %{_usr}/share
     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
    254293%doc ChangeLog ChangeLog.*
    255294%doc README README.*
     
    275314%doc gcc-wrc.txt
    276315
    277 %files -n libgcc%{ver_major}%{ver_minor}%{ver_patch}
    278 %defattr(-,root,root,-)
    279 %{_libdir}/gcc%{ver_major}%{ver_minor}%{ver_patch}.dll
    280 
     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
    281330
    282331%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
    283340* Wed Nov 27 2013 yd
    284341- Rename the following packages to avoid ABI breaks (using gcc versioning policy):
Note: See TracChangeset for help on using the changeset viewer.