Revert "Added `cross-binutils` and `kernel-cross-headers` for AMD64. … (#6947)

This commit is contained in:
Pawel Winogrodzki 2023-12-07 20:20:13 -08:00 committed by GitHub
parent 52513addde
commit 70f29fb830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 268 deletions

View File

@ -10,7 +10,7 @@
Summary: Signed Linux Kernel for %{buildarch} systems
Name: kernel-signed-%{buildarch}
Version: 5.15.139.1
Release: 2%{?dist}
Release: 1%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Mariner
@ -153,9 +153,6 @@ ln -sf linux-%{uname_r}.cfg /boot/mariner.cfg
%exclude /module_info.ld
%changelog
* Tue Dec 05 2023 Pawel Winogrodzki <pawelwi@microsoft.com> - 5.15.139.1-2
- Bump release to match kernel-headers.
* Tue Dec 05 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.139.1-1
- Auto-upgrade to 5.15.139.1

View File

@ -1,28 +1,7 @@
# Overriding the default to call 'configure' from subdirectories.
%global _configure ../configure
# Where the binaries aimed at gcc will live (ie. /usr/<target>/bin/).
%global auxbin_prefix %{_exec_prefix}
%ifarch x86_64
%global build_cross 1
%else
%global build_cross 0
%endif
%global build_aarch64 %{build_cross}
%global do_files() \
%if %2 \
%files -n binutils-%1 \
%{_prefix}/%1 \
%{_bindir}/%1-* \
%endif
Summary: Contains a linker, an assembler, and other tools
Name: binutils
Version: 2.37
Release: 8%{?dist}
Release: 7%{?dist}
License: GPLv2+
Vendor: Microsoft Corporation
Distribution: Mariner
@ -37,20 +16,8 @@ Patch2: thin_archive_descriptor.patch
Patch3: CVE-2021-45078.patch
Patch4: CVE-2022-38533.patch
Patch5: CVE-2022-4285.patch
# The gold linker doesn't understand the 'module_info.ld' script passed to all linkers and the tests fail to correctly link.
Patch6: disable_gold_test.patch
Provides: bundled(libiberty)
# Moving macro before the "SourceX" tags breaks PR checks parsing the specs.
%global do_package() \
%if %2 \
%package -n binutils-%1 \
Summary: Cross-build binary utilities for %1 \
Requires: cross-%{name}-common = %{version}-%{release} \
%description -n binutils-%1 \
Cross-build binary image generation, manipulation and query tools for the %1 architecture. \
%endif
%description
The Binutils package contains a linker, an assembler,
and other tools for handling object files.
@ -63,61 +30,10 @@ Requires: %{name} = %{version}
It contains the libraries and header files to create applications
for handling compiled objects.
%if %{build_cross}
%package -n cross-%{name}-common
Summary: Cross-compilation binutils documentation
BuildArch: noarch
%description -n cross-%{name}-common
Documentation for the cross-compilation binutils package.
%endif
%do_package aarch64-linux-gnu %{build_aarch64}
%prep
%autosetup -p1
function prep_target () {
local target=$1
local condition=$2
if [ $condition != 0 ]
then
echo $1 >> cross.list
fi
}
touch cross.list
prep_target aarch64-linux-gnu %{build_aarch64}
%if %{build_cross}
# $PACKAGE is used for the gettext catalog name when building 'cross-binutils-common'.
sed -i -e 's/^ PACKAGE=/ PACKAGE=cross-/' */configure
%endif
%build
function config_cross_target () {
local target=$1
mkdir $target
pushd $target
%configure \
--exec-prefix=%{auxbin_prefix} \
--program-prefix=$target- \
--target=$target \
--disable-multilib \
--disable-nls \
--disable-install_libbfd \
--with-sysroot=%{_prefix}/$target/sys-root
popd
}
mkdir build
pushd build
%configure \
--disable-silent-rules \
--disable-werror \
@ -127,75 +43,20 @@ pushd build
--enable-shared \
--with-system-zlib
popd
%make_build -C build tooldir=%{_prefix}
while read -r target
do
echo "=== BUILD cross-compilation target $target ==="
config_cross_target $target
%make_build -C $target tooldir=%{_prefix}
done < cross.list
%if %{build_cross}
# For documentation purposes only.
mkdir cross-binutils
pushd cross-binutils
%configure \
--exec-prefix=%{auxbin_prefix} \
--program-prefix=cross- \
--disable-dependency-tracking \
--disable-silent-rules \
--disable-shared
popd
%make_build -C cross-binutils tooldir=%{_prefix}
%endif
%make_build tooldir=%{_prefix}
%install
%make_install -C build tooldir=%{_prefix}
%make_install tooldir=%{_prefix}
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf %{buildroot}%{_infodir}
%find_lang %{name} --all-name
install -m 644 build/libiberty/pic/libiberty.a %{buildroot}%{_libdir}
install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_libdir}
install -m 644 include/libiberty.h %{buildroot}%{_includedir}
while read -r target
do
echo "=== INSTALL cross-compilation target $target ==="
mkdir -p %{buildroot}%{_prefix}/$target/sys-root
%make_install -C $target tooldir=%{auxbin_prefix}/$target DESTDIR=%{buildroot}
# Remove cross man files and ldscripts.
rm -rf %{buildroot}%{_mandir}/man1/$target-*
rm -rf %{buildroot}%{auxbin_prefix}/*/lib
done < cross.list
rm -rf %{buildroot}%{_infodir}
find %{buildroot} -type f -name "*.la" -delete -print
%if %{build_cross}
echo "=== INSTALL po targets ==="
for binary_name in binutils opcodes bfd gas ld gprof
do
%make_install -C cross-binutils/$binary_name/po DESTDIR=%{buildroot}
done
# Find the language files which only exist in the common package.
(
for binary_name in binutils opcodes bfd gas ld gprof
do
%find_lang cross-$binary_name
cat cross-${binary_name}.lang
done
) >files.cross
%endif
%check
%make_build -C build tooldir=%{_prefix} check
sed -i 's/testsuite/ /g' gold/Makefile
%make_build check
%ldconfig_scriptlets
@ -221,8 +82,6 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_bindir}/readelf
%{_bindir}/strip
%{_libdir}/ldscripts/*
%{_libdir}/libbfd-%{version}.so
%{_libdir}/libopcodes-%{version}.so
%{_mandir}/man1/readelf.1.gz
%{_mandir}/man1/windmc.1.gz
%{_mandir}/man1/ranlib.1.gz
@ -241,6 +100,8 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_mandir}/man1/windres.1.gz
%{_mandir}/man1/size.1.gz
%{_mandir}/man1/objdump.1.gz
%{_libdir}/libbfd-%{version}.so
%{_libdir}/libopcodes-%{version}.so
%files devel
%{_includedir}/ansidecl.h
@ -269,18 +130,7 @@ find %{buildroot} -type f -name "*.la" -delete -print
%{_libdir}/libopcodes.a
%{_libdir}/libopcodes.so
%if %{build_cross}
%files -n cross-%{name}-common -f files.cross
%license COPYING
%endif
%do_files aarch64-linux-gnu %{build_aarch64}
%changelog
* Fri Nov 17 2023 Pawel Winogrodzki <pawelwi@microsoft.com> - 2.37-8
- Add the cross-compilation subpackage for aarch64.
- Used Fedora 38 spec (license: MIT) for guidance.
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 2.37-7
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)

View File

@ -1,34 +0,0 @@
diff --git a/Makefile.in b/Makefile.in
index 9b3a5d75..8c955d5a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -16070,13 +16070,7 @@ maybe-check-gold:
@if gold
maybe-check-gold: check-gold
-check-gold:
- @: $(MAKE); $(unstage)
- @r=`${PWD_COMMAND}`; export r; \
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(HOST_EXPORTS) $(EXTRA_HOST_EXPORTS) \
- (cd $(HOST_SUBDIR)/gold && \
- $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_BOOTSTRAP_FLAGS) check)
+check-gold: ;
@endif gold
@@ -52322,14 +52316,12 @@ all-stage3-gold: maybe-all-stage3-gas
all-stage4-gold: maybe-all-stage4-gas
all-stageprofile-gold: maybe-all-stageprofile-gas
all-stagefeedback-gold: maybe-all-stagefeedback-gas
-check-gold: maybe-all-binutils
check-stage1-gold: maybe-all-stage1-binutils
check-stage2-gold: maybe-all-stage2-binutils
check-stage3-gold: maybe-all-stage3-binutils
check-stage4-gold: maybe-all-stage4-binutils
check-stageprofile-gold: maybe-all-stageprofile-binutils
check-stagefeedback-gold: maybe-all-stagefeedback-binutils
-check-gold: maybe-all-gas
check-stage1-gold: maybe-all-stage1-gas
check-stage2-gold: maybe-all-stage2-gas
check-stage3-gold: maybe-all-stage3-gas

View File

@ -1,24 +1,14 @@
# This package doesn't contain any binaries, thus no debuginfo package is needed.
%global debug_package %{nil}
%if "%{_arch}" == "x86_64"
%global build_cross 1
%define cross_archs arm64
%else
%global build_cross 0
%define cross_archs %{nil}
%endif
Summary: Linux API header files
Name: kernel-headers
Version: 5.15.139.1
Release: 2%{?dist}
Release: 1%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Mariner
Group: System Environment/Kernel
URL: https://github.com/microsoft/CBL-Mariner-Linux-Kernel
Source0: https://github.com/microsoft/CBL-Mariner-Linux-Kernel/archive/rolling-lts/mariner-2/%{version}.tar.gz#/kernel-%{version}.tar.gz
#Source0: https://github.com/microsoft/CBL-Mariner-Linux-Kernel/archive/rolling-lts/mariner-2/%%{version}.tar.gz
Source0: kernel-%{version}.tar.gz
# Historical name shipped by other distros
Provides: glibc-kernheaders = %{version}-%{release}
BuildArch: noarch
@ -26,57 +16,26 @@ BuildArch: noarch
%description
The Linux API Headers expose the kernel's API for use by Glibc.
%if %{build_cross}
%package -n kernel-cross-headers
Summary: Header files for the Linux kernel for use by cross-glibc.
%description -n kernel-cross-headers
Kernel-cross-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The
header files define structures and constants that are needed for
building most standard programs and are also needed for rebuilding the
cross-glibc package.
%endif
%prep
%setup -q -n CBL-Mariner-Linux-Kernel-rolling-lts-mariner-2-%{version}
%build
make mrproper
make headers
for cross_arch in %{cross_archs}; do
make ARCH=$cross_arch O=usr/include-$cross_arch headers
done
%install
find usr/include* \( -name ".*" -o -name "Makefile" \) -delete
cd %{_builddir}/CBL-Mariner-Linux-Kernel-rolling-lts-mariner-2-%{version}
make headers
find usr/include -name '.*' -delete
rm usr/include/Makefile
mkdir -p /%{buildroot}%{_includedir}
cp -rv usr/include/* /%{buildroot}%{_includedir}
for cross_arch in %{cross_archs}; do
cross_arch_includedir=/%{buildroot}%{_prefix}/${cross_arch}-linux-gnu/include
mkdir -p $cross_arch_includedir
cp -rv usr/include-$cross_arch/usr/include/* $cross_arch_includedir
done
%files
%defattr(-,root,root)
%license COPYING
%{_includedir}/*
%if %{build_cross}
%files -n kernel-cross-headers
%defattr(-,root,root)
%{_prefix}/*-linux-gnu/*
%endif
%changelog
* Tue Dec 05 2023 Pawel Winogrodzki <pawelwi@microsoft.com> - 5.15.139.1-2
- Add the 'kernel-cross-headers' subpackage for aarch64.
- Used Fedora 38 spec (license: MIT) for guidance.
* Tue Dec 05 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.139.1-1
- Auto-upgrade to 5.15.139.1
@ -107,7 +66,7 @@ done
* Tue Sep 26 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.133.1-1
- Auto-upgrade to 5.15.133.1
* Fri Sep 22 2023 Cameron Baird <cameronbaird@microsoft.com> - 5.15.131.1-3
* Tue Sep 22 2023 Cameron Baird <cameronbaird@microsoft.com> - 5.15.131.1-3
- Bump release to match kernel
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 5.15.131.1-2

View File

@ -28,7 +28,7 @@
Summary: Linux Kernel
Name: kernel
Version: 5.15.139.1
Release: 2%{?dist}
Release: 1%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Mariner
@ -426,9 +426,6 @@ ln -sf linux-%{uname_r}.cfg /boot/mariner.cfg
%{_sysconfdir}/bash_completion.d/bpftool
%changelog
* Tue Dec 05 2023 Pawel Winogrodzki <pawelwi@microsoft.com> - 5.15.139.1-2
- Bump release to match kernel-headers.
* Tue Dec 05 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.139.1-1
- Auto-upgrade to 5.15.139.1

View File

@ -1,5 +1,5 @@
filesystem-1.1-18.cm2.aarch64.rpm
kernel-headers-5.15.139.1-2.cm2.noarch.rpm
kernel-headers-5.15.139.1-1.cm2.noarch.rpm
glibc-2.35-6.cm2.aarch64.rpm
glibc-devel-2.35-6.cm2.aarch64.rpm
glibc-i18n-2.35-6.cm2.aarch64.rpm
@ -12,8 +12,8 @@ zlib-devel-1.2.13-2.cm2.aarch64.rpm
file-5.40-2.cm2.aarch64.rpm
file-devel-5.40-2.cm2.aarch64.rpm
file-libs-5.40-2.cm2.aarch64.rpm
binutils-2.37-8.cm2.aarch64.rpm
binutils-devel-2.37-8.cm2.aarch64.rpm
binutils-2.37-7.cm2.aarch64.rpm
binutils-devel-2.37-7.cm2.aarch64.rpm
gmp-6.2.1-4.cm2.aarch64.rpm
gmp-devel-6.2.1-4.cm2.aarch64.rpm
mpfr-4.1.0-2.cm2.aarch64.rpm

View File

@ -1,5 +1,5 @@
filesystem-1.1-18.cm2.x86_64.rpm
kernel-headers-5.15.139.1-2.cm2.noarch.rpm
kernel-headers-5.15.139.1-1.cm2.noarch.rpm
glibc-2.35-6.cm2.x86_64.rpm
glibc-devel-2.35-6.cm2.x86_64.rpm
glibc-i18n-2.35-6.cm2.x86_64.rpm
@ -12,8 +12,8 @@ zlib-devel-1.2.13-2.cm2.x86_64.rpm
file-5.40-2.cm2.x86_64.rpm
file-devel-5.40-2.cm2.x86_64.rpm
file-libs-5.40-2.cm2.x86_64.rpm
binutils-2.37-8.cm2.x86_64.rpm
binutils-devel-2.37-8.cm2.x86_64.rpm
binutils-2.37-7.cm2.x86_64.rpm
binutils-devel-2.37-7.cm2.x86_64.rpm
gmp-6.2.1-4.cm2.x86_64.rpm
gmp-devel-6.2.1-4.cm2.x86_64.rpm
mpfr-4.1.0-2.cm2.x86_64.rpm

View File

@ -9,9 +9,9 @@ bash-5.1.8-4.cm2.aarch64.rpm
bash-debuginfo-5.1.8-4.cm2.aarch64.rpm
bash-devel-5.1.8-4.cm2.aarch64.rpm
bash-lang-5.1.8-4.cm2.aarch64.rpm
binutils-2.37-8.cm2.aarch64.rpm
binutils-debuginfo-2.37-8.cm2.aarch64.rpm
binutils-devel-2.37-8.cm2.aarch64.rpm
binutils-2.37-7.cm2.aarch64.rpm
binutils-debuginfo-2.37-7.cm2.aarch64.rpm
binutils-devel-2.37-7.cm2.aarch64.rpm
bison-3.7.6-2.cm2.aarch64.rpm
bison-debuginfo-3.7.6-2.cm2.aarch64.rpm
bzip2-1.0.8-1.cm2.aarch64.rpm
@ -136,7 +136,7 @@ intltool-0.51.0-7.cm2.noarch.rpm
itstool-2.0.6-4.cm2.noarch.rpm
kbd-2.2.0-1.cm2.aarch64.rpm
kbd-debuginfo-2.2.0-1.cm2.aarch64.rpm
kernel-headers-5.15.139.1-2.cm2.noarch.rpm
kernel-headers-5.15.139.1-1.cm2.noarch.rpm
kmod-29-2.cm2.aarch64.rpm
kmod-debuginfo-29-2.cm2.aarch64.rpm
kmod-devel-29-2.cm2.aarch64.rpm

View File

@ -9,10 +9,9 @@ bash-5.1.8-4.cm2.x86_64.rpm
bash-debuginfo-5.1.8-4.cm2.x86_64.rpm
bash-devel-5.1.8-4.cm2.x86_64.rpm
bash-lang-5.1.8-4.cm2.x86_64.rpm
binutils-2.37-8.cm2.x86_64.rpm
binutils-aarch64-linux-gnu-2.37-8.cm2.x86_64.rpm
binutils-debuginfo-2.37-8.cm2.x86_64.rpm
binutils-devel-2.37-8.cm2.x86_64.rpm
binutils-2.37-7.cm2.x86_64.rpm
binutils-debuginfo-2.37-7.cm2.x86_64.rpm
binutils-devel-2.37-7.cm2.x86_64.rpm
bison-3.7.6-2.cm2.x86_64.rpm
bison-debuginfo-3.7.6-2.cm2.x86_64.rpm
bzip2-1.0.8-1.cm2.x86_64.rpm
@ -47,7 +46,6 @@ cracklib-lang-2.9.7-5.cm2.x86_64.rpm
createrepo_c-0.17.5-1.cm2.x86_64.rpm
createrepo_c-debuginfo-0.17.5-1.cm2.x86_64.rpm
createrepo_c-devel-0.17.5-1.cm2.x86_64.rpm
cross-binutils-common-2.37-8.cm2.noarch.rpm
curl-8.3.0-2.cm2.x86_64.rpm
curl-debuginfo-8.3.0-2.cm2.x86_64.rpm
curl-devel-8.3.0-2.cm2.x86_64.rpm
@ -138,8 +136,7 @@ intltool-0.51.0-7.cm2.noarch.rpm
itstool-2.0.6-4.cm2.noarch.rpm
kbd-2.2.0-1.cm2.x86_64.rpm
kbd-debuginfo-2.2.0-1.cm2.x86_64.rpm
kernel-cross-headers-5.15.139.1-2.cm2.noarch.rpm
kernel-headers-5.15.139.1-2.cm2.noarch.rpm
kernel-headers-5.15.139.1-1.cm2.noarch.rpm
kmod-29-2.cm2.x86_64.rpm
kmod-debuginfo-29-2.cm2.x86_64.rpm
kmod-devel-29-2.cm2.x86_64.rpm