Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > c4f24de04c9cad504eebec0113f4e04c > files > 9

binutils-2.18.50.0.3-1mnb1.src.rpm

# RH 2.17.50.0.8-2, SuSE 2.13.90.0.18-6
%define name		%{package_prefix}binutils
%define version		2.18.50.0.3
%define rel		1
%define release		%manbo_mkrel %{rel}

%define lib_major	2
%define lib_name_orig	%{package_prefix}%mklibname binutils
%define lib_name	%{lib_name_orig}%{lib_major}

# Allow SPU support for native PowerPC arches, not cross env packages
%define spu_arches	ppc ppc64

# Define if building a cross-binutils
%define build_cross	0
%{expand: %{?cross:	%%global build_cross 1}}

%if %{build_cross}
%define target_cpu	%{cross}
%define target_platform	%{target_cpu}-linux
%if "%{target_cpu}" == "spu"
%define target_platform	%{target_cpu}-unknown-elf
%endif
%define program_prefix	%{target_platform}-
%define package_prefix	cross-%{target_cpu}-
%else
%define target_cpu	%{_target_cpu}
%define target_platform	%{_target_platform}
%define program_prefix	%{nil}
%define package_prefix	%{nil}
%endif

%define arch		%(echo %{target_cpu}|sed -e "s/\(i.86\|athlon\)/i386/" -e "s/amd64/x86_64/" -e "s/\(sun4.*\|sparcv[89]\)/sparc/")
%define isarch()	%(case %{arch} in (%1) echo 1;; (*) echo 0;; esac)

Summary:	GNU Binary Utility Development Utilities
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	GPL
Group:		Development/Other
URL:		http://sources.redhat.com/binutils/
Source0:	http://ftp.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
Source1:	build_cross_binutils.sh
Source2:	spu_ovl.o
Source3:	embedspu.sh
Buildroot:	%{_tmppath}/%{name}-%{version}-root
%if "%{name}" == "binutils"
Requires:	%{lib_name} = %{version}-%{release}
Requires(post):	info-install
Requires(preun):info-install
%endif
Conflicts:	gcc-c++ < 3.2.3-1mdk
BuildRequires:	autoconf automake bison flex gcc gettext texinfo
BuildRequires:	dejagnu
# make check'ing requires libdl.a
BuildRequires:	glibc-static-devel

# Fedora patches:
Patch1:		binutils-2.18.50.0.3-ltconfig-multilib.patch
Patch2:		binutils-2.18.50.0.3-ppc64-pie.patch
Patch3:		binutils-2.18.50.0.3-place-orphan.patch
Patch4:		binutils-2.18.50.0.3-ia64-lib64.patch
Patch5:		binutils-2.18.50.0.3-build-fixes.patch
Patch6:		binutils-2.18.50.0.3-symbolic-envvar-revert.patch
# We don't want this one!
#Patch7:	binutils-2.18.50.0.3-version.patch

# Mandriva patches
Patch21:	binutils-2.18.50.0.3-linux32.patch

%description
Binutils is a collection of binary utilities, including:

   * ar: creating modifying and extracting from archives
   * nm: for listing symbols from object files
   * objcopy: for copying and translating object files
   * objdump: for displaying information from object files
   * ranlib: for generating an index for the contents of an archive
   * size: for listing the section sizes of an object or archive file
   * strings: for listing printable strings from files
   * strip: for discarding symbols (a filter for demangling encoded C++ symbols
   * addr2line: for converting addresses to file and line
   * nlmconv: for converting object code into an NLM

Install binutils if you need to perform any of these types of actions on
binary files.  Most programmers will want to install binutils.

%package -n	spu-binutils
Summary:	GNU Binary Utility Development Utilities for Cell SPU
Group:		Development/Other
Requires:	%{lib_name} = %{version}-%{release}

%description -n	spu-binutils
This package contains the binutils with Cell SPU support.

%package -n	%{lib_name}
Summary:	Main library for %{name}
Group:		Development/Other
Provides:	%{lib_name_orig}

%description -n	%{lib_name}
This package contains the library needed to run programs dynamically
linked with binutils.

%package -n	%{lib_name}-devel
Summary:	Main library for %{name}
Group:		Development/Other
Requires:	%{lib_name} = %{version}-%{release}
Provides:	%{lib_name_orig}-devel, %{name}-devel

%description -n	%{lib_name}-devel
This package contains the library needed to run programs dynamically
linked with binutils.

This is the development headers for %{lib_name}

%prep
%setup -q -n binutils-%{version}
%patch1 -p0 -b .ltconfig-multilib~
%patch2 -p0 -b .ppc64-pie~
%patch3 -p0 -b .place-orphan~
%ifarch ia64
%if "%{_lib}" == "lib64"
%patch4 -p0 -b .ia64-lib64~
%endif
%endif
%patch5 -p0 -b .build-fixes~
%patch6 -p0 -b .symbolic-envvar-revert~

%patch21 -p1 -b .linux32

# for boostrapping, can be rebuilt afterwards in --enable-maintainer-mode
cp %{SOURCE2} ld/emultempl/

%build
# Additional targets
ADDITIONAL_TARGETS=""
case %{target_cpu} in
ppc | powerpc)
  ADDITIONAL_TARGETS="powerpc64-%{_target_vendor}-%{_target_os}"
  ;;
ppc64)
  ADDITIONAL_TARGETS=""
  ;;
ia64)
  ADDITIONAL_TARGETS="i586-%{_target_vendor}-%{_target_os}"
  ;;
i*86 | athlon*)
  ADDITIONAL_TARGETS="x86_64-%{_target_vendor}-%{_target_os}"
  ;;
sparc*)
  ADDITIONAL_TARGETS="sparc64-%{_target_vendor}-%{_target_os}"
  ;;
esac
%ifarch %{spu_arches}
if [[ -n "$ADDITIONAL_TARGETS" ]]; then
  ADDITIONAL_TARGETS="$ADDITIONAL_TARGETS,spu-unknown-elf"
else
  ADDITIONAL_TARGETS="spu-unknown-elf"
fi
%endif
if [[ -n "$ADDITIONAL_TARGETS" ]]; then
  TARGET_CONFIG="$TARGET_CONFIG --enable-targets=$ADDITIONAL_TARGETS"
fi

case %{target_cpu} in
ppc | powerpc | i*86 | athlon* | sparc*)
  TARGET_CONFIG="$TARGET_CONFIG --enable-64-bit-bfd"
  ;;
esac

%if "%{name}" != "binutils"
%define _program_prefix %{program_prefix}
TARGET_CONFIG="$TARGET_CONFIG --target=%{target_platform}"
%endif

# Don't build shared libraries in cross binutils
%if "%{name}" == "binutils"
TARGET_CONFIG="$TARGET_CONFIG --enable-shared"
%endif

# Binutils comes with its own custom libtool
# [gb] FIXME: but system libtool also works and has relink fix
%define __libtoolize /bin/true

# Build with -Wno-error
export CFLAGS="$RPM_OPT_FLAGS -Wno-error"

# Build main binaries
rm -rf objs
mkdir objs
pushd objs
CONFIGURE_TOP=.. %configure $TARGET_CONFIG
%make tooldir=%{_prefix}
popd

# Build alternate binaries (spu-gas in particular)
case "$ADDITIONAL_TARGETS," in
%ifarch %{spu_arches}
*spu-*-elf,*)
  ALTERNATE_TARGETS="spu-unknown-elf"
  ;;
%endif
*)
  ;;
esac
if [[ -n "$ALTERNATE_TARGETS" ]]; then
  for target in $ALTERNATE_TARGETS; do
    cpu=`echo "$target" | sed -e "s/-.*//"`
    rm -rf objs-$cpu
    mkdir objs-$cpu
    pushd objs-$cpu
    CONFIGURE_TOP=.. %configure --enable-shared --target=$target --program-prefix=$cpu-
    # make sure we use the fully built libbfd & libopcodes libs
    # XXX could have been simpler to just pass $ADDITIONAL_TARGETS
    # again to configure and rebuild all of those though...
    for dso in bfd opcodes; do
    %make all-$dso
    rm -f $dso/.libs/lib$dso-%{version}.so
    ln -s ../../../objs/$dso/.libs/lib$dso-%{version}.so $dso/.libs/
    done
    %make all-binutils all-gas all-ld
    popd
  done
fi

%check
# All Tests must pass on x86 and x86_64
echo ====================TESTING=========================
%if %isarch i386|x86_64|ppc|ppc64|spu
%make -C objs check
[[ -d objs-spu ]] && \
%make -C objs-spu check-gas
%else
%make -C objs -k check || echo make check failed
%endif
echo ====================TESTING END=====================

logfile="%{name}-%{version}-%{release}.log"
rm -f $logfile; find . -name "*.sum" | xargs cat >> $logfile

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
%makeinstall_std -C objs

%if "%{name}" == "binutils"
make -C objs prefix=$RPM_BUILD_ROOT%{_prefix} infodir=$RPM_BUILD_ROOT%{_infodir} install-info
install -m 644 include/libiberty.h $RPM_BUILD_ROOT%{_includedir}/
# Ship with the PIC libiberty
install -m 644 objs/libiberty/pic/libiberty.a $RPM_BUILD_ROOT%{_libdir}/
rm -rf $RPM_BUILD_ROOT%{_prefix}/%{_target_platform}/
%else
rm -f  $RPM_BUILD_ROOT%{_libdir}/libiberty.a
rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -rf $RPM_BUILD_ROOT%{_prefix}/%{target_platform}/lib/ldscripts/
rm -f  $RPM_BUILD_ROOT%{_prefix}/%{_target_platform}/%{target_cpu}-linux/lib/*.la
%endif

rm -f $RPM_BUILD_ROOT%{_mandir}/man1/{dlltool,nlmconv,windres}*
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
#rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/

%find_lang binutils
%find_lang gas
%find_lang ld
%find_lang gprof
cat gas.lang >> binutils.lang
cat ld.lang >> binutils.lang
cat gprof.lang >> binutils.lang

%find_lang opcodes
%find_lang bfd
cat opcodes.lang >> libbinutils.lang
cat bfd.lang >> libbinutils.lang

# Alternate binaries
[[ -d objs-spu ]] && {
destdir=`mktemp -d`
make -C objs-spu DESTDIR=$destdir install-binutils install-gas install-ld
mv $destdir%{_bindir}/spu-* $RPM_BUILD_ROOT%{_bindir}/
mkdir -p $RPM_BUILD_ROOT%{_prefix}/spu/bin
mv $destdir%{_prefix}/spu-unknown-elf/bin/* $RPM_BUILD_ROOT%{_prefix}/spu/bin/
rm -rf $destdir
cat > $RPM_BUILD_ROOT%{_bindir}/ppu-as << EOF
#!/bin/sh
exec %{_bindir}/as -mcell -maltivec \${1+"\$@"}
EOF
chmod +x $RPM_BUILD_ROOT%{_bindir}/ppu-as
install -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/embedspu
}

%clean
rm -rf $RPM_BUILD_ROOT

%if "%{name}" == "binutils"
%post
%_install_info as.info
%_install_info bfd.info
%_install_info binutils.info
%_install_info gasp.info
%_install_info gprof.info
%_install_info ld.info
%_install_info standards.info
%endif

%if "%{name}" == "binutils"
%preun
%_remove_install_info as.info
%_remove_install_info bfd.info
%_remove_install_info binutils.info
%_remove_install_info gasp.info
%_remove_install_info gprof.info
%_remove_install_info ld.info
%_remove_install_info standards.info
%endif

%post -n %{lib_name} -p /sbin/ldconfig
%postun -n %{lib_name} -p /sbin/ldconfig

%files -f binutils.lang
%defattr(-,root,root)
%doc README
%{_bindir}/%{program_prefix}addr2line
%{_bindir}/%{program_prefix}ar
%{_bindir}/%{program_prefix}as
%{_bindir}/%{program_prefix}c++filt
%{_bindir}/%{program_prefix}gprof
%{_bindir}/%{program_prefix}ld
%{_bindir}/%{program_prefix}nm
%{_bindir}/%{program_prefix}objcopy
%{_bindir}/%{program_prefix}objdump
%{_bindir}/%{program_prefix}ranlib
%{_bindir}/%{program_prefix}readelf
%{_bindir}/%{program_prefix}size
%{_bindir}/%{program_prefix}strings
%{_bindir}/%{program_prefix}strip
%ifarch %{spu_arches}
%{_bindir}/ppu-as
%endif
%{_mandir}/man1/*
%if "%{name}" == "binutils"
%{_infodir}/*info*
%else
%{_prefix}/%{target_platform}/bin/*
%endif

%ifarch %{spu_arches}
%files -n spu-binutils
%defattr(-,root,root)
%doc README
%{_bindir}/spu-*
%{_bindir}/embedspu
%dir %{_prefix}/spu/bin
%{_prefix}/spu/bin
%endif

%if "%{name}" == "binutils"
%files -n %{lib_name} -f libbinutils.lang
%defattr(-,root,root)
%doc README
%{_libdir}/libbfd-%{version}*.so
%{_libdir}/libopcodes-%{version}*.so
%endif

%if "%{name}" == "binutils"
%files -n %{lib_name}-devel
%defattr(-,root,root)
%doc README
%{_includedir}/*
%{_libdir}/libbfd.a
%{_libdir}/libbfd.so
%{_libdir}/libopcodes.a
%{_libdir}/libopcodes.so
%{_libdir}/libiberty.a
%endif


%changelog
* Mon Feb 18 2008 Thierry Vignaud <tvignaud@mandriva.com> 2.18.50.0.3-1mnb1
+ Revision: 170649
- replace %%mkrel with %%manbo_mkrel for Manbo Core 1

* Thu Jan 31 2008 Per Øyvind Karlsen <pkarlsen@mandriva.com> 2.18.50.0.3-1mdv2008.1
+ Revision: 160824
- New release: 2.18.50.3
- sync patches with Fedora
- regenerate P21 (linux32)
- don't hardcode vendor name & os in target
- add translations
- cosmetics
- add missing ia64 patch from fedora
- sync with fedora 2.17.50.0.12-4
- move checks to %%check
- s/mandrake/mandriva/

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Pixel <pixel@mandriva.com>
    - fix group (#28151)

* Sun May 06 2007 Christiaan Welvaart <spturtle@mandriva.org> 2.17.50.0.9-2mdv2008.0
+ Revision: 23749
- match all sparc flavors when checking target_cpu
- fix check to build alternate binaries for spu


* Tue Jan 09 2007 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.17.50.0.9-1mdv2007.0
+ Revision: 106684
- 2.17.50.0.9
- add embedspu to combine spu objects into normal executables for cell

* Wed Jan 03 2007 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.17.50.0.8-1mdv2007.1
+ Revision: 103768
- 2.17.50.0.8
- fix gas error on valid-code complaining about missing .cfi_endproc (BZ#3607)
- re-organise generation of cross binutils, enable make check for cross tools
- move cell spu bits to a specific sub package, don't build spu for cross ppc

* Tue Dec 19 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.7-6mdv2007.1
+ Revision: 99715
- integrate binart spu_ovl.o for bootstrap
- backport Cell SPU support
- reorganize targets selection, drop support for mach-o objects
- backport DT_GNU_HASH support
- make linux32 as generate 32-bit code on ppc64
- bunzip2 patches
- Import binutils

* Wed Oct 25 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.7-5mdv
- improve biarch x86-linux support (64-bit on 32-bit)
- update to upstream cell patch (new AltiVec instructions)

* Fri Sep 22 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.7-4mdv
- add cell ppu support

* Wed Aug 30 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.7-3mdv2007.0
- CVE-2006-2362 (PR binutils/2584)

* Fri Jul 21 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.7-2mdk
- build with -Wno-error
- more libtool fixes for build
- selected fixes from CVS:
  * add "nop memory" for i386/x86-64
  * fix x86-64 disassembler for sidt/sgdt
  * fix a visibility bug in ELF linker (PR 2884)

* Fri May 12 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.7-1mdk
- 2.16.91.0.7
- fix build with gcc4.1

* Fri May 12 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.6-2mdk
- avoid abort with dynamic symbols in >64K sections (PR 2411)
- merge with RH 2.16.91.0.6-6
  * support S signal frame augmentation flag in .eh_frame,
    add .cfi_signal_frame support (#175951, PR other/26208, BZ#300)
  * support DW_CFA_val_{offset,offset_sf,expression} in readelf/objdump
  * fix relaxation of TLS GD to LE on PPC (RH #184590)
  * fix for g++ -frepo ((RH #187142)

* Tue Mar 07 2006 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.6-1mdk
- 2.16.91.0.6
- fix PR ld/2218 (H.J. Lu)
- add Merom New Instructions (MNI)

* Sat Aug 13 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.2-3mdk
- fix requires for install-info

* Fri Aug 05 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.2-2mdk
- remove obsolete patch that was fixed in a previous snapshot
- make the linker ignore .got2 relocs against symbols from discarded
  sections (Alan Modra, PR target/17828)

* Sat Jul 23 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.2-1mdk
- 2.16.91.0.2:
  * update from binutils 2005 0720
  * add AMD SVME & Intel VMX support
  * add x86-64 new relocations for medium model
  * fix a PIE regression (PR 975)
  * fix an x86_64 signed 32bit displacement regression
  * fix PPC PLT (PR 1004)
  * imrove empty section removal

* Fri Jul 08 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.91.0.1-1mdk
- 2.16.91.0.1

* Thu Jun 16 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.3-2mdk
- all tests pass on ppc64 too
- build sparc with --enable-64-bit-bfd (peroyvind)

* Wed May 18 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.3-1mdk
- 2.16.90.0.3

* Sat May 07 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.2-3mdk
- enable 64-bit targets for ppc and sparc

* Thu May 05 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.2-2mdk
- selected fix from CVS to fix kdebase build:
  * skip weak definitions if a strong definition has already been seen

* Sun May 01 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.2-1mdk
- 2.16.90.0.2
- fix ld -pie

* Wed Apr 27 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.1-2mdk
- Selected fixes from mainline CVS to fix --as-needed and PR ld/815

* Tue Apr 26 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 2.16.90.0.1-1mdk
- 2.16.90.0.1

* Tue Mar 08 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.92.0.2-6mdk
- don't build shared libraries for cross binutils

* Tue Feb 01 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.92.0.2-5mdk
- handle protected functions correctly on x86_64 (PR binutils/584, H. J. Lu)

* Tue Jan 18 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.92.0.2-4mdk
- make "as" aware of its current personality on x86-64 so that 32-bit
  object can be generated by default (if running under linux32)

* Thu Dec 16 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.92.0.2-3mdk
- fix build on x86_64

* Wed Nov 24 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.92.0.2-2mdk
- Further merge with RH 2.15.92.0.2-6
  * revert Sep 09 change to make ppc L second argument e.g. for tlbie non-optional
  * fix --just-symbols on ppc64 (Alan Modra, #135498)
  * fix -pie on ppc64

* Wed Nov 10 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.92.0.2-1mdk
- Merge with RH 2.15.92.0.2-6
  * fix ar xo
  * fix stripping of prelinked binaries and libraries
  * allow strings(1) on 32-bit arches to be used again with > 2GB files
  * fix code detecting matching linkonce and single member comdat group sections
  * fix -z relro to make sure end of PT_GNU_RELRO segment is always COMMONPAGESIZE aligned
  * fix orphan section placement
  * change ld's ld.so.conf parser to match ldconfig's

* Wed May 12 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.15.90.0.3-1mdk
- 2.15.90.0.3
- change x86-64 .plt symbol st_size handling to match ia32 (RH 2.15.90.0.3-4)

* Mon Jan 12 2004 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.14.90.0.7-2mdk
- Fix cross binutils builds with newer rpm
- Enable Mach-O and PEF targets on cross PowerPC binutils