From 850a566916a8a7fe6c4a74f3f05692129f7c6d3a Mon Sep 17 00:00:00 2001 From: Zbigniew Bodek Date: Thu, 8 Oct 2020 23:03:58 +0800 Subject: [PATCH] Workaround linking problem caused by missing SystemInit during build During LiteOS consolidation, system_init.o object that contains SystemInit() doesn't exist yet as it is being built later and linked in ./vendor directory when OHOS_Image is created. This is not the case when building for HiSilicon platforms as SystemInit is provided for them in precompiled libraries. Workaround this issue by creating "weak" function in LiteOS that will be replaced by the "strong" symbol from ./vendor in linking phase of the OHOS_Image. Signed-off-by: Zbigniew Bodek Change-Id: I39f327a350722a3e41a370ee93ba3b734c5681b0 --- kernel/common/los_config.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/common/los_config.c b/kernel/common/los_config.c index 368dd631..2de7b995 100644 --- a/kernel/common/los_config.c +++ b/kernel/common/los_config.c @@ -132,6 +132,11 @@ extern "C" { extern UINT32 OsSystemInit(VOID); extern VOID SystemInit(VOID); +VOID __attribute__((weak)) SystemInit(VOID) +{ + PRINT_WARN("Function not implemented. Using weak reference stub\n"); +} + LITE_OS_SEC_TEXT_INIT VOID osRegister(VOID) { g_sysClock = OS_SYS_CLOCK;