From 3c2503ee3327ea93a175768bafbaddff182c1c08 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 28 Mar 2021 06:53:08 +1300 Subject: [PATCH 1/3] test: Add udevice declaration to avoid build error When including this file on a board other than sandbox (e.g by enabling UNIT_TEST and CMD_SETEXPR) an results. Fix it by declaring struct udevice first. Signed-off-by: Simon Glass Reported-by: Heinrich Schuchardt --- include/dm/test.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dm/test.h b/include/dm/test.h index 6ac6672cd6f6..c5a9610ec7d4 100644 --- a/include/dm/test.h +++ b/include/dm/test.h @@ -6,6 +6,8 @@ #ifndef __DM_TEST_H #define __DM_TEST_H +struct udevice; + /** * struct dm_test_cdata - configuration data for test instance * From 6863c7f1b633d50e025ce34ad249b59a14c99b2a Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Thu, 25 Mar 2021 22:02:28 -0400 Subject: [PATCH 2/3] dm: test: Always include command.h for print_ut We need this header for U_BOOT_CMD, which is always present even without EFI. Fixes: 82c468a049 ("dm: test: Update Makefile conditions") Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- test/print_ut.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/print_ut.c b/test/print_ut.c index a456a449efab..5b0a46de9c37 100644 --- a/test/print_ut.c +++ b/test/print_ut.c @@ -6,10 +6,8 @@ #define DEBUG #include -#if CONFIG_IS_ENABLED(EFI_LOADER) && !defined(API_BUILD) #include #include -#endif #include #include #include From 3b142045e8a7f0ab17b6099e9226296af45967d0 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Sat, 20 Mar 2021 20:43:05 +0000 Subject: [PATCH 3/3] Support building on macOS/arm64 On Arm-based Macs, -no_pie is ignored and gives a linker warning. Moreover, the build falls over with: ld: Absolute addressing not allowed in arm64 code but used in '_image_type_ptr_aisimage' referencing '_image_type_aisimage' for dumpimage and mkimage, since we put data structs in text sections not data sections and so cannot have dynamic relocations. Instead, move the sections to __DATA and drop disabling PIE. Signed-off-by: Jessica Clarke Reviewed-by: Tom Rini --- Makefile | 5 ----- tools/imagetool.h | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e9b9c1580834..7d73062df379 100644 --- a/Makefile +++ b/Makefile @@ -324,11 +324,6 @@ HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc") KBUILD_HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp") KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress") -# since Lion (10.7) ASLR is on by default, but we use linker generated lists -# in some host tools which is a problem then ... so disable ASLR for these -# tools -KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie") - # macOS Mojave (10.14.X) # Undefined symbols for architecture x86_64: "_PyArg_ParseTuple" KBUILD_HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "") diff --git a/tools/imagetool.h b/tools/imagetool.h index 8726792c8c06..2801ea9e9f96 100644 --- a/tools/imagetool.h +++ b/tools/imagetool.h @@ -273,14 +273,14 @@ int rockchip_copy_image(int fd, struct image_tool_params *mparams); #define INIT_SECTION(name) do { \ unsigned long name ## _len; \ - char *__cat(pstart_, name) = getsectdata("__TEXT", \ + char *__cat(pstart_, name) = getsectdata("__DATA", \ #name, &__cat(name, _len)); \ char *__cat(pstop_, name) = __cat(pstart_, name) + \ __cat(name, _len); \ __cat(__start_, name) = (void *)__cat(pstart_, name); \ __cat(__stop_, name) = (void *)__cat(pstop_, name); \ } while (0) -#define SECTION(name) __attribute__((section("__TEXT, " #name))) +#define SECTION(name) __attribute__((section("__DATA, " #name))) struct image_type_params **__start_image_type, **__stop_image_type; #else