From: Peng Fan <peng....@nxp.com>

set the symbol as weak not work if LTO is enabled. Since u_boot_any is
only used on X86 for now, so guard it with X86, otherwise build break
if we use BINMAN_SYMBOLS on i.MX.

Signed-off-by: Peng Fan <peng....@nxp.com>
---
 common/spl/spl.c     | 8 ++++++--
 common/spl/spl_ram.c | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index c8c463f80bd..4b28180467a 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -50,7 +50,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 u32 *boot_params_ptr = NULL;
 
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
+#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) && CONFIG_IS_ENABLED(X86)
 /* See spl.h for information about this */
 binman_sym_declare(ulong, u_boot_any, image_pos);
 binman_sym_declare(ulong, u_boot_any, size);
@@ -148,7 +148,7 @@ void spl_fixup_fdt(void *fdt_blob)
 #endif
 }
 
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
+#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS) && CONFIG_IS_ENABLED(X86)
 ulong spl_get_image_pos(void)
 {
 #ifdef CONFIG_VPL
@@ -221,7 +221,11 @@ __weak struct image_header *spl_get_load_buffer(ssize_t 
offset, size_t size)
 
 void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
 {
+#if CONFIG_IS_ENABLED(X86)
        ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+#else
+       ulong u_boot_pos = BINMAN_SYM_MISSING;
+#endif
 
        spl_image->size = CONFIG_SYS_MONITOR_LEN;
 
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 82964592571..083b14102ee 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -70,7 +70,11 @@ static int spl_ram_load_image(struct spl_image_info 
*spl_image,
                load.read = spl_ram_load_read;
                spl_load_simple_fit(spl_image, &load, 0, header);
        } else {
+#if CONFIG_IS_ENABLED(X86)
                ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+#else
+               ulong u_boot_pos = BINMAN_SYM_MISSING;
+#endif
 
                debug("Legacy image\n");
                /*
-- 
2.36.0

Reply via email to