[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: Use $(CONFIG_CC_IS_CLANG) instead of $(clang) in Makefile



commit 67c5d662d768311fae9c7035b305078b81b23909
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Wed Dec 11 15:27:33 2019 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jan 30 11:54:33 2020 +0000

    xen: Use $(CONFIG_CC_IS_CLANG) instead of $(clang) in Makefile
    
    Kconfig can check if $(CC) is clang or not, if it is
    CONFIG_CC_IS_CLANG will be set.
    
    With that patch, the hypervisor can be built using clang by running
    `make CC=clang CXX=clang++` without needed to provide an extra clang
    parameter.
    
    `make clang=y` still works as Config.mk will set CC and CXX.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/Rules.mk                 | 8 ++++----
 xen/arch/x86/Rules.mk        | 2 +-
 xen/common/coverage/Makefile | 2 +-
 xen/include/Makefile         | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 2bd269bb8a..d22a16d282 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -64,7 +64,7 @@ CFLAGS += -pipe -D__XEN__ -include 
$(BASEDIR)/include/xen/config.h
 CFLAGS-$(CONFIG_DEBUG_INFO) += -g
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
-ifneq ($(clang),y)
+ifneq ($(CONFIG_CC_IS_CLANG),y)
 # Clang doesn't understand this command line argument, and doesn't appear to
 # have an suitable alternative.  The resulting compiled binary does function,
 # but has an excessively large symbol table.
@@ -122,7 +122,7 @@ subdir-all := $(subdir-y) $(subdir-n)
 $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += 
-DINIT_SECTIONS_ONLY
 
 ifeq ($(CONFIG_COVERAGE),y)
-ifeq ($(clang),y)
+ifeq ($(CONFIG_CC_IS_CLANG),y)
     COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
 else
     COV_FLAGS := -fprofile-arcs -ftest-coverage
@@ -139,7 +139,7 @@ endif
 
 ifeq ($(CONFIG_LTO),y)
 CFLAGS += -flto
-LDFLAGS-$(clang) += -plugin LLVMgold.so
+LDFLAGS-$(CONFIG_CC_IS_CLANG) += -plugin LLVMgold.so
 # Would like to handle all object files as bitcode, but objects made from
 # pure asm are in a different format and have to be collected separately.
 # Mirror the directory tree, collecting them as built_in_bin.o.
@@ -193,7 +193,7 @@ SRCPATH := $(patsubst $(BASEDIR)/%,%,$(CURDIR))
 %.o: %.c Makefile
 ifeq ($(CONFIG_ENFORCE_UNIQUE_SYMBOLS),y)
        $(CC) $(CFLAGS) -c $< -o $(@D)/.$(@F).tmp -MQ $@
-ifeq ($(clang),y)
+ifeq ($(CONFIG_CC_IS_CLANG),y)
        $(OBJCOPY) --redefine-sym $<=$(SRCPATH)/$< $(@D)/.$(@F).tmp $@
 else
        $(OBJCOPY) --redefine-sym $(<F)=$(SRCPATH)/$< $(@D)/.$(@F).tmp $@
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index a2c257fb95..b98e14e28c 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -12,7 +12,7 @@ CFLAGS += '-D__OBJECT_LABEL__=$(subst /,$$,$(subst 
-,_,$(subst $(BASEDIR)/,,$(CU
 # Prevent floating-point variables from creeping into Xen.
 CFLAGS += -msoft-float
 
-ifeq ($(clang),y)
+ifeq ($(CONFIG_CC_IS_CLANG),y)
 # Note: Any test which adds -no-integrated-as will cause subsequent tests to
 # succeed, and not trigger further additions.
 #
diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile
index b509e51f96..63f98c71d6 100644
--- a/xen/common/coverage/Makefile
+++ b/xen/common/coverage/Makefile
@@ -1,5 +1,5 @@
 obj-y += coverage.o
-ifneq ($(clang),y)
+ifneq ($(CONFIG_CC_IS_CLANG),y)
 obj-y += gcov_base.o gcov.o
 obj-y += $(call cc-ifversion,-lt,0407, \
                gcc_3_4.o, $(call cc-ifversion,-lt,0409, \
diff --git a/xen/include/Makefile b/xen/include/Makefile
index c3e0283d34..fde0ca0131 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -36,7 +36,7 @@ cppflags-y                := -include public/xen-compat.h 
-DXEN_GENERATING_COMPA
 cppflags-$(CONFIG_X86)    += -m32
 
 # 8-byte types are 4-byte aligned on x86_32 ...
-ifeq ($(clang),y)
+ifeq ($(CONFIG_CC_IS_CLANG),y)
 prefix-$(CONFIG_X86)      := \#pragma pack(push, 4)
 suffix-$(CONFIG_X86)      := \#pragma pack(pop)
 else
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.