]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common/x86: Fix `libukreloc` error for non-`PIE` `SMP` builds
authorSergiu Moga <sergiu@unikraft.io>
Fri, 11 Aug 2023 12:45:13 +0000 (15:45 +0300)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 16:09:28 +0000 (16:09 +0000)
After the merge of
commit cf8cc65cb0ae ("plat/kvm/x86: Make SMP init code resolve its own `start16` relocations")
SMP builds that were not built with `libukreloc` would fail due to
external references to `x86_start16_*` symbols no longer being declared.

Thus, fix this by making their declaration present regardless of
`CONFIG_LIBUKRELOC` being enabled or not. Furthermore, guard the no
longer necessary `START16_UKRELOC_*` macro's, as they are not needed
if the previously mentioned configuration is not enabled.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1037

plat/common/x86/lcpu.c
plat/common/x86/start16_helpers.h

index c593f2a7aef751646eb06b931da6c16b0af100bb..6be907b1a5f0604e1b6628e35234eda03aff23d2 100644 (file)
@@ -51,9 +51,7 @@
 #include <string.h>
 #include <errno.h>
 
-#if CONFIG_LIBUKRELOC
 #include "start16_helpers.h"
-#endif /* CONFIG_LIBUKRELOC */
 
 __lcpuid lcpu_arch_id(void)
 {
index af801539dda383fc57de529a4ec3156a06fa747c..067de8c1b5c11a8a05cd188345573cedf180649d 100644 (file)
@@ -14,6 +14,7 @@ extern void *x86_start16_end[];
 #define X86_START16_SIZE                                               \
        ((__uptr)x86_start16_end - (__uptr)x86_start16_begin)
 
+#if CONFIG_LIBUKRELOC
 #define START16_UKRELOC_MOV_SYM(sym, sz)                               \
        sym##_uk_reloc_imm##sz##_start16
 
@@ -36,5 +37,6 @@ extern void *x86_start16_end[];
        UKRELOC_ENTRY(START16_UKRELOC_##type##_OFF(sym, sz),            \
                       (void *)sym - (void *)x86_start16_begin,         \
                       sz, UKRELOC_FLAGS_PHYS_REL)
+#endif /* CONFIG_LIBUKRELOC */
 
 #endif  /* __START16_HELPERS_H__ */