From aadfde875ddcf324b38799297979e72f43f801c4 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Tue, 13 Feb 2018 13:48:10 -0800 Subject: [PATCH] xen/efi: don't use -fshort-wchar Specifying -fshort-wchar for just one object breaks LTO with the following error message: ld.gold: fatal error: Failed to link module drivers/xen/efi.o: linking module flags 'wchar_size': IDs have conflicting values Since efi.c doesn't actually use wchar_t, turn off the flag when LTO is enabled. Bug: 62093296 Bug: 67506682 Change-Id: I509c18677353add8e1ad04f99f6e42bdab7814e7 Signed-off-by: Sami Tolvanen --- drivers/xen/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/xen/Makefile b/drivers/xen/Makefile index 8feab810aed9..7bd882d5f025 100644 --- a/drivers/xen/Makefile +++ b/drivers/xen/Makefile @@ -7,8 +7,10 @@ obj-y += xenbus/ nostackp := $(call cc-option, -fno-stack-protector) CFLAGS_features.o := $(nostackp) +ifndef CONFIG_LTO_CLANG CFLAGS_efi.o += -fshort-wchar LDFLAGS += $(call ld-option, --no-wchar-size-warning) +endif dom0-$(CONFIG_ARM64) += arm-device.o dom0-$(CONFIG_PCI) += pci.o