Репозиторий Sisyphus
Последнее обновление: 9 декабря 2022 | Пакетов: 17974 | Посещений: 25543208
en ru br
Репозитории ALT

Другие репозитории

Группа :: Разработка/Прочее
Пакет: binutils

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define binutils_sourcedir /usr/src/binutils-source

Name: binutils
Version: 2.38
Release: alt1
Epoch: 1

Summary: GNU Binary Utility Development Utilities
License: GPLv3+
Group: Development/Other
Url: http://sourceware.org/binutils/

# http://git.altlinux.org/gears/b/binutils.git

Source: binutils-%version-%release.tar

%def_enable pgo_lto
%def_with debuginfod

# List of architectures worthy to care about test results.

%define check_arches x86_64 %ix86 ppc64le
%def_with check

Conflicts: libbfd
# due to c++filt
Conflicts: gcc-common < 0:1.2.1-alt4

BuildRequires: flex makeinfo perl-Pod-Parser zlib-devel
BuildRequires: gcc-c++ libstdc++-devel-static
%{?!_without_check:%{?!_disable_check:BuildRequires: dejagnu, gcc-c++, glibc-devel-static, zlib-devel-static, bc, /proc, /dev/pts}}
%if_with debuginfod
BuildRequires: libdebuginfod-devel

%package -n libctf-nobfd0
Summary: Compact C Type Format library (no BFD dependency)
Group: System/Libraries

%package devel
Summary: Development files for development with BFD, opcodes and libiberty libraries
Group: Development/C
Requires: zlib-devel-static
Provides: libiberty-devel = %epoch:%version-%release
Provides: libbfd-devel = %epoch:%version-%release
Obsoletes: libiberty-devel
Obsoletes: libbfd-devel

%package source
Summary: Binutils sources
Group: Development/Other
BuildArch: noarch

Binutils is a collection of binary utilities, including:
+ addr2line: converting addresses to file and line;
+ ar: creating modifying and extracting from archives;
+ nm: listing symbols from object files;
+ objcopy: copying and translating object files;
+ objdump: displaying information from object files;
+ ranlib: generating an index for the contents of an archive;
+ size: listing the section sizes of an object or archive file;
+ strings: listing printable strings from files;
+ strip: discarding symbols.

%description -n libctf-nobfd0
This package includes the libctf-nobfd shared library.  The Compact C Type
Format (CTF) is a way of representing information about a binary program.

%description devel
This package contains include files, dynamic and static libraries needed
for development software based on Binary File Descriptor library and

%description source
This package contains source code of GNU Binutils.

%setup -n %name-%version-%release

%define _configure_target --host=%_target_platform --build=%_target_platform
%undefine __libtoolize
%ifarch %ix86 x86_32
%ifarch ia64 x86_64
%ifarch ppc
ADDITIONAL_TARGETS="--enable-targets=powerpc64-alt-linux --enable-targets=spu --enable-64-bit-bfd"
%{?optflags_lto:%global optflags_lto %nil}
%configure \
%if_enabled pgo_lto
--enable-pgo-build=lto \
%{subst_with debuginfod} \
--with-system-zlib \
--enable-shared \
--with-pic \
--disable-werror \
--enable-plugins \
--with-bugurl=http://bugzilla.altlinux.org/ \
--enable-gold=yes --enable-ld=default \
--with-stage1-ldflags=' ' \
--with-boot-ldflags=' ' \
%ifnarch mipsel mips64el
--enable-default-hash-style=gnu \
--enable-relro \
--enable-textrel-check=warning \
--enable-deterministic-archives \

%make_build MAKEINFOFLAGS=--no-split tooldir=%_prefix

%makeinstall_std tooldir=%_prefix install-info

# Remove static libctf libraries.

rm %buildroot%_libdir/libctf*.a

# Install ld.default and ld wrapper.

ln -snf ld.bfd %buildroot%_bindir/ld.default
install -pm755 alt/ld.sh %buildroot%_bindir/ld

# Install PIC version of the libiberty.a

install -pm644 libiberty/pic/libiberty.a %buildroot%_libdir/

# Remove unrelated manpages.

find %buildroot%_man1dir -type f |while read f; do

[ -f "%buildroot%_bindir/$n" ] || rm -v "$f"

%ifarch %ix86 x86_32 ppc
# Sanity check --enable-64-bit-bfd really works.
grep -Fqsx '#define BFD_ARCH_SIZE 64' %buildroot%_prefix/include/bfd.h

# Generate .so linker scripts for dependencies; imported from glibc/Makerules:

# Remove symlinks

rm -f %buildroot%_libdir/lib{bfd,opcodes}.so

# This fragment of linker script gives the OUTPUT_FORMAT statement

# for the configuration we are building.
/* Ensure this .so library will not be used by a link for a different format
  on a multi-architecture system.  */
$(gcc $CFLAGS $LDFLAGS -shared -x c /dev/null -o /dev/null -Wl,--verbose -v 2>&1 |
sed -n -f "alt/output-format.sed")"

cat >%buildroot%_libdir/libbfd.so <<EOF
/* GNU ld script */


/* The -lz and -ldl dependencies are unexpected by legacy build scripts.  */
INPUT ( %_libdir/libbfd.a -liberty -ldl -lz )

cat >%buildroot%_libdir/libopcodes.so <<EOF
/* GNU ld script */


INPUT ( %_libdir/libopcodes.a -lbfd )

# Relocate include files.

pushd %buildroot%_includedir
mkdir bfd
for f in *.h; do
mv "$f" bfd/
ln -s bfd/"$f" .

# Cleanup config.h remnants

sed -i '/PR 14072:/,/^#endif/d' %buildroot%_includedir/bfd/bfd.h
sed -i '/HAVE_STDINT_H/,/^#endif/d; /#include <sys\/types.h>/i#include <stdint.h>' \

# Workaround multilib issues

wordsize=$(printf '%%s\n%%s' '#include <bits/wordsize.h>' '__WORDSIZE' | gcc -E -P -)
mv %buildroot%_includedir/bfd/bfd{,-$wordsize}.h
install -pm644 alt/bfd.h %buildroot%_includedir/bfd/

# Add more include files.

install -pm644 include/libiberty.h %buildroot%_includedir/
install -pm644 bfd/{elf-bfd,lib*}.h %buildroot%_includedir/bfd/
cp -a include/{coff,elf} %buildroot%_includedir/bfd/
rm %buildroot%_includedir/bfd/{*in.h,*/ChangeLog*}

# Install NEWS.

for n in binutils gas ld; do
install -pm644 $n/NEWS NEWS-$n

mkdir -p %buildroot%binutils_sourcedir
cp %SOURCE0 %buildroot%binutils_sourcedir/

%find_lang binutils bfd gas gold gprof ld opcodes --append --output files.lst

%set_verify_elf_method strict
%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1

[ -w /dev/ptmx -a -f /proc/self/maps ] || exit
# testsuite requires gcc to be able to print path to liblto_plugin.so
GCC_PFN_LTO=$(gcc -print-file-name=liblto_plugin.so)
GCC_PPN_LTO=$(gcc -print-prog-name=liblto_plugin.so)
[ "$GCC_PFN_LTO" != 'liblto_plugin.so' -o "$GCC_PPN_LTO" != 'liblto_plugin.so' ] || exit

%make_build -k check CC="$PWD/alt/gcc.sh" CXX="$PWD/alt/g++.sh" \
%ifnarch %check_arches
   || : \

%files -f files.lst
%dir %_libdir/bfd-plugins
%exclude %_infodir/bfd.info*
%doc NEWS*

%files -n libctf-nobfd0

%files devel

%files source


Полный changelog можно просмотреть здесь

дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin