Switch branches/tags
Nothing to show
Find file Copy path
26ef74f Apr 23, 2012
0 contributors

Users who have contributed to this file

633 lines (516 sloc) 20.4 KB
# $Owl: Owl/packages/gcc/gcc.spec,v 1.72 2012/03/03 17:35:09 solar Exp $
# The only supported frontend for now is GXX.
# Testsuite is not supported because of its requirement for additional
# packages to run (dejagnu, tcl, expect).
%define BUILD_GXX 1
%undefine _with_test
%define gcc_branch 4.7
Summary: C compiler from the GNU Compiler Collection.
Name: gcc
Version: 4.7.0
Release: owl1
Epoch: 1
License: GPLv3+
Group: Development/Languages
Source0: gcc-%version.tar.gz
# Signature:
Patch0: gcc-4.7.0-owl-defaults-Wl.diff
PreReq: /sbin/install-info
Requires: binutils
Requires: cpp = %epoch:%version-%release
Requires: libgcc >= %epoch:%version-%release
Obsoletes: egcs
BuildRequires: binutils, gettext, bison, flex, texinfo
BuildRoot: /override/%name-%version
The gcc package contains C compiler from the GNU Compiler Collection,
as well as documentation which is not limited to just the C compiler.
%package -n cpp
Summary: GNU C preprocessor.
Group: Development/Languages
PreReq: /sbin/install-info
%description -n cpp
cpp (or cccp) is the GNU C Compatible Compiler Preprocessor. cpp is a
macro processor which is used automatically by the C compiler to
transform program source before actual compilation. cpp may also be
used independently from the C compiler and the C language.
%package -n libgcc
Summary: GCC shared support library.
Group: System Environment/Libraries
PreReq: /sbin/ldconfig
%description -n libgcc
This package contains GCC shared support library which is needed
e.g. for exception handling support.
%package -n libgcc%gcc_branch-plugin-devel
Summary: GCC plugin header files.
Group: Development/Libraries
Provides: libgcc-plugin-devel = %version-%release
%description -n libgcc%gcc_branch-plugin-devel
This package contains header files required to build GCC plugins.
%package c++
Summary: C++ support for gcc.
Group: Development/Languages
Requires: gcc = %epoch:%version-%release, cpp = %epoch:%version-%release
Obsoletes: egcs-c++
%description c++
This package contains the C++ compiler from the GNU Compiler Collection.
It includes support for most of the current C++ specification, including
templates and exception handling. It does include the static standard
C++ library and C++ header files. The library for dynamically linking
programs is available as a separate binary package.
%package -n libstdc++
Summary: GNU C++ library.
Group: System Environment/Libraries
PreReq: /sbin/ldconfig
Requires: libgcc >= %epoch:%version-%release
Obsoletes: gcc-libstdc++
%description -n libstdc++
The libstdc++ package contains the GCC Standard C++ Library.
%package -n libstdc++-devel
Summary: Header files and libraries for C++ development.
Group: Development/Libraries
Requires: libstdc++ = %epoch:%version-%release
Obsoletes: gcc-libstdc++-devel
%description -n libstdc++-devel
Header files and libraries needed for C++ development.
# OpenMP library
%package -n libgomp%gcc_branch
Summary: GCC OpenMP shared support library.
Group: System/Libraries
Provides: libgomp = %version-%release
Provides: libgomp4.1 = %version-%release
Provides: libgomp4.3 = %version-%release
Provides: libgomp4.4 = %version-%release
Obsoletes: libgomp4.1, libgomp4.3 libgomp4.4
Conflicts: libgomp > %version
%description -n libgomp%gcc_branch
This package contains GCC OpenMP shared support library.
%package -n libgomp%gcc_branch-devel
Summary: GCC OpenMP support files.
Group: Development/Libraries
Provides: libgomp-devel = %version-%release
Requires: libgomp%gcc_branch >= %version-%release
Requires: glibc-devel
%description -n libgomp%gcc_branch-devel
This package contains GCC OpenMP headers and library.
# mudflap library
%package -n libmudflap%gcc_branch
Summary: GCC mudflap shared support libraries.
Group: System/Libraries
Provides: libmudflap = %version-%release
Provides: libmudflap4.1 = %version-%release
Provides: libmudflap4.3 = %version-%release
Provides: libmudflap4.4 = %version-%release
Obsoletes: libmudflap4.1, libmudflap4.3 libmudflap4.4
Conflicts: libmudflap > %version
%description -n libmudflap%gcc_branch
This package contains GCC shared support libraries which are needed for
mudflap support.
%package -n libmudflap%gcc_branch-devel
Summary: GCC mudflap support files.
Group: Development/Libraries
Provides: libmudflap-devel = %version-%release
Requires: libmudflap%gcc_branch >= %version-%release
Requires: glibc-devel
%description -n libmudflap%gcc_branch-devel
This package contains headers and libraries for building mudflap-instrumented
To instrument a non-threaded program, add -fmudflap option to GCC and
when linking add -lmudflap, for threaded programs also add -fmudflapth
and -lmudflapth.
%setup -q
%{?_with_test:%setup -q -T -D -b 6}
%patch0 -p1
# Use %%optflags_lib for this entire package until we figure out how to
# properly have just gcc's libraries built with a separate set of flags.
%{expand:%%define optflags %{?optflags_lib:%optflags_lib}%{!?optflags_lib:%optflags}}
# Rebuild configure(s) and Makefile(s) if templates are newer...
for f in */acinclude.m4; do
pushd "${f%%/*}"
# Run aclocal & autoconf only if files aclocal.m4 and exist
# and acinclude.m4 is newer than aclocal.m4.
if [ -f aclocal.m4 -a -f -a acinclude.m4 -nt aclocal.m4 ]
for f in */; do
pushd "${f%%/*}"
[ -nt ] && automake
%ifarch sparcv9
%define _target_platform sparc-%_vendor-%_target_os
# We will build this software outside source tree as recommended by INSTALL/*
rm -rf obj-%_target_platform
mkdir obj-%_target_platform
cd obj-%_target_platform
../configure \
--prefix=%_prefix \
--exec-prefix=%_exec_prefix \
--bindir=%_bindir \
--libdir=%_libdir \
--libexecdir=%_libdir \
--with-slib=/%_lib \
--infodir=%_infodir \
--mandir=%_mandir \
--enable-shared \
--enable-threads=posix \
--disable-option-checking \
--enable-nls \
--enable-c-mbchar \
--enable-long-long \
--enable-__cxa_atexit \
--disable-multilib \
--host=%_target_platform \
--build=%_target_platform \
--disable-bootstrap \
--with-gxx-include-dir=%_includedir/c++/%version \
%endif # BUILD_GXX
--disable-libstdcxx-pch \
%endif # BUILD_GXX
--target=%_target_platform \
# --prefix=/usr \
# --libexecdir=/usr/lib \
# --enable-shared \
# --enable-threads=posix \
# --enable-__cxa_atexit \
# --enable-clocale=gnu \
# --enable-languages=c,c++ \
# --disable-multilib \
# --disable-bootstrap \
# --with-system-zlib
# Let's compile the thing
# STAGE1_CFLAGS is used for stage1 compiler
# BOOT_FLAGS is used for stage2..n compiler
# ..._FOR_TARGET is used for final compiler
#%__make bootstrap-lean \
STAGE1_CFLAGS="-O -fomit-frame-pointer" \
BOOT_CFLAGS="-O -fomit-frame-pointer" \
# Copy various doc files here and there.
cd ..
mkdir -p rpm-doc/gcc
install -pm 644 -p gcc/ChangeLog rpm-doc/gcc/
#install -pm 644 -p BUGS COPYING* FAQ MAINTAINERS README* gcc/SERVICE rpm-doc/gcc/
install -pm 644 -p COPYING* MAINTAINERS README* rpm-doc/gcc/
mkdir -p rpm-doc/g++
install -pm 644 -p gcc/cp/{ChangeLog,NEWS} rpm-doc/g++/
mkdir -p rpm-doc/libstdc++
install -pm 644 -p libstdc++-v3/{ChangeLog,README} rpm-doc/libstdc++/
find rpm-doc -type f \( -iname '*changelog*' -not -name '*.bz2' \) -print0 |
xargs -r0 bzip2 -9 --
rm -rf %buildroot
%__make -C obj-%_target_platform DESTDIR=%buildroot install
# Relocate libgcc shared library from %_libdir/ to /%_lib/.
mkdir %buildroot/%_lib
mv %buildroot%_libdir/ %buildroot/%_lib/
ln -s ../../../../../%_lib/ \
#rm %buildroot%_libdir/
# Fix some things.
ln -s gcc %buildroot%_bindir/cc
echo ".so gcc.1" > %buildroot%_mandir/man1/cc.1
echo ".so g++.1" > %buildroot%_mandir/man1/c++.1
# Remove unpackaged files
rm %buildroot%_infodir/dir
rm %buildroot%_infodir/*
rm %buildroot%_libdir/libiberty.a
rm -f %buildroot%_libdir/*.la
%find_lang cpplib
%find_lang gcc
# autogen is needed for this
# %check
# cd obj-%_target_platform
# %__make -k check
# cd -
/sbin/install-info --info-dir=%_infodir %_infodir/
/sbin/install-info --info-dir=%_infodir %_infodir/
chmod -R go+rX %_libdir/gcc/%_target_platform/%version/include/*
if [ $1 -eq 0 ]; then
/sbin/install-info --delete --info-dir=%_infodir %_infodir/
/sbin/install-info --delete --info-dir=%_infodir %_infodir/
if [ -d %_libdir/gcc/%_target_platform/%version/include ]; then
rm -rf %_libdir/gcc/%_target_platform/%version/include/*
%post -n libgcc -p /sbin/ldconfig
%postun -n libgcc -p /sbin/ldconfig
%post -n cpp
/sbin/install-info --info-dir=%_infodir %_infodir/
/sbin/install-info --info-dir=%_infodir %_infodir/
%preun -n cpp
if [ $1 -eq 0 ]; then
/sbin/install-info --delete --info-dir=%_infodir %_infodir/
/sbin/install-info --delete --info-dir=%_infodir %_infodir/
%post -n libstdc++ -p /sbin/ldconfig
%postun -n libstdc++ -p /sbin/ldconfig
%files -f gcc.lang
%dir %_libdir/gcc
%dir %_libdir/gcc/%_target_platform
%dir %_libdir/gcc/%_target_platform/%version
%doc rpm-doc/gcc/*
%exclude %_libdir/gcc/%_target_platform/%version/*.la
%files -n cpp
%dir %_libdir/gcc
%dir %_libdir/gcc/%_target_platform
%files -n libgcc
%files c++ -f cpplib.lang
%dir %_libdir/gcc
%dir %_libdir/gcc/%_target_platform
%doc rpm-doc/g++/*
%files -n libstdc++
%doc rpm-doc/libstdc++/*
%doc libstdc++-v3/doc/html
%exclude %_datadir/gcc-%version/python
%files -n libstdc++-devel
%files -n libgcc%gcc_branch-plugin-devel
%files -n libgomp%gcc_branch
%files -n libmudflap%gcc_branch
%files -n libgomp%gcc_branch-devel
%dir %_libdir/gcc/%_target_platform/%version
%dir %_libdir/gcc/%_target_platform/%version/include
%dir %_libdir/gcc/%_target_platform/%version
%files -n libmudflap%gcc_branch-devel
%dir %_libdir/gcc/%_target_platform/%version
%dir %_libdir/gcc/%_target_platform/%version/include
%dir %_libdir/gcc/%_target_platform/%version
* Sat Mar 03 2012 Solar Designer <> 1:4.6.3-owl1
- Updated to 4.6.3.
* Sat Feb 18 2012 Solar Designer <> 1:4.6.2-owl4
- Revised the texinfo documentation patch on our use of -Wl,-z,relro and
-Wl,-z,now, and on how to disable these.
- List the plugin directory instead of just plugin/include in file lists;
otherwise the plugin directory is not owned by any package and is thus not
removed on gcc version upgrade (e.g., it was not on 4.6.1 to 4.6.2 upgrade).
* Sun Feb 12 2012 Vasiliy Kulikov <> 1:4.6.2-owl3
- Enabled -Wl,-z,relro and -Wl,-z,now by default. In most cases the
performance impact is negligible. To disable them in cases where it is not
(or for any other reason), pass -Wl,-z,norelro and -Wl,-z,lazy to gcc,
respectively. Note: ld still uses -z norelro and -z lazy by default; only
gcc's defaults are changed.
* Fri Nov 04 2011 Solar Designer <> 1:4.6.2-owl2
- Use %%optflags_lib for this entire package until we figure out how to
properly have just gcc's libraries built with a separate set of flags.
- Added %defattr(-,root,root) to several subpackages that are new with the
update to 4.6.
- Do package the symlink.
* Sat Oct 29 2011 Vasiliy Kulikov <> 1:4.6.2-owl1
- Updated to 4.6.2.
* Fri Oct 21 2011 Vasiliy Kulikov <> 1:4.6.1-owl1
- Updated to 4.6.1.
* Wed Dec 01 2010 Vasiliy Kulikov <> 1:3.4.5-owl5
- Fixed build bug with binutils 2.20.
* Fri Nov 20 2009 Solar Designer <> 1:3.4.5-owl4
- Disabled building of V2 and V3 compat subpackages (gcc 2.x'ish libstdc++).
* Wed May 27 2009 Dmitry V. Levin <> 1:3.4.5-owl3
- Disabled unused libstdc++ precompiled header files.
* Fri Feb 03 2006 Dmitry V. Levin <> 1:3.4.5-owl2
- Dropped old ChangeLog files, compressed the remaining ChangeLog files.
* Wed Dec 21 2005 Dmitry V. Levin <> 1:3.4.5-owl1
- Updated to 3.4.5.
- Packaged libgcc shared library in separate subpackage.
* Tue Dec 13 2005 Dmitry V. Levin <> 1:3.4.3-owl5
- Corrected interpackage dependencies.
* Sun Oct 23 2005 (GalaxyMaster) <> 1:3.4.3-owl4
- Added sed to Requires(post), since we are using sed in mkheaders;
commented out this Requires(post), since we will use this spec with RPM3.
- Added BuildRequires as suggested by kad@.
- Added a missing requirement for libstdc++ to libstdc++-devel.
* Fri Sep 23 2005 Michail Litvak <> 1:3.4.3-owl3
- Don't package .la files.
* Wed Jan 19 2005 Solar Designer <> 1:3.4.3-owl2
- Provide/obsolete libstdc++-compat in libstdc++-v3-compat.
- Restored the cc(1) and c++(1) man pages.
* Fri Jan 14 2005 (GalaxyMaster) <> 1:3.4.3-owl1
- Reverted the change with removing symbolic links from gcc to cc.
- Fixed missed compile flags for target compiler.
* Thu Jan 06 2005 (GalaxyMaster) <> 1:3.4.3-owl0
- Updated to 3.4.3.
- Enabled autotools magic, it works as expected.
- Added libstdc++ compatible libraries for glibc 3.2.2 based builds.
- Added BUILD_CXX_COMPAT_* macros to control building of compatibility
packages. I hope that after next release of Owl we will drop this crap.
- Spec was revised and cleaned up.
* Fri Jul 16 2004 (GalaxyMaster) <> 1:3.4.1-owl0
- Updated to 3.4.1.
* Thu Jun 04 2004 (GalaxyMaster) <> 1:3.4.0-owl0.2
- Updated to 3.4.0.
- Tested only C and C++ compilers, ObjC has compilation issues when using
Boehm GC, Ada unsupported by this build.
* Tue May 25 2004 (GalaxyMaster) <> 1:3.2.2-owl1.6
- Fixed a typo in spec file.
* Tue Apr 20 2004 (GalaxyMaster) <> 1:3.2.2-owl1.5
- Additional optimization fixes for build process (using STAGE1_CFLAGS and
- Moved extraction of '-fno-rtti' to CXXFLAGS, because this is C++ options.
* Fri Apr 16 2004 (GalaxyMaster) <> 1:3.2.2-owl1.4
- Removed extra_c_flags and "XXX:" comment from spec file.
- Passing "-O -fomit-frame-pointers" in CFLAGS variable to improve build times.
* Thu Feb 26 2004 (GalaxyMaster) <> 1:3.2.2-owl1.3
- Removed wchar patch as we are building against glibc 2.3.2.
* Thu Feb 26 2004 (GalaxyMaster) <> 1:3.2.2-owl1.2
- Temporarily disabled regeneration of configure due to conflict with new
* Mon Feb 23 2004 (GalaxyMaster) <> 1:3.2.2-owl1.1
- Fixed permission of %_libdir/gcc-lib/%_target_platform/%version/include/*
- Removed unpackaged files to make RPM4 happy. :)
* Thu Feb 05 2004 Solar Designer <> 1:3.2.2-owl1
- Added libstdc++ compatibility libraries for gcc 2.95.3 as a separate
source tarball.
* Tue Feb 03 2004 (GalaxyMaster) <> 1:3.2.2-owl0.3
- Cleaned up the spec file (reordered scripts & files sections).
- Avoid using of subshells in build section to not mask possible errors.
* Mon Feb 02 2004 (GalaxyMaster) <> 1:3.2.2-owl0.2
- Added a patch to enable limited wchar support.
* Fri Jan 30 2004 (GalaxyMaster) <> 1:3.2.2-owl0.1
- Updated to 3.2.2 version.
* Mon Aug 19 2002 Michail Litvak <> 1:2.95.3-owl5
- Deal with info dir entries such that the menu looks pretty.
* Fri Jun 21 2002 Solar Designer <>
- Provide a cc(1) man page.
* Tue May 28 2002 Solar Designer <>
- Don't override the linker's default library path for elf32_sparc, place
/lib64 before /usr/lib64 in the path for elf64_sparc; this is needed to
support dynamic linking with libraries from packages which only place the
.so's in /lib (/lib64), not /usr/lib (/usr/lib64).
* Sat May 25 2002 Solar Designer <>
- Do use some optimization when building the stage1 compiler to make our gcc
builds faster.
* Tue Jan 29 2002 Solar Designer <>
- Enforce our new spec file conventions (but more cleanups are still needed).
- Dropped the 2.95.2-specific patches entirely.
* Sun Mar 18 2001 Solar Designer <>
- Updated to 2.95.3.
- Dropped the duplicate_decls() patch (included in 2.95.3).
- Various spec file cleanups (use the ix86 macro, avoid subshells).
* Fri Nov 17 2000 Solar Designer <>
- No pthreads on sparcv9, not just on plain sparc.
- Pass plain sparc- target to configure when building for sparcv9, to
allow for the use of sparcv9 optflags while not confusing configure.
- Check for __arch64__ rather than __sparc_v9__ in limits.h.
- %%defattr(-,root,root) for all architectures, not just x86 and alpha
(no idea why this was restricted).
* Wed Nov 08 2000 Solar Designer <>
- Added a patch for copying of DECL_MODE in duplicate_decls(), by
Richard Henderson (
* Sun Oct 29 2000 Solar Designer <>
- libstdc++-compat is for x86 only, corrected the %ifarch's.
* Sat Oct 21 2000 Alexandr D. Kanevskiy <>
- texconfig bug hack
* Fri Oct 20 2000 Alexandr D. Kanevskiy <>
- disable dvi generation
* Fri Aug 25 2000 Alexandr D. Kanevskiy <>
- removed make -j
* Sat Jul 29 2000 Alexandr D. Kanevskiy <>
- spec cleanup.
- duplicate file fix.
* Sun Jul 09 2000 Alexandr D. Kanevskiy <>
- Imported from RH.