]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
build: Use LD
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Apr 2021 15:06:38 +0000 (16:06 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Apr 2021 20:33:43 +0000 (21:33 +0100)
This is going to matter for proper LLVM support, where we want to default to
ld.lld

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

index 15a865fbf4e7a24207f56ea99ec997199850d11c..ae6124e6b91c11991c7fc6ce38cecdc8cdc13154 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,16 +23,16 @@ export DESTDIR xtfdir xtftestdir
 
 # Programs used
 CC              := $(CROSS_COMPILE)gcc
+LD              := $(CROSS_COMPILE)ld
+OBJCOPY         := $(CROSS_COMPILE)objcopy
 CPP             := $(CC) -E
 INSTALL         := install
 INSTALL_DATA    := $(INSTALL) -m 644 -p
 INSTALL_DIR     := $(INSTALL) -d -p
 INSTALL_PROGRAM := $(INSTALL) -p
-# 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 OBJCOPY PYTHON
+export CC LD CPP INSTALL INSTALL_DATA INSTALL_DIR INSTALL_PROGRAM OBJCOPY PYTHON
 
 .PHONY: all
 all:
index e43dd628194861cec59e2650c55329af5d71d98e..1f048802124781f029fda38ee2f02d589b7e8056 100644 (file)
@@ -57,7 +57,7 @@ CFLAGS_$(1) := $$(CFLAGS_$($(1)_arch)) $$(COMMON_CFLAGS-$(1)) -DCONFIG_ENV_$(1)
 head-$(1) := $(ROOT)/arch/x86/$($(1)_guest)/head-$(1).o
 link-$(1) := $(ROOT)/arch/x86/link-$(1).lds
 
-LDFLAGS_$(1) := -Wl,-T,$$(link-$(1)) -nostdlib $(LDFLAGS-y)
+LDFLAGS_$(1) := -$$(link-$(1)) -nostdlib $(LDFLAGS-y)
 
 # Needs to pick up test-provided obj-perenv and obj-perarch
 DEPS-$(1) = $$(head-$(1)) \
index f657d878935acfef53795f59a7e1ca2a4c359459..25dd5c626bbbc7b04cd89142e64fc0122586a32e 100644 (file)
@@ -51,11 +51,11 @@ define PERENV_build
 ifneq ($(1),hvm64)
 # Generic link line for most environments
 test-$(1)-$(NAME): $$(DEPS-$(1)) $$(link-$(1))
-       $(CC) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@
+       $(LD) $$(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))
-       $(CC) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@.tmp
+       $(LD) $$(LDFLAGS_$(1)) $$(DEPS-$(1)) -o $$@.tmp
        $(OBJCOPY) $$@.tmp -O $(hvm64-format) $$@
        rm -f $$@.tmp
 endif