From c7e460b189722baac773546ca8bb012598ea1d02 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Mon, 25 Jan 2021 21:50:22 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/binutils.git#88880dcb0579533015ebfa0bdbb2ae5999b9f6e0 --- .fmf/version | 1 + binutils-DWARF-5-line-number-parsing.patch | 24 +++ binutils.spec | 9 +- gating.yaml | 14 ++ plans/ci.fmf | 6 + tests/README | 2 + .../Sanity/rebuild-kernel-and-reboot/Makefile | 67 ++++++ .../Sanity/rebuild-kernel-and-reboot/PURPOSE | 20 ++ .../Sanity/rebuild-kernel-and-reboot/main.fmf | 62 ++++++ .../rebuild-kernel-and-reboot/runtest.sh | 200 ++++++++++++++++++ 10 files changed, 404 insertions(+), 1 deletion(-) create mode 100644 .fmf/version create mode 100644 binutils-DWARF-5-line-number-parsing.patch create mode 100644 gating.yaml create mode 100644 plans/ci.fmf create mode 100644 tests/README create mode 100644 tests/Sanity/rebuild-kernel-and-reboot/Makefile create mode 100644 tests/Sanity/rebuild-kernel-and-reboot/PURPOSE create mode 100644 tests/Sanity/rebuild-kernel-and-reboot/main.fmf create mode 100755 tests/Sanity/rebuild-kernel-and-reboot/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/binutils-DWARF-5-line-number-parsing.patch b/binutils-DWARF-5-line-number-parsing.patch new file mode 100644 index 0000000..15849f9 --- /dev/null +++ b/binutils-DWARF-5-line-number-parsing.patch @@ -0,0 +1,24 @@ +--- binutils.orig/bfd/dwarf2.c 2021-01-25 11:26:26.761405305 +0000 ++++ binutils-2.35.1/bfd/dwarf2.c 2021-01-25 11:28:51.838572824 +0000 +@@ -3252,9 +3252,11 @@ read_rnglists (struct comp_unit *unit, s + low_pc = base_address; + low_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read, + FALSE, rngs_end); ++ rngs_ptr += bytes_read; + high_pc = base_address; + high_pc += _bfd_safe_read_leb128 (abfd, rngs_ptr, &bytes_read, + FALSE, rngs_end); ++ rngs_ptr += bytes_read; + break; + + case DW_RLE_start_end: +@@ -3274,9 +3276,6 @@ read_rnglists (struct comp_unit *unit, s + return FALSE; + } + +- if ((low_pc == 0 && high_pc == 0) || low_pc == high_pc) +- return FALSE; +- + if (!arange_add (unit, arange, low_pc, high_pc)) + return FALSE; + } diff --git a/binutils.spec b/binutils.spec index 7dd2ca0..443a48a 100644 --- a/binutils.spec +++ b/binutils.spec @@ -39,7 +39,7 @@ Summary: A GNU collection of binary utilities Name: binutils%{?name_cross}%{?_with_debug:-debug} Version: 2.35.1 -Release: 24%{?dist} +Release: 25%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -316,6 +316,10 @@ Patch31: binutils-gas-auto-dwarf-5.patch # Lifetime: Fixed in 2.36 Patch32: binutils-gold-gnu-properties.patch +# Purpose: Update the BFD library to handle DWARF-5 line number ranges. +# Lifetime: Fixed in 2.36 +Patch33: binutils-DWARF-5-line-number-parsing.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -900,6 +904,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Mon Jan 25 2021 Nick Clifton - 2.35.1-25 +- Update the BFD library to handle DWARF-5 line number ranges. + * Thu Jan 21 2021 Nick Clifton - 2.35.1-24 - Update the GOLD linker to handle x86 .note.gnu.property sections. (#1916925) diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..8bc7d0a --- /dev/null +++ b/gating.yaml @@ -0,0 +1,14 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} + - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional} diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..1ad2c12 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: beakerlib diff --git a/tests/README b/tests/README new file mode 100644 index 0000000..bf13c2b --- /dev/null +++ b/tests/README @@ -0,0 +1,2 @@ +The test's Makefiles are not used in Fedora CI infrastructure. But are kept here + for backward compatibility with traditional beakerlib test harness in RHEL. diff --git a/tests/Sanity/rebuild-kernel-and-reboot/Makefile b/tests/Sanity/rebuild-kernel-and-reboot/Makefile new file mode 100644 index 0000000..7016c10 --- /dev/null +++ b/tests/Sanity/rebuild-kernel-and-reboot/Makefile @@ -0,0 +1,67 @@ +# Copyright (c) 2009, 2012 Red Hat, Inc. All rights reserved. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Rebuild kernel, install it, reboot, and check if we're running the correct +# kernel. Tailored specificaly for binutils buildroot testing process. +# +# Author: Milos Prchlik +# +# Based on gcc/Sanity/rebuild-kernel by: +# Author: Michal Nowak +# Author: Marek Polacek + + +export TEST=/tools/binutils/Sanity/rebuild-kernel-and-reboot +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x ./runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + + +$(METADATA): Makefile + @echo "Owner: Milos Prchlik " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Description: Rebuild kernel, install it, reboot, and check if we're running the correct kernel" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 20h" >> $(METADATA) + @echo "RunFor: binutils" >> $(METADATA) + @echo "Requires: binutils" >> $(METADATA) + @echo "Requires: gcc" >> $(METADATA) + @echo "Requires: yum-utils rng-tools" >> $(METADATA) + @echo "Requires: rpm-build" >> $(METADATA) + @echo "Requires: newt-devel python-devel perl-ExtUtils-Embed unifdef elfutils-libelf-devel" >> $(METADATA) + @echo "Requires: elfutils-devel pciutils-devel" >> $(METADATA) + @echo "Requires: wget hmaccalc binutils-devel glibc-static texinfo gdb ecj gcc-java ppl-devel cloog-ppl-devel graphviz gmp-devel mpfr-devel" >> $(METADATA) + @echo "Requires: xmlto asciidoc net-tools pesign" >> $(METADATA) + @echo "License: GPLv3+" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/rebuild-kernel-and-reboot/PURPOSE b/tests/Sanity/rebuild-kernel-and-reboot/PURPOSE new file mode 100644 index 0000000..09fefa0 --- /dev/null +++ b/tests/Sanity/rebuild-kernel-and-reboot/PURPOSE @@ -0,0 +1,20 @@ +Rebuild kernel, install it, reboot, and check if we're running the correct +kernel. Tailored specificaly for binutils buildroot testing process. + +Author: Milos Prchlik + +Based on gcc/Sanity/rebuild-kernel by: +Author: Michal Nowak +Author: Marek Polacek + +Using MACHINE_SET__STRONG host-filter for this test, by setting the "hardware" +section in TCMS properly. That has several effects: + + - kernel rebuild is very resoruce-intensive task, and having more powerful + boxes for it is simply good, + - this task will get its own boxes, not clobbered by additional kernel packages + that are usually installed by other tasks in the same run. E.g.kernel-debuginfo, + when installed, will conflict with freshly build kernel packages. This should + workaround such situations, + - this tasks reboots its boxes - should such reboot break something, don't ruin + the whole run by it, right? diff --git a/tests/Sanity/rebuild-kernel-and-reboot/main.fmf b/tests/Sanity/rebuild-kernel-and-reboot/main.fmf new file mode 100644 index 0000000..d5f4a84 --- /dev/null +++ b/tests/Sanity/rebuild-kernel-and-reboot/main.fmf @@ -0,0 +1,62 @@ +summary: Rebuild kernel, install it, reboot, and check if we're running the correct + kernel +description: | + Rebuild kernel, install it, reboot, and check if we're running the correct + kernel. Tailored specificaly for binutils buildroot testing process. + + Author: Milos Prchlik + + Based on gcc/Sanity/rebuild-kernel by: + Author: Michal Nowak + Author: Marek Polacek + + Using MACHINE_SET__STRONG host-filter for this test, by setting the "hardware" + section in TCMS properly. That has several effects: + + - kernel rebuild is very resoruce-intensive task, and having more powerful + boxes for it is simply good, + - this task will get its own boxes, not clobbered by additional kernel packages + that are usually installed by other tasks in the same run. E.g.kernel-debuginfo, + when installed, will conflict with freshly build kernel packages. This should + workaround such situations, + - this tasks reboots its boxes - should such reboot break something, don't ruin + the whole run by it, right? +contact: +- Milos Prchlik +component: +- binutils +test: ./runtest.sh +framework: beakerlib +recommend: +- binutils +- gcc +- yum-utils +- rng-tools +- rpm-build +- newt-devel +- python-devel +- perl-ExtUtils-Embed +- unifdef +- elfutils-libelf-devel +- elfutils-devel +- pciutils-devel +- wget +- hmaccalc +- binutils-devel +- glibc-static +- texinfo +- gdb +- ecj +- gcc-java +- ppl-devel +- cloog-ppl-devel +- graphviz +- gmp-devel +- mpfr-devel +- xmlto +- asciidoc +- net-tools +- pesign +duration: 20h +extra-summary: /tools/binutils/Sanity/rebuild-kernel-and-reboot +extra-task: /tools/binutils/Sanity/rebuild-kernel-and-reboot diff --git a/tests/Sanity/rebuild-kernel-and-reboot/runtest.sh b/tests/Sanity/rebuild-kernel-and-reboot/runtest.sh new file mode 100755 index 0000000..c49fe39 --- /dev/null +++ b/tests/Sanity/rebuild-kernel-and-reboot/runtest.sh @@ -0,0 +1,200 @@ +#!/bin/bash +# Copyright (c) 2009, 2012 Red Hat, Inc. All rights reserved. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Rebuild kernel, install it, reboot, and check if we're running the correct +# kernel. Tailored specificaly for binutils buildroot testing process. +# +# Author: Milos Prchlik +# +# Based on gcc/Sanity/rebuild-kernel by: +# Author: Michal Nowak +# Author: Marek Polacek + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +export AVC_ERROR='+no_avc_check' + +case "$JUST_BUILD" in + 0|[Ff][Aa][Ll][Ss][Ee]|[Nn][Oo]) + JUST_BUILD=no + ;; + *) + JUST_BUILD=yes + ;; +esac + +LD="${LD:-$(which ld)}" +GCC="${GCC:-$(which gcc)}" + +PACKAGE="${PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $LD) | head -1)}" +GCC_PACKAGE="${GCC_PACKAGE:-$(rpm --qf '%{name}\n' -qf $(which $GCC) | head -1)}" + +PACKAGES="${PACKAGES:-$PACKAGE}" + +# Kernel package - usualy "kernel", but some trees may use different package +# name (e.g. kernel-PAE). +KERNEL="${KERNEL:-kernel}" + +REQUIRES="${REQUIRES:-$KERNEL $GCC_PACKAGE glibc}" +RPM_BUILD_ID="${RPM_BUILD_ID:-.LimeKitten}" + +# Workaround possible restraint issues - restraint may fail to set REBOOTCOUNT properly. +REBOOT_FLAG=/.rebuild-kernel-and-reboot.flag +REBOOTCOUNT="${REBOOTCOUNT:-0}" + +unset ARCH + +rlJournalStart + rlPhaseStartSetup + rlLogInfo "PACKAGES=$PACKAGES" + rlLogInfo "KERNEL=$KERNEL" + rlLogInfo "REQUIRES=$REQUIRES" + rlLogInfo "JUST_BUILD=$JUST_BUILD" + rlLogInfo "COLLECTIONS=$COLLECTIONS" + rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" + + # We'll use a lot of disk space (tens of GBs at least). The root FS + # often is the most beefy one in CI environemnts. Let's use it but also + # let's log what's actually available. + export TMPDIR=/test_tmp_root + rlRun "mkdir -p $TMPDIR" + rlLogInfo "TMPDIR=$TMPDIR" + rlLogInfo 'Disk space:' + df -h | while read line; do + rlLogInfo " $line" + done + + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + _COLLECTIONS="$COLLECTIONS" + if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then + for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do + rlLogInfo "ignoring metapackage check for collection $c" + export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) + done + fi + + rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" + + rlAssertRpm --all + + export COLLECTIONS="$_COLLECTIONS" + + rlRun "AFTER_REBOOT=no" + + if [ "$REBOOTCOUNT" != "0" ]; then + rlLogInfo "Reboot count envvar is non-zero, update our flag" + rlRun "AFTER_REBOOT=yes" + elif [ -f "$REBOOT_FLAG" ]; then + rlLogInfo "FS reboot flag exists, update our flag" + rlRun "AFTER_REBOOT=yes" + fi + + if [ "$AFTER_REBOOT" = "no" ]; then + # We optionally need to skip checking for the presence of the metapackage + # because that would pull in all the dependent toolset subrpms. We do not + # always want that, especially in CI. + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + + # Speed up keygen. + rlRun "rngd -r /dev/hwrandom || rngd -r /dev/urandom" + + # Get the SRPM. + rlFetchSrcForInstalled "$KERNEL" + + rlRun "SRPM=`find . -name '*.src.rpm'`" + rlRun "SPECDIR=`rpm --define=\"_topdir $TmpDir\" --eval=%_specdir`" + + rlRun "rpm -ivh --define=\"_topdir $TmpDir\" $SRPM" + rlRun "SPECFILE=`find $SPECDIR/ -name '*.spec'`" + + builddep_options="--nobest" + rlRun "yum-builddep -y $builddep_options $SPECFILE" + fi + rlPhaseEnd + + if [ "$AFTER_REBOOT" = "no" ]; then + rlPhaseStartTest "Build" + if [ "$RPM_BUILD_ID" != "" ]; then + rlRun "sed -i \"s/# % define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE" + rlRun "sed -i \"s/# define buildid .local/%define buildid $RPM_BUILD_ID/\" $SPECFILE" + fi + + if [ "`rlGetPrimaryArch`" == "ppc64" ]; then + TARGET="--target=ppc64" + else + TARGET="--target=$(uname -m)" + fi + + if rlRun "CC=$GCC rpmbuild --define=\"_topdir $TmpDir\" -bb $TARGET --clean $SPECFILE &> BUILD_LOG"; then + rlRun "RPMBUILD_OK=yes" + else + rlLogInfo "rpmbuild kernel failed" + rlRun "RPMBUILD_OK=no" + fi + rlBundleLogs "Build-log" BUILD_LOG + rlPhaseEnd + + # Install and boot the new kernel only if it's requested *and* the build was successful + if [ "$JUST_BUILD" = 'no' ] && [ "$RPMBUILD_OK" = "yes" ]; then + rlPhaseStartTest "Install" + RPMS="$(ls -1 $TmpDir/RPMS/*/*.rpm | grep -v kernel-selftests-internal | tr '\n' ' ')" + + rlRun "yum localinstall -y --disablerepo=\* $RPMS" + + rlLogInfo "$(rpm -qa | grep kernel | sort)" + + # Update the boot configuration + if [ "$(arch)" = "s390x" ]; then + rlRun "grubby --info=ALL" + rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)" + rlRun "KERNEL_FILE=$(ls -1 /boot/vmlinuz-*${RPM_BUILD_ID}.$(arch))" + rlRun "ls -al $KERNEL_FILE" + rlRun "grubby --set-default $KERNEL_FILE" + rlLogInfo "Default kernel is $(grubby --default-kernel), index $(grubby --default-index)" + rlRun "zipl" + else + rlRun "grub2-set-default 2" + fi + rlPhaseEnd + + rlPhaseStartTest "Reboot" + rlRun "touch $REBOOT_FLAG" + + rlLog "Rebooting ..." + rhts-reboot + rlPhaseEnd + fi + fi + + # Verify the build ID only if its install and boot were requested + if [ "$JUST_BUILD" = 'no' ]; then + rlPhaseStartTest "Test" + if ! [ "$AFTER_REBOOT" = 'yes' ]; then + rlFail 'Not rebooted. Probably rhts-reboot did not work.' + fi + rlLogInfo "$(uname -a)" + rlRun "uname -r | grep $RPM_BUILD_ID" + rlPhaseEnd + fi + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd