Projects
home:pandora:RobinOS23
binutils
_service:download_src_package:binutils.spec
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:download_src_package:binutils.spec of Package binutils
%define anolis_release 1 # Determine if this is a native build or a cross build. # # For a cross build add --define "binutils_target <target>" to the command # line when building the rpms. # # For example: # --define "binutils_target aarch64-linux-gnu" # # Cross builds will create a set of binutils executables that will run on the # host machine but which will create binaries suitable for running on the # target machine. The cross tools will have the target name as a prefix, # but for compatibility with the kernel the rpms will use the target name # as an infix. So for example building with the above define will create a # set of rpms like this: # # binutils-aarch64-linux-gnu-2.35.1-14.fc34.x86_64.rpm # binutils-aarch64-linux-gnu-debuginfo-2.35.1-14.fc34.x86_64.rpm # [etc] # # and the rpms will contain files like: # # /usr/bin/aarch64-linux-gnu-addr2line # /usr/bin/aarch64-linux-gnu-ar # /usr/bin/aarch64-linux-gnu-as # [etc] %if 0%{!?binutils_target:1} %define binutils_target %{_target_platform} %define isnative 1 %define enable_shared 1 %else %define cross %{binutils_target}- %define name_cross -%{binutils_target} %define isnative 0 %define enable_shared 0 %endif Summary: A GNU collection of binary utilities Name: binutils%{?name_cross}%{?_with_debug:-debug} Version: 2.38 Release: %{anolis_release}%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils #---------------------------------------------------------------------------- # Binutils SPEC file. Can be invoked with the following parameters to change # the default behaviour: # --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils. # # --with bootstrap Build with minimal dependencies. # --with debug Build without optimizations and without splitting # the debuginfo into a separate file. # --without docs Skip building documentation. # Default is with docs, except when building a cross binutils. # --without testsuite Do not run the testsuite. Default is to run it. # --without gold Disable building of the GOLD linker. # --with clang To force building with the CLANG. # --without debuginfod Disable support for debuginfod. #---Start of Configure Options----------------------------------------------- # Create deterministic archives (ie ones without timestamps). # Default is off because of BZ 1195883. %define enable_deterministic_archives 0 # Enable support for GCC LTO compilation. # Disable if it is necessary to work around bugs in LTO. %define enable_lto 1 # Enable support for generating new dtags in the linker # Disable if it is necessary to use RPATH instead. %define enable_new_dtags 1 # Enable the compression of debug sections as default behaviour of the # assembler and linker. This option is disabled for now. The assembler and # linker have command line options to override the default behaviour. %define default_compress_debug 0 # Default to read-only-relocations (relro) in shared binaries. # This is enabled as a security feature. %define default_relro 1 # Enable the default generation of GNU Build notes by the assembler. # This option is disabled as it has turned out to be problematic for the i686 # architecture, although the exact reason has not been determined. (See # BZ 1572485). It also breaks building EFI binaries on AArch64, as these # cannot have relocations against absolute symbols. %define default_generate_notes 0 # Enable thread support in the GOLD linker (if it is being built). This is # particularly important if plugins to the linker intend to use threads # themselves. See BZ 1636479 for more details. This option is made # configurable in case there is ever a need to disable thread support. %define enable_threading 1 # Enable the use of separate code and data segments for all architectures, # not just x86/x86_64. %define enable_separate_code 1 #----End of Configure Options------------------------------------------------ # Note - in the future the gold linker may become deprecated. %bcond_without gold # Default: Not bootstrapping. %bcond_with bootstrap # Default: Not debug %bcond_with debug # Default: Always build documentation. %bcond_without docs # Default: Always run the testsuite. %bcond_without testsuite # Default: support debuginfod. %bcond_without debuginfod # Use the system supplied version of the zlib compress library. # Change this to use the binutils builtin version instead. %bcond_without systemzlib # Allow the user to override the compiler used to build the binutils. # The default build compiler is gcc if %%toolchain is not clang. %if "%toolchain" == "clang" %bcond_without clang %else %bcond_with clang %endif %if %{with clang} %global toolchain clang %else %global toolchain gcc %endif %if %{with bootstrap} %undefine with_docs %undefine with_testsuite %endif %if %{with debug} %undefine with_testsuite %endif # The opcodes library needs a few functions defined in the bfd # library, but these symbols are not defined in the stub bfd .so # that is available at link time. (They are present in the real # .so that is used at run time). %undefine _strict_symbol_defs_build # BZ 1924068. Since applications that use the BFD library are # required to link against the static version, ensure that it retains # its debug informnation. %undefine __brp_strip_static_archive #---------------------------------------------------------------------------- # Note - the Linux Kernel binutils releases are too unstable and contain # too many controversial patches so we stick with the official FSF version # instead. Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz Source2: binutils-2.19.50.0.1-output-format.sed #---------------------------------------------------------------------------- # Purpose: Use /lib64 and /usr/lib64 instead of /lib and /usr/lib in the # default library search path of 64-bit targets. # Lifetime: Permanent, but it should not be. This is a bug in the libtool # sources used in both binutils and gcc, (specifically the # libtool.m4 file). These are based on a version released in 2009 # (2.2.6?) rather than the latest version. (Definitely fixed in # libtool version 2.4.6). Patch01: binutils-libtool-lib64.patch # Purpose: Appends a RHEL or Fedora release string to the generic binutils # version string. # Lifetime: Permanent. This is a RHEL/Fedora specific patch. Patch02: binutils-version.patch # Purpose: Exports the demangle.h header file (associated with the libiberty # sources) with the binutils-devel rpm. # Lifetime: Permanent. This is a RHEL/Fedora specific patch. Patch03: binutils-export-demangle.h.patch # Purpose: Disables the check in the BFD library's bfd.h header file that # config.h has been included before the bfd.h header. See BZ # #845084 for more details. # Lifetime: Permanent - but it should not be. The bfd.h header defines # various types that are dependent upon configuration options, so # the order of inclusion is important. # FIXME: It would be better if the packages using the bfd.h header were # fixed so that they do include the header files in the correct # order. Patch04: binutils-no-config-h-check.patch # Purpose: Include the filename concerned in readelf error messages. This # makes readelf's output more helpful when it is run on multiple # input files. # Lifetime: Permanent. This patch changes the format of readelf's output, # making it better (IMHO) but also potentially breaking tools that # depend upon readelf's current format. Hence it remains a local # patch. Patch05: binutils-filename-in-error-messages.patch # Purpose: Disable an x86/x86_64 optimization that moves functions from the # PLT into the GOTPLT for faster access. This optimization is # problematic for tools that want to intercept PLT entries, such # as ltrace and LD_AUDIT. See BZs 1452111 and 1333481. # Lifetime: Permanent. But it should not be. # FIXME: Replace with a configure time option. Patch06: binutils-revert-PLT-elision.patch # Purpose: Changes readelf so that when it displays extra information about # a symbol, this information is placed at the end of the line. # Lifetime: Permanent. # FIXME: The proper fix would be to update the scripts that are expecting # a fixed output from readelf. But it seems that some of them are # no longer being maintained. Patch07: binutils-readelf-other-sym-info.patch # Purpose: Do not create PLT entries for AARCH64 IFUNC symbols referenced in # debug sections. # Lifetime: Permanent. # FIXME: Find related bug. Decide on permanency. Patch08: binutils-2.27-aarch64-ifunc.patch # Purpose: Stop the binutils from statically linking with libstdc++. # Lifetime: Permanent. Patch09: binutils-do-not-link-with-static-libstdc++.patch # Purpose: Allow OS specific sections in section groups. # Lifetime: Fixed in 2.38 (maybe) Patch10: binutils-special-sections-in-groups.patch # Purpose: Fix linker testsuite failures. # Lifetime: Fixed in 2.37 (maybe) Patch11: binutils-fix-testsuite-failures.patch # Purpose: Stop gold from aborting when input sections with the same name # have different flags. # Lifetime: Fixed in 2.38 (maybe) Patch12: binutils-gold-mismatched-section-flags.patch # Purpose: Add a check to the GOLD linker for a corrupt input file # with a fuzzed section offset. # Lifetime: Fixed in 2.38 (maybe) Patch13: binutils-CVE-2019-1010204.patch # Purpose: Change the gold configuration script to only warn about # unsupported targets. This allows the binutils to be built with # BPF support enabled. # Lifetime: Permanent. Patch14: binutils-gold-warn-unsupported.patch # Purpose: Use the "unsigned long long" type for pointers on hosts where # long is a 32-bit type but pointers are a 64-bit type. Necessary # because users expect to be able to install both the i686- and # x86_64 versions of binutils-devel on the same machine, so they # need to identical versions of the bfd.h header file. # Lifetime: Permanent. Patch15: binutils-use-long-long.patch # Purpose: Fix testsuite failures due to the patches applied here. # Lifetime: Permanent, but varying with each new rebase. Patch16: binutils-testsuite-fixes.patch # Purpose: Enable the creation of .note.gnu.property sections by the GOLD # linker for x86 binaries. # Lifetime: Fixed in 2.38 maybe Patch17: binutils-gold-i386-gnu-property-notes.patch # Purpose: Allow the binutils to be configured with any (recent) version of # autoconf. # Lifetime: Fixed in 2.39 (maybe ?) Patch18: binutils-autoconf-version.patch # Purpose: Stop libtool from inserting useless runpaths into binaries. # Lifetime: Who knows. Patch19: gcc12-libtool-no-rpath.patch # Purpose: Add support for specifying section types in linker scripts. # Lifetime: Fixed in 2.39 Patch20: binutils-section-type.patch #---------------------------------------------------------------------------- Provides: bundled(libiberty) BuildRequires: autoconf BuildRequires: automake # Can be dropped once binutils-ld-read-only-script.patch is removed BuildRequires: bison %if %{with gold} # For now we make the binutils package require the gold sub-package. # That way other packages that have a requirement on "binutils" but # actually want gold will not have to be changed. In the future, if # we decide to deprecate gold, we can remove this requirement, and # then update other packages as necessary. Requires: binutils-gold >= %{version} %endif %if %{with debug} # Define this if you want to skip the strip step and preserve debug info. # Useful for testing. %define __debug_install_post : > %{_builddir}/%{?buildsubdir}/debugfiles.list %define debug_package %{nil} %endif # Perl, sed and touch are all used in the %%prep section of this spec file. BuildRequires: perl, sed, coreutils BuildRequires: make %if %{with clang} BuildRequires: clang compiler-rt %else BuildRequires: gcc %endif %if %{without bootstrap} BuildRequires: gettext, flex, zlib-devel %endif %if %{with docs} BuildRequires: texinfo >= 4.0 # BZ 920545: We need pod2man in order to build the manual pages. BuildRequires: /usr/bin/pod2man %else BuildRequires: findutils %endif # Required for: ld-bootstrap/bootstrap.exp bootstrap with --static # It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array %if %{with testsuite} # relro_test.sh uses dc which is part of the bc rpm, hence its inclusion here. BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc, libstdc++ %endif Requires(post): %{_sbindir}/alternatives Requires(preun): %{_sbindir}/alternatives # We also need rm. Requires(post): coreutils %define _gnu %{nil} %if %{with debuginfod} BuildRequires: elfutils-debuginfod-client-devel %endif #---------------------------------------------------------------------------- %description Binutils is a collection of binary utilities, including ar (for creating, modifying and extracting from archives), as (a family of GNU assemblers), gprof (for displaying call graph profile data), ld (the GNU linker), nm (for listing symbols from object files), objcopy (for copying and translating object files), objdump (for displaying information from object files), ranlib (for generating an index for the contents of an archive), readelf (for displaying detailed information about binary files), size (for listing the section sizes of an object or archive file), strings (for listing printable strings from files), strip (for discarding symbols), and addr2line (for converting addresses to file and line). #---------------------------------------------------------------------------- %package devel Summary: BFD and opcodes static and dynamic libraries and header files Provides: binutils-static = %{version}-%{release} Requires: zlib-devel Requires: binutils = %{version}-%{release} # BZ 1215242: We need touch... Requires: coreutils %description devel This package contains BFD and opcodes static and dynamic libraries. The dynamic libraries are in this package, rather than a separate base package because they are actually linker scripts that force the use of the static libraries. This is because the API of the BFD library is too unstable to be used dynamically. The static libraries are here because they are now needed by the dynamic libraries. Developers starting new projects are strongly encouraged to consider using libelf instead of BFD. # BZ 1924068. Since applications that use the BFD library are # required to link against the static version, ensure that it retains # its debug informnation. # FIXME: Yes - this is being done twice. I have no idea why this # second invocation is necessary but if both are not present the # static archives will be stripped. %undefine __brp_strip_static_archive #---------------------------------------------------------------------------- %if %{with gold} %package gold Summary: The GOLD linker, a faster alternative to the BFD linker Provides: gold = %{version}-%{release} Requires: binutils >= %{version} %description gold This package provides the GOLD linker, which can be used as an alternative to the default binutils linker (ld.bfd). The GOLD is generally faster than the BFD linker, and it supports features such as Identical Code Folding and Incremental linking. Unfortunately it is not as well maintained as the BFD linker, and it may become deprecated in the future. # Gold needs bison in order to build gold/yyscript.c. BuildRequires: bison, m4, gcc-c++ # The GOLD testsuite needs a static libc++ BuildRequires: libstdc++-static %if ! %{with clang} BuildRequires: gcc-c++ Conflicts: gcc-c++ < 4.0.0 %endif # The higher of these two numbers determines the default ld. %{!?ld_gold_priority:%global ld_gold_priority 30} %endif %{!?ld_bfd_priority: %global ld_bfd_priority 50} #---------------------------------------------------------------------------- %prep %autosetup -p1 -n binutils-%{version} # On ppc64 and aarch64, we might use 64KiB pages sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*ppc.c sed -i -e '/#define.*ELF_COMMONPAGESIZE/s/0x1000$/0x10000/' bfd/elf*aarch64.c sed -i -e '/common_pagesize/s/4 /64 /' gold/powerpc.cc sed -i -e '/pagesize/s/0x1000,/0x10000,/' gold/aarch64.cc # LTP sucks perl -pi -e 's/i\[3-7\]86/i[34567]86/g' */conf* sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in} sed -i -e '/^libopcodes_la_\(DEPENDENCIES\|LIBADD\)/s,$, ../bfd/libbfd.la,' opcodes/Makefile.{am,in} # Build libbfd.so and libopcodes.so with -Bsymbolic-functions if possible. if gcc %{optflags} -v --help 2>&1 | grep -q -- -Bsymbolic-functions; then sed -i -e 's/^libbfd_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' bfd/Makefile.{am,in} sed -i -e 's/^libopcodes_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' opcodes/Makefile.{am,in} fi # $PACKAGE is used for the gettext catalog name. sed -i -e 's/^ PACKAGE=/ PACKAGE=%{?cross}/' */configure # Undo the name change to run the testsuite. for tool in binutils gas ld do sed -i -e "2aDEJATOOL = $tool" $tool/Makefile.am sed -i -e "s/^DEJATOOL = .*/DEJATOOL = $tool/" $tool/Makefile.in done # Touch the .info files so that they are newer then the .texi files and # hence do not need to be rebuilt. This eliminates the need for makeinfo. # The -print is there just to confirm that the command is working. %if %{without docs} find . -name *.info -print -exec touch {} \; %endif # If we are creating the docs, touch the texi files so that the info and # man pages will be rebuilt. %if %{with docs} find . -name *.texi -print -exec touch {} \; %endif #---------------------------------------------------------------------------- %build echo target is %{binutils_target} # There is a problem with the clang+libtool+lto combination. # The LDFLAGS containing -flto are not being passed when linking the # libbfd.so, so the build fails. Solution: disable LTO. %if %{with clang} %define enable_lto 0 %endif %if !0%{?enable_lto} %global _lto_cflags %{nil} %endif %set_build_flags %if %{with debug} export CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0" %define enable_shared 0 %endif %if %{with clang} %define _with_cc_clang 1 %endif # BZ 1541027 - include the linker flags from system-rpm-config as well. export LDFLAGS=$RPM_LD_FLAGS %if %{enable_new_dtags} export LDFLAGS="$LD_FLAGS -Wl,--enable-new-dtags" %endif CARGS= %if %{with debuginfod} CARGS="$CARGS --with-debuginfod" %endif %ifarch x86_64 CARGS="$CARGS --enable-64-bit-bfd" %endif # Extra targets to build along with the default one. # # BZ 1920373: Enable PEP support for all targets as the PERF package's # testsuite expects to be able to read PE format files ragrdless of # the host's architecture. # # Also enable the BPF target so that strip will work on BPF files. CARGS="$CARGS --enable-targets=x86_64-pep,bpf-unknown-none" %if %{default_relro} CARGS="$CARGS --enable-relro=yes" %else CARGS="$CARGS --enable-relro=no" %endif # We could improve the cross build's size by setting --enable-shared but # the produced binaries may be less convenient in the embedded environment. %configure \ --quiet \ --build=%{_target_platform} --host=%{_target_platform} \ --target=%{binutils_target} \ %if %{with gold} --enable-gold=default \ %endif --enable-ld \ %if %{isnative} --with-sysroot=/ \ %else --enable-targets=%{_host} \ --with-sysroot=%{_prefix}/%{binutils_target}/sys-root \ --program-prefix=%{cross} \ %endif %if %{with systemzlib} --with-system-zlib \ %endif %if %{enable_shared} --enable-shared \ %else --disable-shared \ %endif %if %{enable_deterministic_archives} --enable-deterministic-archives \ %else --enable-deterministic-archives=no \ %endif %if %{enable_lto} --enable-lto \ %endif %if %{enable_new_dtags} --enable-new-dtags \ --disable-rpath \ %endif %if %{default_compress_debug} --enable-compressed-debug-sections=all \ %else --enable-compressed-debug-sections=none \ %endif %if %{default_generate_notes} --enable-generate-build-notes=yes \ %else --enable-generate-build-notes=no \ %endif %if %{enable_threading} --enable-threads=yes \ %else --enable-threads=no \ %endif %if %{enable_separate_code} --enable-separate-code=yes \ %endif $CARGS \ --enable-plugins \ --with-bugurl=http://bugzilla.openanolis.cn/ \ || cat config.log %if %{with docs} %make_build tooldir=%{_prefix} all %make_build tooldir=%{_prefix} info %else %make_build tooldir=%{_prefix} MAKEINFO=true all %endif # Do not use %%check as it is run after %%install where libbfd.so is rebuilt # with -fvisibility=hidden no longer being usable in its shared form. %if %{without testsuite} echo ====================TESTSUITE DISABLED========================= %else make -k check < /dev/null || : echo ====================TESTING========================= cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum %if %{with gold} if [ -f gold/test-suite.log ]; then cat gold/test-suite.log fi if [ -f gold/testsuite/test-suite.log ]; then cat gold/testsuite/*.log fi %endif echo ====================TESTING END===================== for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log} do ln $file binutils-%{_target_platform}-$(basename $file) || : done tar cjf binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}-*.{sum,log} uuencode binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}.tar.xz rm -f binutils-%{_target_platform}.tar.xz binutils-%{_target_platform}-*.{sum,log} %if %{with gold} if [ -f gold/testsuite/test-suite.log ]; then tar cjf binutils-%{_target_platform}-gold.log.tar.xz gold/testsuite/*.log uuencode binutils-%{_target_platform}-gold.log.tar.xz binutils-%{_target_platform}-gold.log.tar.xz rm -f binutils-%{_target_platform}-gold.log.tar.xz fi %endif %endif #---------------------------------------------------------------------------- %install %if %{with docs} %make_install %else %make_install MAKEINFO=true %endif %if %{isnative} %if %{with docs} make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info %endif # Rebuild libiberty.a with -fPIC. # Future: Remove it together with its header file, projects should bundle it. %make_build -C libiberty clean %set_build_flags %make_build CFLAGS="-g -fPIC $CFLAGS" -C libiberty %if %{enable_new_dtags} export LDFLAGS="$RPM_LD_FLAGS -Wl,--enable-new-dtags" %endif # Rebuild libbfd.a with -fPIC. # Without the hidden visibility the 3rd party shared libraries would export # the bfd non-stable ABI. %make_build -C bfd clean %set_build_flags %make_build CFLAGS="-g -fPIC $CFLAGS -fvisibility=hidden" -C bfd # Rebuild libopcodes.a with -fPIC. %make_build -C opcodes clean %set_build_flags %make_build CFLAGS="-g -fPIC $CFLAGS" -C opcodes install -m 644 bfd/libbfd.a %{buildroot}%{_libdir} install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir} install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir} # Remove Windows/Novell only man pages rm -f %{buildroot}%{_mandir}/man1/{dlltool,nlmconv,windres,windmc}* %if %{without docs} rm -f %{buildroot}%{_mandir}/man1/{addr2line,ar,as,c++filt,elfedit,gprof,ld,nm,objcopy,objdump,ranlib,readelf,size,strings,strip}* rm -f %{buildroot}%{_infodir}/{as,bfd,binutils,gprof,ld}* %endif %if %{enable_shared} chmod +x %{buildroot}%{_libdir}/lib*.so* %endif # Prevent programs from linking against libbfd and libopcodes # dynamically, as they are changed far too often. rm -f %{buildroot}%{_libdir}/lib{bfd,opcodes}.so # Remove libtool files, which reference the .so libs rm -f %{buildroot}%{_libdir}/*.la # Fix multilib conflicts of generated values by __WORDSIZE-based expressions. %ifarch x86_64 # Sanity check --enable-64-bit-bfd really works. grep '^#define BFD_ARCH_SIZE 64$' %{buildroot}%{_prefix}/include/bfd.h sed -i -e '/^#include "ansidecl.h"/{p;s~^.*$~#include <bits/wordsize.h>~;}' \ -e 's/^#define BFD_DEFAULT_TARGET_SIZE \(32\|64\) *$/#define BFD_DEFAULT_TARGET_SIZE __WORDSIZE/' \ -e 's/^#define BFD_HOST_64BIT_LONG [01] *$/#define BFD_HOST_64BIT_LONG (__WORDSIZE == 64)/' \ -e 's/^#define BFD_HOST_64_BIT \(long \)\?long *$/#if __WORDSIZE == 32\ #define BFD_HOST_64_BIT long long\ #else\ #define BFD_HOST_64_BIT long\ #endif/' \ -e 's/^#define BFD_HOST_U_64_BIT unsigned \(long \)\?long *$/#define BFD_HOST_U_64_BIT unsigned BFD_HOST_64_BIT/' \ %{buildroot}%{_prefix}/include/bfd.h %endif touch -r bfd/bfd-in2.h %{buildroot}%{_prefix}/include/bfd.h # Generate .so linker scripts for dependencies; imported from glibc/Makerules: # This fragment of linker script gives the OUTPUT_FORMAT statement # for the configuration we are building. OUTPUT_FORMAT="\ /* Ensure this .so library will not be used by a link for a different format on a multi-architecture system. */ $(gcc $CFLAGS $LDFLAGS -shared -x c /dev/null -o /dev/null -Wl,--verbose -v 2>&1 | sed -n -f "%{SOURCE2}")" tee %{buildroot}%{_libdir}/libbfd.so <<EOH /* GNU ld script */ $OUTPUT_FORMAT /* The libz dependency is unexpected by legacy build scripts. */ /* The libdl dependency is for plugin support. (BZ 889134) */ INPUT ( %{_libdir}/libbfd.a -liberty -lz -ldl ) EOH tee %{buildroot}%{_libdir}/libopcodes.so <<EOH /* GNU ld script */ $OUTPUT_FORMAT INPUT ( %{_libdir}/libopcodes.a -lbfd ) EOH %else # For cross-binutils we drop the documentation. rm -rf %{buildroot}%{_infodir} # We keep these as one can have native + cross binutils of different versions. #rm -rf {buildroot}{_prefix}/share/locale #rm -rf {buildroot}{_mandir} rm -rf %{buildroot}%{_libdir}/libiberty.a # Remove libtool files, which reference the .so libs rm -f %{buildroot}%{_libdir}/*.la %endif # This one comes from gcc rm -f %{buildroot}%{_infodir}/dir rm -rf %{buildroot}%{_prefix}/%{binutils_target} %find_lang %{?cross}binutils %find_lang %{?cross}opcodes %find_lang %{?cross}bfd %find_lang %{?cross}gas %find_lang %{?cross}gprof cat %{?cross}opcodes.lang >> %{?cross}binutils.lang cat %{?cross}bfd.lang >> %{?cross}binutils.lang cat %{?cross}gas.lang >> %{?cross}binutils.lang cat %{?cross}gprof.lang >> %{?cross}binutils.lang if [ -x ld/ld-new ]; then %find_lang %{?cross}ld cat %{?cross}ld.lang >> %{?cross}binutils.lang fi if [ -x gold/ld-new ]; then %find_lang %{?cross}gold cat %{?cross}gold.lang >> %{?cross}binutils.lang fi #---------------------------------------------------------------------------- %post %__rm -f %{_bindir}/%{?cross}ld %{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \ %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority} %if %{with gold} %{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \ %{_bindir}/%{?cross}ld.gold %{ld_gold_priority} %endif # Do not run "alternatives --auto ld" here. Leave the setting to # however the user previously had it set. See BZ 1592069 for more details. %if %{isnative} %ldconfig_post %endif exit 0 #---------------------------------------------------------------------------- %preun if [ $1 = 0 ]; then %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd fi %if %{with gold} if [ $1 = 0 ]; then %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold fi %endif exit 0 #---------------------------------------------------------------------------- %if %{isnative} %postun %ldconfig_postun %endif #---------------------------------------------------------------------------- %files -f %{?cross}binutils.lang %license COPYING COPYING3 COPYING3.LIB COPYING.LIB %doc README %{_bindir}/%{?cross}[!l]* # %%verify(symlink) does not work for some reason, so using "owner" instead. %verify(owner) %{_bindir}/%{?cross}ld %{_bindir}/%{?cross}ld.bfd %if %{with docs} %{_mandir}/man1/ %if %{isnative} %{_infodir}/as.info.* %{_infodir}/binutils.info.* %{_infodir}/gprof.info.* %{_infodir}/ld.info.* %{_infodir}/bfd.info.* %{_infodir}/ctf-spec.info.* %endif %endif %if %{enable_shared} %{_libdir}/lib*.so %{_libdir}/libctf* %exclude %{_libdir}/libbfd.so %exclude %{_libdir}/libopcodes.so %{_libdir}/bfd-plugins/libdep.so %exclude %{_exec_prefix}/lib/debug/%{_libdir}/bfd-plugins/libdep.so-* %endif %if %{isnative} %files devel %{_prefix}/include/* %{_libdir}/lib*.a %{_libdir}/libbfd.so %{_libdir}/libopcodes.so %endif %if %{with gold} %files gold %{_bindir}/%{?cross}ld.gold %endif %changelog * Thu Feb 24 2022 Chunmei Xu <xuchunmei@linux.alibaba.com> - 2.38-1 - Rebase on GNU Binutils 2.38.
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2