From 473303228c10c808edd4b008f378c1a81385c1b4434bf5306bb834e0ffced965 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 4 May 2022 09:51:41 +0000 Subject: [PATCH] Accepting request 974872 from home:marxin:branches:devel:gcc - Make multibuild utilize only the main binutils.spec file. - Remove not needed README.First-for.SUSE.packagers, pre_checkin.sh. OBS-URL: https://build.opensuse.org/request/show/974872 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=404 --- README.First-for.SUSE.packagers | 14 - _multibuild | 46 +-- binutils.changes | 6 + binutils.spec | 32 +- cross-aarch64-binutils.spec | 649 -------------------------------- cross-arm-binutils.spec | 649 -------------------------------- cross-avr-binutils.spec | 649 -------------------------------- cross-epiphany-binutils.spec | 649 -------------------------------- cross-hppa-binutils.spec | 649 -------------------------------- cross-hppa64-binutils.spec | 649 -------------------------------- cross-i386-binutils.spec | 649 -------------------------------- cross-ia64-binutils.spec | 649 -------------------------------- cross-m68k-binutils.spec | 649 -------------------------------- cross-mips-binutils.spec | 649 -------------------------------- cross-ppc-binutils.spec | 649 -------------------------------- cross-ppc64-binutils.spec | 649 -------------------------------- cross-ppc64le-binutils.spec | 649 -------------------------------- cross-pru-binutils.spec | 649 -------------------------------- cross-riscv64-binutils.spec | 649 -------------------------------- cross-rx-binutils.spec | 649 -------------------------------- cross-s390-binutils.spec | 649 -------------------------------- cross-s390x-binutils.spec | 649 -------------------------------- cross-sparc-binutils.spec | 649 -------------------------------- cross-sparc64-binutils.spec | 649 -------------------------------- cross-spu-binutils.spec | 649 -------------------------------- cross-x86_64-binutils.spec | 649 -------------------------------- cross-xtensa-binutils.spec | 649 -------------------------------- pre_checkin.sh | 26 -- 28 files changed, 59 insertions(+), 14992 deletions(-) delete mode 100644 README.First-for.SUSE.packagers delete mode 100644 cross-aarch64-binutils.spec delete mode 100644 cross-arm-binutils.spec delete mode 100644 cross-avr-binutils.spec delete mode 100644 cross-epiphany-binutils.spec delete mode 100644 cross-hppa-binutils.spec delete mode 100644 cross-hppa64-binutils.spec delete mode 100644 cross-i386-binutils.spec delete mode 100644 cross-ia64-binutils.spec delete mode 100644 cross-m68k-binutils.spec delete mode 100644 cross-mips-binutils.spec delete mode 100644 cross-ppc-binutils.spec delete mode 100644 cross-ppc64-binutils.spec delete mode 100644 cross-ppc64le-binutils.spec delete mode 100644 cross-pru-binutils.spec delete mode 100644 cross-riscv64-binutils.spec delete mode 100644 cross-rx-binutils.spec delete mode 100644 cross-s390-binutils.spec delete mode 100644 cross-s390x-binutils.spec delete mode 100644 cross-sparc-binutils.spec delete mode 100644 cross-sparc64-binutils.spec delete mode 100644 cross-spu-binutils.spec delete mode 100644 cross-x86_64-binutils.spec delete mode 100644 cross-xtensa-binutils.spec delete mode 100644 pre_checkin.sh diff --git a/README.First-for.SUSE.packagers b/README.First-for.SUSE.packagers deleted file mode 100644 index affa1e7..0000000 --- a/README.First-for.SUSE.packagers +++ /dev/null @@ -1,14 +0,0 @@ -IMPORTANT: Please change binutils.spec and then run ./pre_checkin.sh! -Do not change cross-*.spec directly! - -The spec file triggers by it's %name if it compiles the native or the -cross version and pre_checkin.sh (called automatically by checkin too) -copies over the binutils.spec and changes the Name field, so you shouldn't -need to worry too much about the cross packages - -Updating to some branch head: -> cvs -z 9 -d :pserver:anoncvs@stravinsky:/cvs/src export -r binutils-2_23-branch binutils - -Thanks, -Stephan Kulow - diff --git a/_multibuild b/_multibuild index 3db7292..e10a7b3 100644 --- a/_multibuild +++ b/_multibuild @@ -1,25 +1,25 @@ - cross-aarch64-binutils - cross-hppa-binutils - cross-hppa64-binutils - cross-arm-binutils - cross-i386-binutils - cross-x86_64-binutils - cross-s390-binutils - cross-s390x-binutils - cross-ppc-binutils - cross-ppc64-binutils - cross-ppc64le-binutils - cross-ia64-binutils - cross-sparc-binutils - cross-sparc64-binutils - cross-spu-binutils - cross-avr-binutils - cross-pru-binutils - cross-mips-binutils - cross-m68k-binutils - cross-epiphany-binutils - cross-rx-binutils - cross-riscv64-binutils - cross-xtensa-binutils + aarch64 + hppa + hppa64 + arm + i386 + x86_64 + s390 + s390x + ppc + ppc64 + ppc64le + ia64 + sparc + sparc64 + spu + avr + pru + mips + m68k + epiphany + rx + riscv64 + xtensa diff --git a/binutils.changes b/binutils.changes index 78c248b..7f668a7 100644 --- a/binutils.changes +++ b/binutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 4 07:10:59 UTC 2022 - Martin Liška + +- Make multibuild utilize only the main binutils.spec file. +- Remove not needed README.First-for.SUSE.packagers, pre_checkin.sh. + ------------------------------------------------------------------- Mon May 2 10:15:26 UTC 2022 - Martin Liška diff --git a/binutils.spec b/binutils.spec index e82faeb..b74624a 100644 --- a/binutils.spec +++ b/binutils.spec @@ -16,7 +16,37 @@ # +%define flavor @BUILD_FLAVOR@%{nil} + +%if "%{flavor}" != "" +%define cross 1 +%define targetarch %(echo %flavor | sed -e 's/i.86/i586/;s/ppc/powerpc/') +%define TARGET %targetarch + +# Spec parsing does not support execution of external command, +# that's why we use the if-else chain. +%if "%{flavor}" == "i386" +ExcludeArch: %ix86 +%else +%if "%{flavor}" == "ppc" +ExcludeArch: powerpc +%else +%if "%{flavor}" == "arm" +ExcludeArch: %arm +%else +ExcludeArch: %{flavor} +%endif +%endif +%endif + +%endif + +%if "%{flavor}" == "" Name: binutils +%else +Name: cross-%{flavor}-binutils +%endif + BuildRequires: bc BuildRequires: bison BuildRequires: dejagnu @@ -90,8 +120,6 @@ Group: Development/Tools/Building Source: binutils-%{version}.tar.bz2 Source4: binutils-%{version}.tar.bz2.sig Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers Source3: baselibs.conf Patch1: binutils-2.38-branch.diff.gz Patch3: binutils-skip-rpaths.patch diff --git a/cross-aarch64-binutils.spec b/cross-aarch64-binutils.spec deleted file mode 100644 index f1ffbe3..0000000 --- a/cross-aarch64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-aarch64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-aarch64-binutils -ExcludeArch: aarch64 -%define cross 1 -%define TARGET aarch64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-arm-binutils.spec b/cross-arm-binutils.spec deleted file mode 100644 index 5ca86aa..0000000 --- a/cross-arm-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-arm-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-arm-binutils -ExcludeArch: %arm -%define cross 1 -%define TARGET arm -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-avr-binutils.spec b/cross-avr-binutils.spec deleted file mode 100644 index d7f46a3..0000000 --- a/cross-avr-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-avr-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-avr-binutils -ExcludeArch: avr -%define cross 1 -%define TARGET avr -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-epiphany-binutils.spec b/cross-epiphany-binutils.spec deleted file mode 100644 index aa94984..0000000 --- a/cross-epiphany-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-epiphany-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-epiphany-binutils -ExcludeArch: epiphany -%define cross 1 -%define TARGET epiphany -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-hppa-binutils.spec b/cross-hppa-binutils.spec deleted file mode 100644 index f376111..0000000 --- a/cross-hppa-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-hppa-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-hppa-binutils -ExcludeArch: hppa -%define cross 1 -%define TARGET hppa -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-hppa64-binutils.spec b/cross-hppa64-binutils.spec deleted file mode 100644 index 6998f7e..0000000 --- a/cross-hppa64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-hppa64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-hppa64-binutils -ExcludeArch: hppa64 -%define cross 1 -%define TARGET hppa64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-i386-binutils.spec b/cross-i386-binutils.spec deleted file mode 100644 index 1f67fb3..0000000 --- a/cross-i386-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-i386-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-i386-binutils -ExcludeArch: %ix86 -%define cross 1 -%define TARGET i586 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-ia64-binutils.spec b/cross-ia64-binutils.spec deleted file mode 100644 index 51d3b8c..0000000 --- a/cross-ia64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-ia64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-ia64-binutils -ExcludeArch: ia64 -%define cross 1 -%define TARGET ia64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-m68k-binutils.spec b/cross-m68k-binutils.spec deleted file mode 100644 index f5a2c9f..0000000 --- a/cross-m68k-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-m68k-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-m68k-binutils -ExcludeArch: m68k -%define cross 1 -%define TARGET m68k -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-mips-binutils.spec b/cross-mips-binutils.spec deleted file mode 100644 index badf68f..0000000 --- a/cross-mips-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-mips-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-mips-binutils -ExcludeArch: mips -%define cross 1 -%define TARGET mips -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-ppc-binutils.spec b/cross-ppc-binutils.spec deleted file mode 100644 index 4602f93..0000000 --- a/cross-ppc-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-ppc-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-ppc-binutils -ExcludeArch: ppc -%define cross 1 -%define TARGET powerpc -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-ppc64-binutils.spec b/cross-ppc64-binutils.spec deleted file mode 100644 index 97b6aff..0000000 --- a/cross-ppc64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-ppc64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-ppc64-binutils -ExcludeArch: ppc64 -%define cross 1 -%define TARGET powerpc64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-ppc64le-binutils.spec b/cross-ppc64le-binutils.spec deleted file mode 100644 index 0d5500d..0000000 --- a/cross-ppc64le-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-ppc64le-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-ppc64le-binutils -ExcludeArch: ppc64le -%define cross 1 -%define TARGET powerpc64le -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-pru-binutils.spec b/cross-pru-binutils.spec deleted file mode 100644 index df8f29e..0000000 --- a/cross-pru-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-pru-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-pru-binutils -ExcludeArch: pru -%define cross 1 -%define TARGET pru -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-riscv64-binutils.spec b/cross-riscv64-binutils.spec deleted file mode 100644 index 8d14174..0000000 --- a/cross-riscv64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-riscv64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-riscv64-binutils -ExcludeArch: riscv64 -%define cross 1 -%define TARGET riscv64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-rx-binutils.spec b/cross-rx-binutils.spec deleted file mode 100644 index 031655a..0000000 --- a/cross-rx-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-rx-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-rx-binutils -ExcludeArch: rx -%define cross 1 -%define TARGET rx -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-s390-binutils.spec b/cross-s390-binutils.spec deleted file mode 100644 index cc5366c..0000000 --- a/cross-s390-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-s390-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-s390-binutils -ExcludeArch: s390 -%define cross 1 -%define TARGET s390 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-s390x-binutils.spec b/cross-s390x-binutils.spec deleted file mode 100644 index 5673709..0000000 --- a/cross-s390x-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-s390x-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-s390x-binutils -ExcludeArch: s390x -%define cross 1 -%define TARGET s390x -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-sparc-binutils.spec b/cross-sparc-binutils.spec deleted file mode 100644 index 2fc0fb8..0000000 --- a/cross-sparc-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-sparc-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-sparc-binutils -ExcludeArch: sparc -%define cross 1 -%define TARGET sparc -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-sparc64-binutils.spec b/cross-sparc64-binutils.spec deleted file mode 100644 index 777e32c..0000000 --- a/cross-sparc64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-sparc64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-sparc64-binutils -ExcludeArch: sparc64 -%define cross 1 -%define TARGET sparc64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-spu-binutils.spec b/cross-spu-binutils.spec deleted file mode 100644 index 81496e8..0000000 --- a/cross-spu-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-spu-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-spu-binutils -ExcludeArch: spu -%define cross 1 -%define TARGET spu -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-x86_64-binutils.spec b/cross-x86_64-binutils.spec deleted file mode 100644 index 6250e40..0000000 --- a/cross-x86_64-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-x86_64-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-x86_64-binutils -ExcludeArch: x86_64 -%define cross 1 -%define TARGET x86_64 -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/cross-xtensa-binutils.spec b/cross-xtensa-binutils.spec deleted file mode 100644 index 5cdeb84..0000000 --- a/cross-xtensa-binutils.spec +++ /dev/null @@ -1,649 +0,0 @@ -# -# spec file for package cross-xtensa-binutils -# -# Copyright (c) 2022 SUSE LLC -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via https://bugs.opensuse.org/ -# - - -Name: cross-xtensa-binutils -ExcludeArch: xtensa -%define cross 1 -%define TARGET xtensa -BuildRequires: bc -BuildRequires: bison -BuildRequires: dejagnu -BuildRequires: fdupes -BuildRequires: flex -BuildRequires: gcc-c++ -# for the testsuite -%if 0%{suse_version} >= 1210 -BuildRequires: glibc-devel-static -%endif -%if 0%{suse_version} > 1220 -BuildRequires: makeinfo -%endif -%if 0%{suse_version} > 1110 -BuildRequires: zlib-devel-static -%else -BuildRequires: zlib-devel -%endif -Version: 2.38 -Release: 0 - -# disable libalternatives for now until it's changed to not -# introduce cmake/cunit-tests into the bootstrap cycle -%if 0 && 0%{?suse_version} > 1500 -%bcond_without libalternatives -%else -%bcond_with libalternatives -%endif - -# -# RUN_TESTS -%define run_tests %(test ! -f %_sourcedir/RUN_TESTS ; echo $?) -# check the vanilla binutils, with no patches applied -# TEST_VANILLA -%define test_vanilla %(test ! -f %_sourcedir/TEST_VANILLA ; echo $?) -# -# handle test suite failures -# -%ifarch alpha %arm aarch64 hppa mips sh4 %sparc -%define make_check_handling true -%else -# XXX check again -# XXX disabled because gold is seriously broken for now -# Note that some gold tests fail due to gcc-PIE which leads PIE executables -%define make_check_handling true -%endif -# let make check fail anyway if RUN_TESTS was requested -%if %{run_tests} -%define make_check_handling false -%endif -# handle all binary object formats supported by SUSE (and a few more) -%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le s390 s390x x86_64 -%define build_multitarget 1 -%else -%define build_multitarget 0 -%endif -%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa -# -# -# -URL: http://www.gnu.org/software/binutils/ -PreReq: %{install_info_prereq} -# bug437293 -%ifarch ppc64 -Obsoletes: binutils-64bit -%endif -# -Summary: GNU Binutils -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building -Source: binutils-%{version}.tar.bz2 -Source4: binutils-%{version}.tar.bz2.sig -Source5: binutils.keyring -Source1: pre_checkin.sh -Source2: README.First-for.SUSE.packagers -Source3: baselibs.conf -Patch1: binutils-2.38-branch.diff.gz -Patch3: binutils-skip-rpaths.patch -Patch4: s390-biarch.diff -Patch5: x86-64-biarch.patch -Patch6: unit-at-a-time.patch -Patch8: ld-relro.diff -Patch9: testsuite.diff -Patch10: enable-targets-gold.diff -Patch12: s390-pic-dso.diff -Patch14: binutils-build-as-needed.diff -Patch15: binutils-znow.patch -Patch22: binutils-bfd_h.patch -Patch34: aarch64-common-pagesize.patch -Patch36: binutils-pr22868.diff -Patch37: binutils-revert-plt32-in-branches.diff -Patch38: binutils-fix-invalid-op-errata.diff -Patch39: binutils-revert-nm-symversion.diff -Patch40: binutils-fix-abierrormsg.diff -Patch41: binutils-fix-relax.diff -Patch42: binutils-compat-old-behaviour.diff -Patch43: binutils-revert-hlasm-insns.diff -Patch100: add-ulp-section.diff -Patch90: cross-avr-nesc-as.patch -Patch92: cross-avr-omit_section_dynsym.patch -Patch93: cross-avr-size.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif - -%description -C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib, -size, strings, and strip. These utilities are needed whenever you want -to compile a program or kernel. - -%package gold -Summary: The gold linker -License: GPL-3.0-or-later -Group: Development/Tools/Building -Requires: binutils = %{version}-%{release} -%if %{with libalternatives} -Requires: alts -%else -PreReq: update-alternatives -%endif -%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 -%define gold_archs %ix86 aarch64 %arm x86_64 ppc ppc64 ppc64le s390x %sparc -%endif - -%description gold -gold is an ELF linker. It is intended to have complete support for ELF -and to run as fast as possible on modern systems. For normal use it is -a drop-in replacement for the older GNU linker. - -%package devel -Summary: GNU binutils (BFD development files) -License: GPL-3.0-or-later -Group: Development/Libraries/C and C++ -Requires: binutils = %{version}-%{release} -Requires: zlib-devel -Provides: binutils:/usr/include/bfd.h - -%description devel -This package includes header files and static libraries necessary to -build programs which use the GNU BFD library, which is part of -binutils. - -%package -n libctf0 -Summary: Compact C Type Format library (runtime, BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%description -n libctf0 -This package includes the libctf shared library. -The Compact C Type Format (CTF) is a way of representing information about a binary program - -%package -n libctf-nobfd0 -Summary: Compact C Type Format library (runtime, no BFD dependency) -License: GFDL-1.3-only AND GPL-3.0-or-later -Group: Development/Tools/Building - -%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 - -%ifarch %arm -%define HOST %{_target_cpu}-suse-linux-gnueabi -%else -%define HOST %(echo %{_target_cpu} | sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/" -e "s/sparc64v.*/sparc64/" -e "s/sparcv.*/sparc/")-suse-linux -%endif -%define DIST %(echo '%distribution' | sed 's/ (.*)//') - -%prep -echo "make check will return with %{make_check_handling} in case of testsuite failures." -%setup -q -n binutils-%{version} - -# Backup flex and biscon files for later verification. -cp ld/ldlex.l ld/ldlex.l.orig -cp ld/ldgram.y ld/ldgram.y.orig - -# Patch is outside test_vanilla because it's supposed to be the -# patch bringing the tarball to the newest upstream version -%patch1 -p1 -%if !%{test_vanilla} -%patch3 -p1 -%patch4 -%patch5 -%patch6 -%patch8 -%patch9 -%patch10 -%patch12 -%patch14 -%patch15 -%patch22 -%patch34 -p1 -%patch36 -p1 -%if %{suse_version} < 1550 -%patch37 -p1 -%endif -%patch38 -%patch39 -p1 -%patch40 -p1 -%patch41 -p1 -%if %{suse_version} < 1550 -%patch42 -p1 -%patch43 -p1 -%endif -%patch100 -p1 -%if "%{TARGET}" == "avr" -cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h -%patch90 -%patch92 -%patch93 -p1 -%endif -# -# test_vanilla -%endif - -# Due to legacy flex version present in SLE-12 (and older), we cannot -# re-generate flex and bison files and so we verify that any patch modify these files. -diff -u ld/ldlex.l ld/ldlex.l.orig -diff -u ld/ldgram.y ld/ldgram.y.orig - -%build -%define _lto_cflags %{nil} -sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error" - -%if 0%{!?cross:1} -# Building native binutils -echo "Building native binutils." -%if %build_multitarget -EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc-macos,powerpc-macos10,spu-elf,x86_64-pep" -%else -EXTRA_TARGETS= -%ifarch sparc -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%ifarch ppc -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%ifarch s390 -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%ifarch s390x -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%ifarch %ix86 -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%ifarch ppc ppc64 ppc64le -EXTRA_TARGETS="$EXTRA_TARGETS,spu-elf" -%endif -%ifarch %arm -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%ifarch aarch64 -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%endif -# Normally we'd like to add --enable-deterministic-archives -# here (which by default makes uid/mtime be zero for archive -# members), to increase chances of getting a reproducable build -# But this breaks Makefile rules when directly accessing archives: -# rebuilding the same archive from unchanged .o files recreates -# it, because timestamps in the .a are 0, unequal to the actual timestamp -# of the .o files :-/ -%define common_flags CFLAGS="${RPM_OPT_FLAGS}" CXXFLAGS="${RPM_OPT_FLAGS}" \\\ - --prefix=%{_prefix} --libdir=%{_libdir} \\\ - --infodir=%{_infodir} --mandir=%{_mandir} \\\ - --with-bugurl=http://bugs.opensuse.org/ \\\ - --with-pkgversion="GNU Binutils; %{DIST}" \\\ - --with-separate-debug-dir=%{_prefix}/lib/debug \\\ - --with-pic --with-system-zlib --build=%{HOST} -mkdir build-dir -cd build-dir -../configure %common_flags \ - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} \ - --enable-plugins \ -%ifarch %gold_archs - --enable-gold \ - --enable-threads \ -%endif -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ - --disable-compressed-debug-sections \ -%endif -%if %{suse_version} > 1320 - --enable-compressed-debug-sections=gas \ -%endif -%if %{suse_version} < 1550 - --disable-x86-used-note \ - --disable-separate-code \ -%endif - --enable-new-dtags \ -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - --enable-shared \ -%if %{suse_version} > 1500 - --enable-pgo-build=lto \ -%endif - --enable-obsolete - -# we patch headers (bfd-in.h) that are input to other headers -# which are generated only with --enable-maintainer-mode (which we -# don't do) or explicitely by make headers, so do this: -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -# the above interacts with --enable-pgo-build=lto because all-bfd doesn't -# have the PGO handling, hence it's config.cache files are wrong -# remove all of those for reconfigure -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 - -%else -# building cross-TARGET-binutils -echo "Building cross binutils." -mkdir build-dir -cd build-dir -EXTRA_TARGETS= -%if "%{TARGET}" == "sparc" -EXTRA_TARGETS="$EXTRA_TARGETS,sparc64-suse-linux" -%endif -%if "%{TARGET}" == "powerpc" -EXTRA_TARGETS="$EXTRA_TARGETS,powerpc64-suse-linux" -%endif -%if "%{TARGET}" == "s390" -EXTRA_TARGETS="$EXTRA_TARGETS,s390x-suse-linux" -%endif -%if "%{TARGET}" == "s390x" -EXTRA_TARGETS="$EXTRA_TARGETS,s390-suse-linux" -%endif -%if "%{TARGET}" == "i586" -EXTRA_TARGETS="$EXTRA_TARGETS,x86_64-suse-linux" -%endif -%if "%{TARGET}" == "hppa" -EXTRA_TARGETS="$EXTRA_TARGETS,hppa64-suse-linux" -%endif -%if "%{TARGET}" == "arm" -EXTRA_TARGETS="$EXTRA_TARGETS,arm-suse-linux-gnueabi" -%endif -%if "%{TARGET}" == "aarch64" -EXTRA_TARGETS="$EXTRA_TARGETS,aarch64-suse-linux" -%endif -%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu" || "%{TARGET}" == "pru" -%define TARGET_OS %{TARGET} -%else -%if "%{TARGET}" == "epiphany" || "%{TARGET}" == "riscv32" || "%{TARGET}" == "rx" -%define TARGET_OS %{TARGET}-elf -%else -%if "%{TARGET}" == "arm" -%define TARGET_OS %{TARGET}-suse-linux-gnueabi -%else -%define TARGET_OS %{TARGET}-suse-linux -%endif -%endif -%endif -../configure CFLAGS="${RPM_OPT_FLAGS}" \ - --prefix=%{_prefix} \ - --with-bugurl=http://bugs.opensuse.org/ \ - --with-pkgversion="GNU Binutils; %{DIST}" \ - --with-system-zlib \ - --disable-nls \ - --enable-new-dtags \ - --enable-obsolete \ -%if %{suse_version} <= 1320 - --disable-x86-relax-relocations \ -%endif - --build=%{HOST} --target=%{TARGET_OS} \ -%if "%{TARGET}" == "spu" - --with-sysroot=/usr/spu \ -%else - --with-sysroot=%{_prefix}/%{TARGET_OS}/sys-root \ -%endif -%if "%{TARGET}" != "mips" - --enable-default-hash-style=both \ -%endif - ${EXTRA_TARGETS:+--enable-targets="${EXTRA_TARGETS#,}"} -make %{?_smp_mflags} all-bfd TARGET-bfd=headers V=1 -rm */config.cache -# force reconfiguring -rm bfd/Makefile -make %{?_smp_mflags} V=1 -%if "%{TARGET}" == "avr" -# build an extra nesC version because nesC requires $'s in identifiers -cp -a gas gas-nesc -echo '#include "tc-%{TARGET}-nesc.h"' > gas-nesc/targ-cpu.h -make -C gas-nesc clean -make -C gas-nesc %{?_smp_mflags} -%endif -%endif - -%check -unset SUSE_ASNEEDED -cd build-dir -%if 0%{?cross:1} -make -k check CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" CFLAGS_FOR_TARGET="-O2 -g" CXXFLAGS_FOR_TARGET="-O2 -g" || %{make_check_handling} -%else -make -k check CFLAGS="-g $RPM_OPT_FLAGS" CXXFLAGS="-g $RPM_OPT_FLAGS" CFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" CXXFLAGS_FOR_TARGET="-g $RPM_OPT_FLAGS" || %{make_check_handling} -%endif - -%install -cd build-dir -%if 0%{!?cross:1} -# installing native binutils -%ifarch %gold_archs -make DESTDIR=%{buildroot} install-gold -ln -sf ld.gold %{buildroot}%{_bindir}/gold -%endif -make DESTDIR=%{buildroot} install-info install -make DESTDIR=%{buildroot} install-bfd install-opcodes -if [ ! -f "%{buildroot}/%_bindir/ld.bfd" ]; then - mv "%{buildroot}/%_bindir"/{ld,ld.bfd}; -else - rm -f "%{buildroot}/%_bindir/ld"; -fi -%if ! 0%{with libalternatives} -mkdir -p "%{buildroot}/%_sysconfdir/alternatives"; -# Keep older versions of brp-symlink happy -%if %{suse_version} < 1310 -ln -s "%_bindir/ld" "%{buildroot}/%_sysconfdir/alternatives/ld" -%endif -ln -s "%_sysconfdir/alternatives/ld" "%{buildroot}/%_bindir/ld"; -%else -ln -s %{_bindir}/alts "%{buildroot}/%_bindir/ld"; -mkdir -p %{buildroot}%{_datadir}/libalternatives/ld; -cat > %{buildroot}%{_datadir}/libalternatives/ld/1.conf < %{buildroot}%{_datadir}/libalternatives/ld/2.conf < ../binutils.lang -%endif -%fdupes %{buildroot}%{_prefix} - -%if 0%{!?cross:1} -%post -/sbin/ldconfig -%if ! %{with libalternatives} -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.bfd" 2 -%endif -%install_info --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info --info-dir=%{_infodir} %{_infodir}/ld.info.gz - -%if ! %{with libalternatives} -%post gold -"%_sbindir/update-alternatives" --install \ - "%_bindir/ld" ld "%_bindir/ld.gold" 1 -%endif - -%post -n libctf0 -p /sbin/ldconfig -%post -n libctf-nobfd0 -p /sbin/ldconfig - -%if %{with libalternatives} -%pre -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; - -%pre gold -# removing old update-alternatives entries -if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%preun -%install_info_delete --info-dir=%{_infodir} %{_infodir}/as.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz -%install_info_delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz -%if ! %{with libalternatives} -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.bfd"; -fi; -%endif - -%if ! %{with libalternatives} -%preun gold -if [ "$1" = 0 ]; then - "%_sbindir/update-alternatives" --remove ld "%_bindir/ld.gold"; -fi; -%endif - -%postun -n libctf0 -p /sbin/ldconfig -%postun -n libctf-nobfd0 -p /sbin/ldconfig - -%postun -p /sbin/ldconfig -%endif - -%files -f binutils.lang -%defattr(-,root,root) -%if 0%{!?cross:1} -%{_docdir}/%{name} -%{_prefix}/%{HOST}/bin/* -%{_prefix}/%{HOST}/lib/ldscripts -%{_libdir}/ldscripts -%dir %{_libdir}/bfd-plugins -%{_libdir}/bfd-plugins/libdep.so -%{_bindir}/* -%if ! 0%{with libalternatives} -%ghost %_sysconfdir/alternatives/ld -%else -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/2.conf -%endif -%ifarch %gold_archs -%exclude %{_bindir}/gold -%exclude %{_bindir}/ld.gold -%endif -%doc %{_infodir}/*.gz -%{_libdir}/lib*-%{version}*.so -%doc %{_mandir}/man1/*.1.gz -%else -%{_prefix}/%{TARGET_OS} -%{_prefix}/bin/* -%endif - -%ifarch %gold_archs -%files gold -f binutils-gold.lang -%defattr(-,root,root) -%doc gold/NEWS gold/README -%{_bindir}/gold -%{_bindir}/ld.gold -%if %{with libalternatives} -%dir %{_datadir}/libalternatives -%dir %{_datadir}/libalternatives/ld -%{_datadir}/libalternatives/ld/1.conf -%endif -%endif - -%if 0%{!?cross:1} -%files devel -%defattr(-,root,root) -%{_prefix}/include/*.h -%{_libdir}/lib*.*a -%{_libdir}/libctf.so -%{_libdir}/libctf-nobfd.so - -%files -n libctf0 -%defattr(-,root,root) -%{_libdir}/libctf.so.* - -%files -n libctf-nobfd0 -%defattr(-,root,root) -%{_libdir}/libctf-nobfd.so.* -%endif - -%changelog diff --git a/pre_checkin.sh b/pre_checkin.sh deleted file mode 100644 index 5b75f00..0000000 --- a/pre_checkin.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# the script takes binutils* and creates the cross-* packages - -rm -f cross-*-binutils.spec - -echo '' > _multibuild - -# sh4 is stuck in the testsuite -for arch in aarch64 hppa hppa64 arm i386 x86_64 s390 s390x ppc ppc64 ppc64le ia64 sparc sparc64 spu avr pru mips m68k epiphany rx riscv64 xtensa; do - - echo -n "Building package for $arch --> cross-$arch-binutils ..." - echo " cross-$arch-binutils" >> _multibuild - - targetarch=`echo $arch | sed -e "s/parisc/hppa/;s/i.86/i586/;s/ppc/powerpc/"` - exclarch=`echo $arch | sed -e 's/parisc/hppa/;s/i.86/%ix86/;s/arm/%arm/'` - sed -e "s/^Name:.*binutils\$/Name: cross-$arch-binutils\nExcludeArch: $exclarch\n%define cross 1\n%define TARGET $targetarch/;" \ - < binutils.spec > cross-$arch-binutils.spec - - echo " done." -done - -echo '' >> _multibuild - -osc service localrun format_spec_file -