Merge pull request #1253 from tlaurion/fix_coreboot_411_patches_for_git_apply

Have coreboot 4.11 boards locally buildable again (patches compliant with "git apply" + make 4.2.1+ fixes)
This commit is contained in:
tlaurion 2022-12-14 14:22:32 -05:00 committed by GitHub
commit 1a0f48d8a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 99 additions and 61 deletions

View File

@ -80,7 +80,7 @@ jobs:
#Restore existing cache for matching modules digest, validated to be exactly the same as in github current commit.
#This cache was made on top of below caches, if previously existing. If no module definition changed, we reuse this one. Otherwise...
- heads-modules-and-patches-{{ checksum "./tmpDir/all_modules_and_patches.sha256sums" }}{{ .Environment.CACHE_VERSION }}
#If precedent cache not found, restore cache for coreboot module (and patches) and musl-cross-make digests (bi-yearly modified)
#If precedent cache not found, restore cache for coreboot module (and patches) and musl-cross-make digests (coreboot: triannual release)
#Otehrwise....
- heads-coreboot-musl-cross-{{ checksum "./tmpDir/coreboot_musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
#If precedent cache not found. Restore cache for musl-cross-make module digest (rarely modified).
@ -188,6 +188,7 @@ jobs:
- build/x86/coreboot-4.13
- build/x86/coreboot-4.14
- build/x86/coreboot-4.15
- build/x86/coreboot-4.17
- build/ppc64/coreboot-git
- save_cache:
#Generate cache for the exact same modules definitions if hash is not previously existing
@ -224,15 +225,7 @@ workflows:
requires:
- x230-hotp-maximized
# Coreboot 4.11
# - build_and_persist:
# name: librem_l1um
# target: librem_l1um
# subcommand: ""
# requires:
# - librem_14
# Coreboot for Talos
# Coreboot for Talos (PPC)
- build_and_persist:
name: talos-2_server
arch: ppc64
@ -242,7 +235,7 @@ workflows:
- prep_env
#Cache one workspace per Coreboot version, ideally the boards including the highest number of modules, since not rebuilt across builds.
#Below, 4.11, 4.13, 4.15
#Below, 4.11, 4.13, 4.17
- save_cache:
requires:
- librem_14
@ -358,6 +351,7 @@ workflows:
subcommand: ""
requires:
- x230-hotp-maximized
- build:
name: t530-hotp-maximized
target: t530-hotp-maximized

View File

@ -50,19 +50,19 @@ diff -ruN ./util/crossgcc/patches.orig/acpica-unix-20210105_iasl.patch ./util/cr
+ printf ("Ignoring all errors, forcing AML file generation\n\n");
+@@ -866,6 +867,7 @@ AslDoOptions (
+ case '^':
+
+
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
++ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
+ exit (0);
+
+
+ case 'a':
+@@ -879,6 +881,7 @@ AslDoOptions (
+
+
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
+ printf (ACPI_COMMON_BUILD_TIME);
++ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
+ exit (0);
+
+
+ case 'e':
--- ./util/crossgcc/buildgcc.orig 2021-10-15 12:24:39.039000000 -0400

View File

@ -6,11 +6,10 @@ diff -ruN ./util/crossgcc/patches.orig/binutils-2.32_gold-errors-include-strings
++++ binutils-2.32/gold/errors.h 2021-10-12 13:42:38.712000000 -0400
+@@ -25,6 +25,7 @@
+ #include <cstdarg>
+
+
+ #include "gold-threads.h"
++#include <string>
+
+
+ namespace gold
+ {
+

View File

@ -9,11 +9,11 @@ index 0000000..151a3e6
+Date: Fri Aug 2 18:46:51 2019 +0000
+
+ rework Ada EH Machine_Occurrence deallocation
+
+
+ Introduce exception handler ABI #1 to ensure single release, no access
+ after release of reraised Machine_Occurrences, and no failure to
+ re-reraise a Machine_Occurrence.
+
+
+ Unlike Ada exceptions, foreign exceptions do not get a new
+ Machine_Occurrence upon reraise, but each handler would delete the
+ exception upon completion, normal or exceptional, save for the case of
@ -23,7 +23,7 @@ index 0000000..151a3e6
+ reraise within the same handler. Get_Current_Excep.all would also
+ expose the Machine_Occurrence to reuse by Reraise_Occurrence, even for
+ native exceptions.
+
+
+ Under ABI #1, Begin_Handler_v1 claims responsibility for releasing an
+ exception by saving its cleanup and setting it to Claimed_Cleanup.
+ End_Handler_v1 restores the cleanup and runs it, as long as it isn't
@ -33,7 +33,7 @@ index 0000000..151a3e6
+ propagating exception will then claim responsibility for releasing
+ it), so reraise no longer needs to clear the exception pointer, and it
+ can just propagate the exception, just like Reraise_Occurrence.
+
+
+ ABI #1 is fully interoperable with ABI #0, i.e., exception handlers
+ that call the #0 primitives can be linked together with ones that call
+ the #1 primitives, and they will not misbehave. When a #1 handler
@ -45,10 +45,10 @@ index 0000000..151a3e6
+ cause the exception to be released multiple times, and to be used
+ after it is first released, even if other handlers of the foreign
+ exception use #1.
+
+
+
+
+ for gcc/ada/ChangeLog
+
+
+ * libgnat/a-exexpr.adb (Begin_Handler_v1, End_Handler_v1): New.
+ (Claimed_Cleanup): New.
+ (Begin_Handler, End_Handler): Document.
@ -59,7 +59,7 @@ index 0000000..151a3e6
+ EH_ELSE_EXPR to pass a propagating exception to end handler.
+ (gnat_to_gnu): Leave the exception pointer alone for reraise.
+ (add_cleanup): Handle EH_ELSE_EXPR, require it by itself.
+
+
+ From-SVN: r274029
+
+diff --git a/gcc/ada/libgnat/a-exexpr.adb b/gcc/ada/libgnat/a-exexpr.adb
@ -69,7 +69,7 @@ index 0000000..151a3e6
+@@ -197,15 +197,75 @@ package body Exception_Propagation is
+ -- whose machine occurrence is Mo. The message is empty, the backtrace
+ -- is empty too and the exception identity is Foreign_Exception.
+
+
+- -- Hooks called when entering/leaving an exception handler for a given
+- -- occurrence, aimed at handling the stack of active occurrences. The
+- -- calls are generated by gigi in tree_transform/N_Exception_Handler.
@ -127,12 +127,12 @@ index 0000000..151a3e6
++ -- used during bootstrap. They are interoperable with the v1
++ -- hooks, except that the older versions may malfunction when
++ -- handling foreign exceptions passed to Reraise_Occurrence.
+
+
+ procedure Begin_Handler (GCC_Exception : not null GCC_Exception_Access);
+ pragma Export (C, Begin_Handler, "__gnat_begin_handler");
++ -- Called when entering an exception handler translated by an old
++ -- compiler. It does nothing.
+
+
+ procedure End_Handler (GCC_Exception : GCC_Exception_Access);
+ pragma Export (C, End_Handler, "__gnat_end_handler");
++ -- Called when leaving an exception handler translated by an old
@ -142,13 +142,13 @@ index 0000000..151a3e6
++ -- End_Handler was set to null to tell End_Handler to refrain from
++ -- releasing the reraised exception. In v1 safer ways are used to
++ -- accomplish that.
+
+
+ --------------------------------------------------------------------
+ -- Accessors to Basic Components of a GNAT Exception Data Pointer --
+@@ -352,6 +412,128 @@ package body Exception_Propagation is
+ end if;
+ end Setup_Current_Excep;
+
+
++ ----------------------
++ -- Begin_Handler_v1 --
++ ----------------------

View File

@ -1,30 +0,0 @@
src/arch/x86: Ensure $(objgenerated) exists before it's used
In some rare cases it seems that make tries to build
$(objgenerated)/assembly.inc before the build-dirs target has finished,
and so assembly.inc can't be written. Enforce that build-dirs is done
before assembly.inc starts.
BUG=chromium:1098215
BRANCH=none
TEST=none
Change-Id: Ib141ea45a43836cfdde0059523c331fe5286b06d
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42883
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index 6297384..1a1aa40 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -50,7 +50,7 @@
# into a single generated file.
crt0s = $(cpu_incs-y)
-$(objgenerated)/assembly.inc: $$(crt0s)
+$(objgenerated)/assembly.inc: build-dirs $$(crt0s)
@printf " GEN $(subst $(obj)/,,$(@))\n"
printf '$(foreach crt0,$(crt0s),#include "$(crt0)"\n)' > $@

View File

@ -0,0 +1,75 @@
From 0f6f70c3942c152c512b1aa51b6f6079a05e003b Mon Sep 17 00:00:00 2001
From: Nico Huber <nico.h@gmx.de>
Date: Sun, 09 Feb 2020 11:24:32 +0100
Subject: [PATCH] Makefile.inc: Adapt $(spc) definition
GNU Make 4.3 is more picky about the $(spc) definition. It seems, the
variable ends up empty. The old definition worked for nearly 8 years,
RIP.
Tested with GNU Make 4.2.1 and 4.3.
Change-Id: I7981e0066b550251ae4a98d7b50e83049fc5586a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38790
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
diff --git a/Makefile.inc b/Makefile.inc
index 648bc4f..1f18726 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -159,7 +159,7 @@
#######################################################################
# Helper functions for ramstage postprocess
spc :=
-spc +=
+spc := $(spc) $(spc)
comma := ,
# Returns all files and dirs below `dir` (recursively).
From 1c08a9a9c4986f2b3c47322f041e289121536dc0 Mon Sep 17 00:00:00 2001
From: Nico Huber <nico.h@gmx.de>
Date: Sun, 09 Feb 2020 11:44:27 +0100
Subject: [PATCH] Makefile.inc: Use `define` for cbfs-files-processor-defconfig
The body contains a `#` and GNU make 4.3 disagrees with earlier versions
if it should be treated as a comment. Turn it into a `define` which has
clearer semantics regarding comments (interpretation is supposed to be
deferred until the variable is expanded).
Change-Id: I589542abbd14082c3ecc4a2456ebd809fb6911ea
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/38793
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
diff --git a/Makefile.inc b/Makefile.inc
index 2690e8f..648bc4f 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -316,15 +316,16 @@
# Reduce a .config file to its minimal representation
# arg1: input
# arg2: output
-cbfs-files-processor-defconfig= \
+define cbfs-files-processor-defconfig
$(eval $(2): $(1) $(obj)/build.h $(objutil)/kconfig/conf; \
+printf " CREATE $(2) (from $(1))\n"; \
- printf "\# This image was built using coreboot " > $(2).tmp && \
+ printf "# This image was built using coreboot " > $(2).tmp && \
grep "\<COREBOOT_VERSION\>" $(obj)/build.h |cut -d\" -f2 >> $(2).tmp && \
$(MAKE) DOTCONFIG=$(1) DEFCONFIG=$(2).tmp2 savedefconfig && \
cat $(2).tmp2 >> $(2).tmp && \
rm -f $(2).tmp2 && \
\mv -f $(2).tmp $(2))
+endef
#######################################################################
# Compile a C file with a bare struct definition into binary