Merge pull request #1841 from tlaurion/musl-cross-make_bump_rename

musl-cross-make: bump musl (1.2.0 -> 1.2.5) + rename module to reflect reality, bump newt ( whiptail:0.52.20 -> 0.52.24) to fix crash with newer musl
This commit is contained in:
Thierry Laurion 2024-11-08 15:13:54 -05:00 committed by GitHub
commit cd683b1f35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 71 additions and 55 deletions

View File

@ -65,11 +65,11 @@ jobs:
- run:
name: Creating coreboot (and associated patches) and musl-cross-make modules digest (musl-cross-make and coreboot cache digest)
command: |
find .circleci/config.yml ./Makefile ./flake.lock ./modules/coreboot ./modules/musl-cross* ./patches/coreboot* -type f | sort -h | xargs sha256sum > ./tmpDir/coreboot_musl-cross.sha256sums
find .circleci/config.yml ./Makefile ./flake.lock ./modules/coreboot ./modules/musl-cross-make* ./patches/coreboot* -type f | sort -h | xargs sha256sum > ./tmpDir/coreboot_musl-cross-make.sha256sums
- run:
name: Creating musl-cross-make and musl-cross-make patches digest (musl-cross-make cache digest)
command: |
find .circleci/config.yml ./Makefile ./flake.lock modules/musl-cross* -type f | sort -h | xargs sha256sum > ./tmpDir/musl-cross.sha256sums
find .circleci/config.yml ./Makefile ./flake.lock modules/musl-cross-make* -type f | sort -h | xargs sha256sum > ./tmpDir/musl-cross-make.sha256sums
- restore_cache:
# First matched/found key wins and following keys are not tried
keys:
@ -79,10 +79,10 @@ jobs:
- nix-docker-heads-modules-and-patches-{{ checksum "./tmpDir/all_modules_and_patches.sha256sums" }}{{ .Environment.CACHE_VERSION }}
# Cache for coreboot module (and patches) and musl-cross-make digests (coreboot: triannual release)
- nix-docker-heads-coreboot-musl-cross-{{ checksum "./tmpDir/coreboot_musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
- nix-docker-heads-coreboot-musl-cross-make-{{ checksum "./tmpDir/coreboot_musl-cross-make.sha256sums" }}{{ .Environment.CACHE_VERSION }}
# Cache for musl-cross-make module digest (rarely modified).
- nix-docker-heads-musl-cross-{{ checksum "./tmpDir/musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
- nix-docker-heads-musl-cross-make-{{ checksum "./tmpDir/musl-cross-make.sha256sums" }}{{ .Environment.CACHE_VERSION }}
- run:
name: Download and neuter xx20 ME (keep generated GBE and extracted IFD in tree)
command: |
@ -171,26 +171,26 @@ jobs:
- attach_workspace:
at: ~/heads
- save_cache:
# Generate cache for the same musl-cross module definition if hash is not previously existing
# Generate cache for the same musl-cross-make module definition if hash is not previously existing
# CircleCI removed their wildcard support, so we have to list precise versions to cache in directory names
key: nix-docker-heads-musl-cross-{{ checksum "./tmpDir/musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
key: nix-docker-heads-musl-cross-make-{{ checksum "./tmpDir/musl-cross-make.sha256sums" }}{{ .Environment.CACHE_VERSION }}
paths:
- build/ppc64/musl-cross-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- build/x86/musl-cross-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- build/ppc64/musl-cross-make-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- build/x86/musl-cross-make-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- crossgcc
- packages
- save_cache:
# Generate cache for the same coreboot and musl-cross-make modules definition if hash is not previously existing
# CircleCI removed their wildcard support, so we have to list precise versions to cache in directory names
key: nix-docker-heads-coreboot-musl-cross-{{ checksum "./tmpDir/coreboot_musl-cross.sha256sums" }}{{ .Environment.CACHE_VERSION }}
key: nix-docker-heads-coreboot-musl-cross-make-{{ checksum "./tmpDir/coreboot_musl-cross-make.sha256sums" }}{{ .Environment.CACHE_VERSION }}
paths:
- build/ppc64/coreboot-talos_2
- build/ppc64/musl-cross-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- build/ppc64/musl-cross-make-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- build/x86/coreboot-4.11
- build/x86/coreboot-24.02.01
- build/x86/coreboot-dasharo
- build/x86/coreboot-purism
- build/x86/musl-cross-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- build/x86/musl-cross-make-38e52db8358c043ae82b346a2e6e66bc86a53bc1
- crossgcc
- packages
- save_cache:
@ -208,20 +208,20 @@ workflows:
jobs:
- prep_env
# This step builds musl-cross for x86 architecture, which will be used by subsequent x86 board builds
# This step builds musl-cross-make for x86 architecture, which will be used by subsequent x86 board builds
- build_and_persist:
name: x86-musl-cross
name: x86-musl-cross-make
target: x230-hotp-maximized
subcommand: "musl-cross"
subcommand: "musl-cross-make"
requires:
- prep_env
# This step builds musl-cross for ppc64 architecture, which will be used by subsequent ppc64 board builds
# This step builds musl-cross-make for ppc64 architecture, which will be used by subsequent ppc64 board builds
- build_and_persist:
name: ppc64-musl-cross
name: ppc64-musl-cross-make
arch: ppc64
target: talos-2
subcommand: "musl-cross"
target: UNTESTED_talos-2
subcommand: "musl-cross-make"
requires:
- prep_env
@ -234,7 +234,7 @@ workflows:
target: x230-hotp-maximized
subcommand: ""
requires:
- x86-musl-cross
- x86-musl-cross-make
# coreboot purism
- build_and_persist:
@ -254,16 +254,16 @@ workflows:
target: nitropad-nv41
subcommand: ""
requires:
- x86-musl-cross
- x86-musl-cross-make
# coreboot talos_2
- build_and_persist:
name: talos-2
name: UNTESTED_talos-2
arch: ppc64
target: talos-2
target: UNTESTED_talos-2
subcommand: ""
requires:
- ppc64-musl-cross
- ppc64-musl-cross-make
# coreboot 4.11
- build_and_persist:
@ -271,13 +271,13 @@ workflows:
target: librem_l1um
subcommand: ""
requires:
- x86-musl-cross
- x86-musl-cross-make
# Cache one workspace per architecture
# Make sure workspace caches are chainloaded and the last in chain for an arch is saved
- save_cache:
requires:
- talos-2
- UNTESTED_talos-2
- librem_14
# Those onboarding new boards should add their entries below.

View File

@ -189,11 +189,11 @@ $(shell mkdir -p "$(initrd_lib_dir)" "$(initrd_bin_dir)" "$(initrd_data_dir)")
SHELL := /usr/bin/env bash
.SHELLFLAGS := -o pipefail -c
# Include the musl-cross module early so that $(CROSS) will
# Include the musl-cross-make module early so that $(CROSS) will
# be defined prior to any other module.
include modules/musl-cross
include modules/musl-cross-make
musl_dep := musl-cross
musl_dep := musl-cross-make
target := $(shell echo $(CROSS) | grep -Eoe '([^/]*?)-linux-musl')
arch := $(subst -linux-musl, , $(target))
heads_cc := $(CROSS)gcc \
@ -231,9 +231,9 @@ ifeq ($(CONFIG_COREBOOT), y)
# Legacy flash boards don't generate an update package, the only purpose of
# those boards is to be flashed over vendor firmware via an exploit.
ifneq ($(CONFIG_LEGACY_FLASH), y)
# talos-2 builds its own update package, which is not integrated with the ZIP
# method currently
ifneq ($(BOARD), talos-2)
# Boards containing 'talos-2' build their own update package, which is not integrated with the ZIP method currently
ifneq ($(findstring talos-2, $(BOARD)),)
else
# Coreboot targets create an update package that can be applied with integrity
# verification before flashing (see flash-gui.sh). The ZIP package format
# allows other metadata that might be needed to added in the future without
@ -568,8 +568,8 @@ endef
$(call map, define_module, $(modules-y))
# hack to force musl-cross to be built before musl
#$(build)/$(musl_dir)/.configured: $(build)/$(musl-cross_dir)/../../crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-gcc
# hack to force musl-cross-make to be built before musl
#$(build)/$(musl_dir)/.configured: $(build)/$(musl-cross-make_dir)/../../crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-gcc
#
# Install a file into the initrd, if it changed from
@ -606,7 +606,7 @@ endef
# Only some modules have binaries that we install
# Shouldn't this be specified in the module file?
#bin_modules-$(CONFIG_MUSL) += musl-cross
#bin_modules-$(CONFIG_MUSL) += musl-cross-make
bin_modules-$(CONFIG_KEXEC) += kexec
bin_modules-$(CONFIG_TPMTOTP) += tpmtotp
bin_modules-$(CONFIG_PCIUTILS) += pciutils
@ -666,7 +666,7 @@ endif
$(COREBOOT_UTIL_DIR)/cbmem/cbmem \
$(COREBOOT_UTIL_DIR)/superiotool/superiotool \
$(COREBOOT_UTIL_DIR)/inteltool/inteltool \
: $(build)/$(coreboot_base_dir)/.canary musl-cross
: $(build)/$(coreboot_base_dir)/.canary musl-cross-make
+$(call do,MAKE,$(notdir $@),\
$(MAKE) -C "$(dir $@)" $(CROSS_TOOLS) \
)
@ -785,7 +785,7 @@ $(build)/$(initrd_dir)/tools.cpio: $(foreach d,$(bin_modules-y),$(build)/$($d_di
# List of all modules, excluding the slow to-build modules
modules-slow := musl musl-cross kernel_headers
modules-slow := musl musl-cross-make kernel_headers
module_dirs := $(foreach m,$(filter-out $(modules-slow),$(modules-y)),$($m_dir))
echo_modules:

View File

@ -128,7 +128,7 @@ CONFIG_CC_HAS_INT128=y
# CONFIG_SYSFS_DEPRECATED is not set
CONFIG_RELAY=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="../../talos-2/initrd.cpio"
CONFIG_INITRAMFS_SOURCE="../@BOARD_BUILD_DIR@/initrd.cpio"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
# CONFIG_RD_GZIP is not set

View File

@ -159,7 +159,7 @@ linux_target := \
$(MAKE_JOBS) \
# We cross compile linux now
linux_depends := musl-cross
linux_depends := musl-cross-make
#
# Linux kernel module installation

View File

@ -2,13 +2,13 @@ CONFIG_MUSL ?= y
ifeq "$(MUSL_CROSS_ONCE)" ""
MUSL_CROSS_ONCE := 1
modules-$(CONFIG_MUSL) += musl-cross
modules-$(CONFIG_MUSL) += musl-cross-make
musl-cross_version := 38e52db8358c043ae82b346a2e6e66bc86a53bc1
musl-cross_dir := musl-cross-$(musl-cross_version)
musl-cross_url := https://github.com/richfelker/musl-cross-make/archive/$(musl-cross_version).tar.gz
musl-cross_tar := musl-cross-$(musl-cross_version).tar.gz
musl-cross_hash := b4b85d6d3ddab0f2b8650a53e775673f8c346fa2fb07d652a9880bd206ade100
musl-cross-make_version := fd6be58297ee21fcba89216ccd0d4aca1e3f1c5c
musl-cross-make_dir := musl-cross-make-$(musl-cross-make_version)
musl-cross-make_url := https://github.com/richfelker/musl-cross-make/archive/$(musl-cross-make_version).tar.gz
musl-cross-make_tar := musl-cross-make-$(musl-cross-make_version).tar.gz
musl-cross-make_hash := 15b8e0a287d738a46e069e90d67a8d96213b357b79aaf3e8cf0cd40e4b230d9e
ifneq "$(CROSS)" ""
@ -20,42 +20,42 @@ else
$(info Using $(CROSS)gcc)
endif
# The cross compiler has already been built, so the musl-cross target
# The cross compiler has already been built, so the musl-cross-make target
# is a NOP. We really don't need to check out this code tree, but it is easier
# if we have a target for it.
musl-cross_target := --version
musl-cross-make_target := --version
# Ask the compiler where to find its own libc.so
musl-cross_libraries := \
musl-cross-make_libraries := \
$(shell $(CROSS)gcc --print-file-name=libc.so) \
else
# Force a full build of the cross compiler for target platform
# No need to build i386 for x86 since coreboot uses its own compiler
musl-cross_configure := \
musl-cross-make_configure := \
echo -e >> Makefile 'musl-target:' ; \
echo -e >> Makefile '\t$$$$(MAKE) TARGET="$(MUSL_ARCH)-linux-musl" install' ;
CROSS_PATH ?= $(pwd)/crossgcc/$(CONFIG_TARGET_ARCH)
musl-cross_target := \
musl-cross-make_target := \
OUTPUT="$(CROSS_PATH)" \
MAKE="$(MAKE)" \
$(MAKE_JOBS) \
"musl-target"
CROSS := $(CROSS_PATH)/bin/$(subst -,_,$(MUSL_ARCH))-linux-musl-
musl-cross_libraries := $(CROSS_PATH)/$(subst -,_,$(MUSL_ARCH))-linux-musl/lib/libc.so
musl-cross-make_libraries := $(CROSS_PATH)/$(subst -,_,$(MUSL_ARCH))-linux-musl/lib/libc.so
endif
musl-cross_output := $(CROSS)gcc
musl-cross-make_output := $(CROSS)gcc
## Fake a target so that musl will force a header install by the
## Linux kernel sources.
$(build)/$(musl-cross_dir)/.build: $(INSTALL)/include/linux/limits.h
$(build)/$(musl-cross-make_dir)/.build: $(INSTALL)/include/linux/limits.h
endif

View File

@ -2,16 +2,15 @@ modules-$(CONFIG_NEWT) += newt
newt_depends := popt slang $(musl_dep)
newt_version := 0.52.20
newt_version := 0.52.24
newt_dir := newt-$(newt_version)
newt_tar := newt-$(newt_version).tar.gz
newt_url := https://releases.pagure.org/newt/$(newt_tar)
newt_hash := 8d66ba6beffc3f786d4ccfee9d2b43d93484680ef8db9397a4fb70b5adbb6dbc
newt_hash := 5ded7e221f85f642521c49b1826c8de19845aa372baf5d630a51774b544fbdbb
newt_target := \
#We remove Makefile passed number of jobs to only pass one job, otherwise fails to build
#$(MAKE_JOBS) \
-j1 \
$(CROSS_TOOLS) \
newt_output := \

View File

@ -0,0 +1,17 @@
diff --git a/payloads/external/skiboot/patches/0002-ugly_fix_for_newer_gcc_from_musl_125.patch b/payloads/external/skiboot/patches/0002-ugly_fix_for_newer_gcc_from_musl_125.patch
new file mode 100644
index 0000000..5db9bca
--- /dev/null
+++ b/payloads/external/skiboot/patches/0002-ugly_fix_for_newer_gcc_from_musl_125.patch
@@ -0,0 +1,11 @@
+--- Makefile.main.orig 2024-11-06 16:19:12.161240140 -0500
++++ Makefile.main 2024-11-06 16:23:01.119252412 -0500
+@@ -74,7 +74,7 @@
+ CPPFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
+ endif
+
+-CFLAGS := -fno-strict-aliasing -pie -fpie -fno-pic -mbig-endian -m64 -fno-asynchronous-unwind-tables
++CFLAGS := -Wno-error=address-of-packed-member -Wno-error=format-overflow -fno-strict-aliasing -pie -fpie -fno-pic -mbig-endian -m64 -fno-asynchronous-unwind-tables
+ CFLAGS += -mcpu=power7
+ CFLAGS += -Wl,--oformat,elf64-powerpc -ggdb
+ CFLAGS += $(call try-cflag,$(CC),-ffixed-r13)