|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v3 1/2] build: Use GCC replacements for `ld`, `ar`, and `nm`
Hello, On 05/16/2018 02:56 PM, Simon Kuenzer wrote: Instead of using `ld`, `ar`, and `nm`, use GCC's replacements. This opens further optimizations options that could be used later for building images (e.g., LTO). Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> --- Makefile | 6 +++--- Makefile.uk | 8 ++++---- plat/kvm/Linker.uk | 8 ++++---- plat/linuxu/Linker.uk | 2 +- plat/xen/Linker.uk | 16 ++++++++-------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index b177bff..974b183 100644 --- a/Makefile +++ b/Makefile @@ -387,13 +387,13 @@ CROSS_COMPILE := $(CROSS_COMPILE:"%"=%) include $(UK_BASE)/arch/$(UK_ARCH)/Compiler.uk# Make variables (CC, etc...)-LD := $(CROSS_COMPILE)ld +LD := $(CROSS_COMPILE)gcc CC := $(CROSS_COMPILE)gcc CPP := $(CC) CXX := $(CPP) AS := $(CC) -AR := $(CROSS_COMPILE)ar -NM := $(CROSS_COMPILE)nm +AR := $(CROSS_COMPILE)gcc-ar +NM := $(CROSS_COMPILE)gcc-nm READELF := $(CROSS_COMPILE)readelf STRIP := $(CROSS_COMPILE)strip OBJCOPY := $(CROSS_COMPILE)objcopy diff --git a/Makefile.uk b/Makefile.uk index 5855b40..c540ada 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -20,8 +20,8 @@ CXXINCLUDES += -nostdinc -nostdlib -I$(UK_BASE)/include # Set the text and data sections to be readable and writable. Also, # do not page-align the data segment. If the output format supports # Unix style magic numbers, mark the output as OMAGIC. -LIBLDFLAGS += --omagic -r -LDFLAGS += --omagic +LIBLDFLAGS += -nostdinc -nostdlib -Wl,--omagic -Wl,-r +LDFLAGS += -nostdinc -nostdlib -Wl,--omagic -Wl,--build-id=noneCFLAGS-$(OPTIMIZE_NONE) += -O0 -fno-optimize-sibling-calls -fno-tree-vectorizeCXXFLAGS-$(OPTIMIZE_NONE) += -O0 -fno-optimize-sibling-calls -fno-tree-vectorize @@ -32,12 +32,12 @@ CXXFLAGS-$(OPTIMIZE_SIZE) += -OsCFLAGS-$(OPTIMIZE_DEADELIM) += -fdata-sections -ffunction-sectionsCXXFLAGS-$(OPTIMIZE_DEADELIM) += -fdata-sections -ffunction-sections -LDFLAGS-$(OPTIMIZE_DEADELIM) += --gc-sections +LDFLAGS-$(OPTIMIZE_DEADELIM) += -Wl,--gc-sectionsifneq ($(DEBUG_SYMBOLS),y)CFLAGS += -g0 CXXFLAGS += -g0 -LDFLAGS-y += --strip-debug +LDFLAGS-y += -Wl,--strip-debug else CFLAGS-$(DEBUG_SYMBOLS_LVL1) += -g1 CXXFLAGS-$(DEBUG_SYMBOLS_LVL1) += -g1 diff --git a/plat/kvm/Linker.uk b/plat/kvm/Linker.uk index 7957b7a..a91a786 100644 --- a/plat/kvm/Linker.uk +++ b/plat/kvm/Linker.uk @@ -1,6 +1,6 @@ ifeq (x86_64,$(UK_ARCH)) -KVM_LDSCRIPT := $(UK_BASE)/plat/kvm/x86/link64.ld -KVM_LDFLAGS-y += -m elf_x86_64 +KVM_LDSCRIPT := -Wl,-T,$(UK_BASE)/plat/kvm/x86/link64.ld +KVM_LDFLAGS-y += -Wl,-m,elf_x86_64 endif##@@ -10,12 +10,12 @@ KVM_IMAGE := $(BUILD_DIR)/$(UK_NAME)_kvm-$(UK_ARCH)$(KVM_IMAGE): $(KVM_LINK) $(KVM_LINK-y) $(UK_LINK) $(UK_LINK-y) The changes look fine. Thanks & Regards S Sharan _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |