From e562aaedd3384b506bf8451d862474ba687efb25 Mon Sep 17 00:00:00 2001 From: Marco Oliverio Date: Thu, 13 Jul 2023 06:44:31 +0000 Subject: [PATCH] stage1: un-generalize PPC specific options --- src/string.c | 4 ++-- stage1/Makefile | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/string.c b/src/string.c index 6c1bffaf..4cf75e3a 100644 --- a/src/string.c +++ b/src/string.c @@ -44,7 +44,7 @@ size_t strlen(const char *s); /* forward declaration */ /* allow using built-in libc if WOLFBOOT_USE_STDLIBC is defined */ #ifndef WOLFBOOT_USE_STDLIBC -#if !defined(BUILD_LOADER_STAGE1) || \ +#if !(defined(BUILD_LOADER_STAGE1) && defined(ARCH_PPC)) || \ (defined(PRINTF_ENABLED) && defined(DEBUG_UART)) int islower(int c) @@ -228,7 +228,7 @@ int memcmp(const void *_s1, const void *_s2, size_t n) #endif /* !BUILD_LOADER_STAGE1 || (PRINTF_ENABLED && DEBUG_UART) */ #if !defined(__CCRX__) /* Renesas CCRX */ -#if !defined(BUILD_LOADER_STAGE1) || defined(DEBUG_UART) +#if !(defined(BUILD_LOADER_STAGE1) && defined(ARCH_PPC)) || defined(DEBUG_UART) size_t strlen(const char *s) { size_t i = 0; diff --git a/stage1/Makefile b/stage1/Makefile index 567e840a..ba029c92 100644 --- a/stage1/Makefile +++ b/stage1/Makefile @@ -21,14 +21,15 @@ V?=0 DEBUG?=0 DEBUG_UART?=0 +ifeq ($(ARCH),PPC) OBJS:= \ ./hal/$(TARGET).o \ ./src/string.o \ loader_stage1.o +endif WOLFCRYPT_OBJS:= PUBLIC_KEY_OBJS:= - # Forcefully disable TPM support in first stage loader WOLFTPM=0 ELF=0 @@ -72,10 +73,11 @@ CFLAGS+=\ -DWOLFBOOT_STAGE1_BASE_ADDR=$(WOLFBOOT_STAGE1_BASE_ADDR) # For printf support (disable NO_PRINTF_UART) and increase WOLFBOOT_STAGE1_SIZE -CFLAGS+=-DNO_PRINTF_UART - -# Use PIC (Position Independent Code) for first stage loader -CFLAGS+=-fPIC +ifeq ($(ARCH),PPC) + CFLAGS+=-DNO_PRINTF_UART + # Use PIC (Position Independent Code) for first stage loader + CFLAGS+=-fPIC +endif BUILD_DIR=.