Ignore:
Timestamp:
Jun 1, 2016, 2:08:45 PM (9 years ago)
Author:
Silvan Scherrer
Message:

spec: binutils: updated to version 2.25

File:
1 edited

Legend:

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

    r222 r771  
    1 #disable lxlite strip
    2 %define __os_install_post       %{nil}
     1%define svn_url     e:/trees/binutils/trunk
     2#define svn_url     http://svn.netlabs.org/repos/ports/binutils/trunk
     3#define svn_rev     1585
    34
    45# rpmbuild parameters:
     
    89# --with testsuite: Run the testsuite.  Default --with debug is not to run it.
    910
    10 %bcond_with testsuite
     11# we don't run the testsuit, as there are dependencies we don't have atm
     12%define _without_testsuite 1
    1113
    1214%if 0%{!?binutils_target:1}
    13 %define binutils_target %{_target_platform}
     15# we always use _build, as target_platform isn't recognised by configure
     16# define binutils_target %{_target_platform}
     17%define binutils_target %{_build}
    1418%define isnative 1
    1519%define enable_shared 1
     
    1923%define enable_shared 0
    2024%endif
     25# BZ 1124342: Provide a way to enable deterministic archives.
     26# BZ 1195883: But do not do this by default.
     27%define enable_deterministic_archives 0
     28
    2129
    2230Summary: A GNU collection of binary utilities
    2331Name: %{?cross}binutils%{?_with_debug:-debug}
    24 Version: 2.21
     32Version: 2.25
    2533Release: 1%{?dist}
    2634License: GPLv3+
    2735Group: Development/Tools
    2836URL: http://sources.redhat.com/binutils
    29 Source: binutils-2.21-os2-20101212.zip
    30 
    31 %define gold_arches %ix86 x86_64
    32 
    33 %ifarch %gold_arches
    34 %define build_gold      both
    35 %else
     37
     38Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
     39Vendor: bww bitwise works GmbH
     40
     41Provides: bundled(libiberty)
     42
     43# BZ 1173780: Building GOLD for PPC is not working at the moment.
     44# define gold_arches %ix86 x86_64 %arm aarch64 ppc* %{power64}
     45%define gold_arches %ix86 x86_64 %arm aarch64
     46
     47# we don't build on elf, so no gold for us
     48# ifarch %gold_arches
     49# define build_gold     both
     50# else
    3651%define build_gold      no
    37 %endif
     52# endif
    3853
    3954%if 0%{?_with_debug:1}
     
    4762%endif
    4863
    49 #Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
    50 #BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel
    51 
     64BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel
     65# BZ 920545: We need pod2man in order to build the manual pages.
     66# BuildRequires: /@unixroot/usr/bin/pod2man
    5267# Required for: ld-bootstrap/bootstrap.exp bootstrap with --static
    5368# It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array
    5469%if %{run_testsuite}
    55 #BuildRequires: dejagnu, zlib-static, glibc-static, sharutils
    56 %endif
    57 
     70# relro_test.sh uses dc which is part of the bc rpm, hence its inclusion here.
     71BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc
     72%if "%{build_gold}" == "both"
     73# The GOLD testsuite needs a static libc++
     74BuildRequires: libstdc++-static
     75%endif
     76%endif
    5877Conflicts: gcc-c++ < 4.0.0
    5978#Requires(post): /sbin/install-info
     
    6382%endif
    6483
     84
    6585# The higher of these two numbers determines the default ld.
    6686%{!?ld_bfd_priority: %define ld_bfd_priority    50}
     
    6888
    6989%if "%{build_gold}" == "both"
    70 #Requires(post): coreutils
    71 #Requires(post): %{_sbindir}/alternatives
    72 #Requires(preun): %{_sbindir}/alternatives
     90Requires(post): coreutils
     91Requires(post): %{_sbindir}/alternatives
     92Requires(preun): %{_sbindir}/alternatives
    7393%endif
    7494
     
    95115Summary: BFD and opcodes dynamic libraries and header files
    96116Group: System Environment/Libraries
    97 #Conflicts: binutils < 2.17.50.0.3-4
     117Conflicts: binutils < 2.17.50.0.3-4
    98118#Requires(post): /sbin/install-info
    99119#Requires(preun): /sbin/install-info
    100120Requires: zlib-devel
     121Requires: binutils = %{version}-%{release}
     122# BZ 1215242: We need touch...
     123Requires: coreutils
    101124
    102125%description devel
    103 This package contains the generic BFD and opcodes dynamic libraries and
    104 associated header files.  Developers starting new projects are encouraged
    105 to consider using libelf instead of BFD.
    106 
    107 %package static
    108 Summary: BFD and opcodes static libraries
    109 Group: System Environment/Libraries
    110 #Requires(post): /sbin/install-info
    111 #Requires(preun): /sbin/install-info
    112 
    113 %description static
    114 This package contains BFD and opcodes static libraries.  Developers
    115 starting new projects are strongly encouraged to consider using
    116 libelf instead of BFD.
     126This package contains BFD and opcodes static and dynamic libraries.
     127
     128The dynamic libraries are in this package, rather than a seperate
     129base package because they are actually linker scripts that force
     130the use of the static libraries.  This is because the API of the
     131BFD library is too unstable to be used dynamically.
     132
     133The static libraries are here because they are now needed by the
     134dynamic libraries.
     135
     136Developers starting new projects are strongly encouraged to consider
     137using libelf instead of BFD.
     138
    117139
    118140%prep
    119 %setup -q -c
     141%if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
     142%setup -q
     143%else
     144%setup -n "%{name}-%{version}" -Tc
     145svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
     146rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
     147(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
     148%endif
     149
     150autogen.sh
    120151
    121152%build
     153echo target is %{binutils_target}
     154%ifarch %{power64}
     155export CFLAGS="$RPM_OPT_FLAGS -Wno-error"
     156%else
     157export CFLAGS="$RPM_OPT_FLAGS"
     158%endif
     159CARGS=
     160
     161case %{binutils_target} in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*)
     162  CARGS="$CARGS --enable-64-bit-bfd"
     163  ;;
     164esac
     165
     166case %{binutils_target} in ia64*)
     167  CARGS="$CARGS --enable-targets=i386-linux"
     168  ;;
     169esac
     170
     171case %{binutils_target} in ppc*|ppc64*)
     172  CARGS="$CARGS --enable-targets=spu"
     173  ;;
     174esac
     175
     176case %{binutils_target} in ppc64-*)
     177  CARGS="$CARGS --enable-targets=powerpc64le-linux"
     178  ;;
     179esac
     180
     181case %{binutils_target} in  ppc64le*)
     182    CARGS="$CARGS --enable-targets=powerpc-linux"
     183    ;;
     184esac
     185
     186%if 0%{?_with_debug:1}
     187CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0"
     188%define enable_shared 0
     189%endif
     190
     191export LDFLAGS=" -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
     192
     193# We could optimize the cross builds size by --enable-shared but the produced
     194# binaries may be less convenient in the embedded environment.
     195# the below configure switchs we don't use
     196#  --build=%{_target_platform} --host=%{_target_platform} \
     197%configure \
     198  --target=%{binutils_target} \
     199%ifarch %gold_arches
     200%if "%{build_gold}" == "both"
     201  --enable-gold=default --enable-ld \
     202%else
     203  --enable-ld \
     204%endif
     205%endif
     206%if !%{isnative}
     207  --enable-targets=%{_host} \
     208  --with-sysroot=%{_prefix}/%{binutils_target}/sys-root \
     209  --program-prefix=%{cross} \
     210%endif
     211%if %{enable_shared}
     212  --enable-shared --disable-static \
     213%else
     214  --disable-shared \
     215%endif
     216%if %{enable_deterministic_archives}
     217  --enable-deterministic-archives \
     218%else   
     219  --enable-deterministic-archives=no \
     220%endif
     221  $CARGS \
     222  --enable-plugins \
     223  --with-bugurl=http://bugzilla.redhat.com/bugzilla/
     224make %{_smp_mflags} tooldir=%{_prefix} all
     225make %{_smp_mflags} tooldir=%{_prefix} info
     226
     227# Do not use %%check as it is run after %%install where libbfd.so is rebuild
     228# with -fvisibility=hidden no longer being usable in its shared form.
     229%if !%{run_testsuite}
     230echo ====================TESTSUITE DISABLED=========================
     231%else
     232make -k check < /dev/null || :
     233echo ====================TESTING=========================
     234cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
     235echo ====================TESTING END=====================
     236for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}
     237do
     238  ln $file binutils-%{_target_platform}-$(basename $file) || :
     239done
     240tar cjf binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}
     241uuencode binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}.tar.bz2
     242rm -f binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}
     243%endif
    122244
    123245%install
    124246rm -rf %{buildroot}
    125 mkdir -p %{buildroot}%{_usr}
    126 cp -p -r "binutils/*" %{buildroot}%{_usr}
    127 
    128 rm  %{buildroot}%{_libdir}/*.la
    129 rm  %{buildroot}%{_usr}/readme.os2
    130 rm  %{buildroot}%{_infodir}/dir
     247make install DESTDIR=%{buildroot}
     248%if %{isnative}
     249make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info
     250
     251#install -m 644 bfd/libbfd.a %{buildroot}%{_libdir}
     252#install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir}
     253install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include
     254#install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir}
     255# Remove Windows/Novell only man pages
     256rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windres,windmc}*
     257
     258%if %{enable_shared}
     259chmod +x %{buildroot}%{_libdir}/*.dll
     260%endif
     261
     262# Remove libtool files, which reference the .dll libs
     263rm -f %{buildroot}%{_libdir}/*.la
     264
     265%else # !%{isnative}
     266# For cross-binutils we drop the documentation.
     267rm -rf %{buildroot}%{_infodir}
     268# We keep these as one can have native + cross binutils of different versions.
     269#rm -rf %{buildroot}%{_prefix}/share/locale
     270#rm -rf %{buildroot}%{_mandir}
     271rm -rf %{buildroot}%{_libdir}/libiberty.a
     272%endif # !%{isnative}
     273
     274# This one comes from gcc
     275rm -f %{buildroot}%{_infodir}/dir
     276rm -rf %{buildroot}%{_prefix}/%{binutils_target}
     277
     278%find_lang %{?cross}binutils
     279%find_lang %{?cross}opcodes
     280%find_lang %{?cross}bfd
     281%find_lang %{?cross}gas
     282%find_lang %{?cross}gprof
     283cat %{?cross}opcodes.lang >> %{?cross}binutils.lang
     284cat %{?cross}bfd.lang >> %{?cross}binutils.lang
     285cat %{?cross}gas.lang >> %{?cross}binutils.lang
     286cat %{?cross}gprof.lang >> %{?cross}binutils.lang
     287
     288if [ -x ld/ld-new ]; then
     289  %find_lang %{?cross}ld
     290  cat %{?cross}ld.lang >> %{?cross}binutils.lang
     291fi
     292if [ -x gold/ld-new ]; then
     293  %find_lang %{?cross}gold
     294  cat %{?cross}gold.lang >> %{?cross}binutils.lang
     295fi
    131296
    132297%clean
     
    134299
    135300%post
     301%if "%{build_gold}" == "both"
     302%__rm -f %{_bindir}/%{?cross}ld
     303%{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
     304  %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority}
     305%{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
     306  %{_bindir}/%{?cross}ld.gold %{ld_gold_priority}
     307%{_sbindir}/alternatives --auto %{?cross}ld
     308%endif
     309%if %{isnative}
     310#/sbin/ldconfig
     311# For --excludedocs:
     312if [ -e %{_infodir}/binutils.info.gz ]
     313then
     314  %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz
     315  %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
     316  %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
     317  %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz
     318fi
     319%endif # %{isnative}
     320exit 0
    136321
    137322%preun
    138 
    139 %files
     323%if "%{build_gold}" == "both"
     324if [ $1 = 0 ]; then
     325  %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd
     326  %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold
     327fi
     328%endif
     329%if %{isnative}
     330if [ $1 = 0 ]; then
     331  if [ -e %{_infodir}/binutils.info.gz ]
     332  then
     333   %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz
     334   %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
     335   %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
     336   %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz
     337  fi
     338fi
     339%endif
     340exit 0
     341
     342%if %{isnative}
     343#%postun -p /sbin/ldconfig
     344%endif # %{isnative}
     345
     346%files -f %{?cross}binutils.lang
    140347%defattr(-,root,root,-)
    141 %doc binutils/readme.os2
    142 %{_bindir}/*
    143 %{_usr}/i386-pc-os2-emx/*
     348%doc README
     349%{_bindir}/%{?cross}[!l]*
     350%if "%{build_gold}" == "both"
     351%{_bindir}/%{?cross}ld.*
     352%ghost %{_bindir}/%{?cross}ld
     353%else
     354#%{_bindir}/%{?cross}ld*
     355%endif
    144356%{_mandir}/man1/*
     357%if %{enable_shared}
     358%{_libdir}/*.dll
     359%endif
     360
     361%if %{isnative}
    145362%{_infodir}/[^b]*info*
    146363%{_infodir}/binutils*info*
     
    148365%files devel
    149366%defattr(-,root,root,-)
    150 %{_includedir}/*
     367%{_prefix}/include/*
     368%{_libdir}/*_dll.a
    151369%{_infodir}/bfd*info*
    152370
    153 %files static
    154 %defattr(-,root,root,-)
    155 %{_libdir}/*.a
     371%endif # %{isnative}
    156372
    157373%changelog
     374* Tue May 31 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.25-1
     375- update to version 2.25
     376
     377* Wed Oct 5 2011 yd <yd@os2power.com> 2.21-1
     378- Initial version
Note: See TracChangeset for help on using the changeset viewer.