]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Build: Use $(CC) for linking
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 21 Oct 2016 17:53:29 +0000 (18:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Dec 2016 18:30:41 +0000 (18:30 +0000)
This is a prerequisite for using LTO.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Makefile
build/common.mk
build/gen.mk

index 42a5bebbd3609ef8fe4131d99ad6ad34311f02e7..15a865fbf4e7a24207f56ea99ec997199850d11c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,11 +28,11 @@ INSTALL         := install
 INSTALL_DATA    := $(INSTALL) -m 644 -p
 INSTALL_DIR     := $(INSTALL) -d -p
 INSTALL_PROGRAM := $(INSTALL) -p
-LD              := $(CROSS_COMPILE)ld
+# LD            := $(CC) # Use $(CC) for linking to support LTO
 OBJCOPY         := $(CROSS_COMPILE)objcopy
 PYTHON          := python
 
-export CC CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM LD OBJCOPY PYTHON
+export CC CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON
 
 .PHONY: all
 all:
index 32afce5bba0ddda2a31696e119eb8967194ef2cd..7c4870e05a9a2a6a15dce6c8864dd131b4724e72 100644 (file)
@@ -61,7 +61,7 @@ CFLAGS_$(1) := $$(CFLAGS_$($(1)_arch)) $$(COMMON_CFLAGS-$(1)) -DCONFIG_ENV_$(1)
 
 link-$(1) := $(ROOT)/arch/x86/link-$(1).lds
 
-LDFLAGS_$(1) := -T $$(link-$(1))
+LDFLAGS_$(1) := -Wl,-T,$$(link-$(1)) -nostdlib
 
 # Needs to pick up test-provided obj-perenv and obj-perarch
 DEPS-$(1) = $(head-$(1)) \
index 5cc2c90c1fb51b4e752d29795ad79bb459a309d1..9a1c6b9087c824291d6c57f9d6cea1d402fecd47 100644 (file)
@@ -47,11 +47,11 @@ define PERENV_build
 ifneq ($(1),hvm64)
 # Generic link line for most environments
 test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
-       $$(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@
+       $(CC) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@
 else
 # hvm64 needs linking normally, then converting to elf32-x86-64 or elf32-i386
 test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
-       $$(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@.tmp
+       $(CC) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@.tmp
        $(OBJCOPY) $$@.tmp -O $(hvm64-format) $$@
        rm -f $$@.tmp
 endif