diff options
| -rw-r--r-- | meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch | 49 | ||||
| -rw-r--r-- | meta/recipes-bsp/opensbi/opensbi_1.7.bb (renamed from meta/recipes-bsp/opensbi/opensbi_1.6.bb) | 6 |
2 files changed, 2 insertions, 53 deletions
diff --git a/meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch b/meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch deleted file mode 100644 index e650476f50..0000000000 --- a/meta/recipes-bsp/opensbi/opensbi/0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | From f4c440219f42d74bd3d6688132ea876f3f51e601 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 14 May 2025 19:50:24 -0700 | ||
| 4 | Subject: [PATCH] Makefile: Add flag for reprodubility compiler flags | ||
| 5 | |||
| 6 | Provides mechanism to remove absolute paths from binaries using | ||
| 7 | -ffile-prefix-map | ||
| 8 | |||
| 9 | It will help distros (e.g. yocto based ones ) which want to ship | ||
| 10 | the .elf files but need to scrub absolute paths in objects | ||
| 11 | |||
| 12 | Upstream-Status: Submitted [https://lists.infradead.org/pipermail/opensbi/2025-May/008458.html] | ||
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 14 | --- | ||
| 15 | Makefile | 7 +++++++ | ||
| 16 | 1 file changed, 7 insertions(+) | ||
| 17 | |||
| 18 | diff --git a/Makefile b/Makefile | ||
| 19 | index e90836c7..22d4ecff 100644 | ||
| 20 | --- a/Makefile | ||
| 21 | +++ b/Makefile | ||
| 22 | @@ -174,6 +174,11 @@ else | ||
| 23 | USE_LD_FLAG = -fuse-ld=bfd | ||
| 24 | endif | ||
| 25 | |||
| 26 | +REPRODUCIBLE ?= n | ||
| 27 | +ifeq ($(REPRODUCIBLE),y) | ||
| 28 | +REPRODUCIBLE_FLAGS += -ffile-prefix-map=$(src_dir)= | ||
| 29 | +endif | ||
| 30 | + | ||
| 31 | # Check whether the linker supports creating PIEs | ||
| 32 | OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fPIE -nostdlib -Wl,-pie -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) | ||
| 33 | |||
| 34 | @@ -362,6 +367,7 @@ GENFLAGS += $(firmware-genflags-y) | ||
| 35 | |||
| 36 | CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-stack-protector -fno-strict-aliasing -ffunction-sections -fdata-sections | ||
| 37 | CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | ||
| 38 | +CFLAGS += $(REPRODUCIBLE_FLAGS) | ||
| 39 | # Optionally supported flags | ||
| 40 | ifeq ($(CC_SUPPORT_VECTOR),y) | ||
| 41 | CFLAGS += -DOPENSBI_CC_SUPPORT_VECTOR | ||
| 42 | @@ -387,6 +393,7 @@ CPPFLAGS += $(firmware-cppflags-y) | ||
| 43 | ASFLAGS = -g -Wall -nostdlib | ||
| 44 | ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | ||
| 45 | ASFLAGS += -fPIE | ||
| 46 | +ASFLAGS += $(REPRODUCIBLE_FLAGS) | ||
| 47 | # Optionally supported flags | ||
| 48 | ifeq ($(CC_SUPPORT_SAVE_RESTORE),y) | ||
| 49 | ASFLAGS += -mno-save-restore | ||
diff --git a/meta/recipes-bsp/opensbi/opensbi_1.6.bb b/meta/recipes-bsp/opensbi/opensbi_1.7.bb index 308ac43ac8..a460062e93 100644 --- a/meta/recipes-bsp/opensbi/opensbi_1.6.bb +++ b/meta/recipes-bsp/opensbi/opensbi_1.7.bb | |||
| @@ -8,10 +8,8 @@ require opensbi-payloads.inc | |||
| 8 | 8 | ||
| 9 | inherit deploy | 9 | inherit deploy |
| 10 | 10 | ||
| 11 | SRCREV = "bd613dd92113f683052acfb23d9dc8ba60029e0a" | 11 | SRCREV = "a32a91069119e7a5aa31e6bc51d5e00860be3d80" |
| 12 | SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https \ | 12 | SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https" |
| 13 | file://0001-Makefile-Add-flag-for-reprodubility-compiler-flags.patch \ | ||
| 14 | " | ||
| 15 | 13 | ||
| 16 | TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/" | 14 | TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/" |
| 17 | 15 | ||
