Summary: A GNU collection of binary utilities for SGX enclaves Name: sgx-compat-binutils2.38 Version: 2.38 Release: 1%{?dist} # Sync from native binutils.spec License: GPL-3.0-or-later AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND (LGPL-2.0-or-later WITH GCC-exception-2.0) AND BSD-3-Clause AND GFDL-1.3-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND LGPL-2.0-or-later URL: https://sourceware.org/binutils Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz # SGX is a technology that only exists in Intel x86 CPUs ExclusiveArch: x86_64 BuildRequires: sgx-srpm-macros BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: bison BuildRequires: m4 BuildRequires: libstdc++-static BuildRequires: texinfo %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). This is a build of a specific older version of binutils, required to create a reproducible build of the fundamental SGX enclaves that matches the pre-built signed binaries provided by Intel. %prep %autosetup -p1 -n binutils-%{version} %build # --enable-XXX args chosen to ensure behaviour matches # the NixOS packages for build reproducibility, do not # alter without re-verifying reproducibility of enclaves ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --bindir=%{_bindir} \ --includedir=%{_includedir} \ --datadir=%{_datadir} \ --program-prefix="%{sgx_triplet}-" \ --program-suffix="-%{version}" \ --enable-deterministic-archives \ --enable-gold \ --enable-new-dtags %make_build %{_smp_mflags} all %install %make_install %{_smp_mflags} # Various bits we don't need in our build, since this toolchain # is exclusively for use with SGX SDK, not any other code. rm -rf %{buildroot}%{_prefix}/x86_64-pc-linux-gnu rm -rf %{buildroot}%{_datadir} rm -rf %{buildroot}%{_includedir} rm -rf %{buildroot}%{_libdir} %files %license COPYING COPYING3 COPYING3.LIB COPYING.LIB %{_bindir}/%{sgx_triplet}-addr2line-%{version} %{_bindir}/%{sgx_triplet}-ar-%{version} %{_bindir}/%{sgx_triplet}-as-%{version} %{_bindir}/%{sgx_triplet}-c++filt-%{version} %{_bindir}/%{sgx_triplet}-dwp-%{version} %{_bindir}/%{sgx_triplet}-elfedit-%{version} %{_bindir}/%{sgx_triplet}-gprof-%{version} %{_bindir}/%{sgx_triplet}-ld-%{version} %{_bindir}/%{sgx_triplet}-ld.bfd-%{version} %{_bindir}/%{sgx_triplet}-ld.gold-%{version} %{_bindir}/%{sgx_triplet}-nm-%{version} %{_bindir}/%{sgx_triplet}-objcopy-%{version} %{_bindir}/%{sgx_triplet}-objdump-%{version} %{_bindir}/%{sgx_triplet}-ranlib-%{version} %{_bindir}/%{sgx_triplet}-readelf-%{version} %{_bindir}/%{sgx_triplet}-size-%{version} %{_bindir}/%{sgx_triplet}-strings-%{version} %{_bindir}/%{sgx_triplet}-strip-%{version}