]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
build: Do not use segment annotations on linuxu
authorMarco Schlumpp <marco@unikraft.io>
Wed, 12 Apr 2023 09:09:26 +0000 (11:09 +0200)
committerUnikraft <monkey@unikraft.io>
Wed, 10 May 2023 11:50:10 +0000 (11:50 +0000)
For the linuxu platform we rely on the default linker script and only
add some additional sections on top of that one. That also means that
there aren't any segments defined. This makes the segment specification
opt-in instead of assuming the segments are always defined.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Checkpatch-Ignore: SPACING
Checkpatch-Ignore: COMPLEX_MACRO
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #833

plat/common/include/uk/plat/common/common.lds.h
plat/kvm/Makefile.uk
plat/xen/Makefile.uk

index 89ab444d1a4ae540cdd967ca0700fbccf8c204e1..df6dd46592154e005ac5a2347b1dc12c145c1ab8 100644 (file)
 
 #include <uk/arch/limits.h> /* for __PAGE_SIZE */
 
+#ifdef UK_USE_SECTION_SEGMENTS
+#define UK_SEGMENT_TLS :tls
+#define UK_SEGMENT_TLS_LOAD :tls_load
+#define UK_SEGMENT_DATA :data
+#else
+#define UK_SEGMENT_TLS
+#define UK_SEGMENT_TLS_LOAD
+#define UK_SEGMENT_DATA
+#endif
+
 /** Executable */
 #define PHDRS_PF_X 0x1
 /** Writeable */
                *(.tdata)                                               \
                *(.tdata.*)                                             \
                *(.gnu.linkonce.td.*)                                   \
-       } :tls :tls_load                                                \
+       } UK_SEGMENT_TLS UK_SEGMENT_TLS_LOAD                            \
        _etdata = .;                                                    \
        .tbss :                                                         \
        {                                                               \
        {                                                               \
                *(.data)                                                \
                *(.data.*)                                              \
-       } :data                                                         \
+       } UK_SEGMENT_DATA                                               \
        _edata = .;                                                     \
                                                                        \
        /*                                                              \
index 6f4d37b8315f44ede66d9bbeb66db069ec6e975e..786a7e3f76dcb9f6a5ee0c21e633a7f79d9b41f3 100644 (file)
@@ -26,9 +26,9 @@ LIBKVMPLAT_CINCLUDES-y         += -I$(LIBKVMPLAT_BASE)/include
 LIBKVMPLAT_CINCLUDES-y         += -I$(UK_PLAT_COMMON_BASE)/include
 LIBKVMPLAT_CINCLUDES-y         += -I$(UK_PLAT_DRIVERS_BASE)/include
 
-LIBKVMPLAT_ASFLAGS             += -DKVMPLAT
-LIBKVMPLAT_CFLAGS              += -DKVMPLAT
-LIBKVMPLAT_CXXFLAGS            += -DKVMPLAT
+LIBKVMPLAT_ASFLAGS             += -DKVMPLAT -DUK_USE_SECTION_SEGMENTS
+LIBKVMPLAT_CFLAGS              += -DKVMPLAT -DUK_USE_SECTION_SEGMENTS
+LIBKVMPLAT_CXXFLAGS            += -DKVMPLAT -DUK_USE_SECTION_SEGMENTS
 
 ##
 ## Default Linker script
index bc87ecf3efef89bfc425213712480d743422f921..386a52a4ae832e6d63932220a4c8af888623346d 100644 (file)
@@ -21,6 +21,10 @@ LIBXENPLAT_ASFLAGS-y     += -DXENPLAT -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFAC
 LIBXENPLAT_CFLAGS-y      += -DXENPLAT -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
 LIBXENPLAT_CXXFLAGS-y    += -DXENPLAT -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
 
+LIBXENPLAT_ASFLAGS-y     += -DUK_USE_SECTION_SEGMENTS
+LIBXENPLAT_CFLAGS-y      += -DUK_USE_SECTION_SEGMENTS
+LIBXENPLAT_CXXFLAGS-y    += -DUK_USE_SECTION_SEGMENTS
+
 ##
 ## Default Linker script
 ifeq ($(CONFIG_ARCH_X86_64),y)