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

[Minios-devel] [UNIKRAFT PATCH v2 2/3] arch/*, build: Delete some flags for clang



In order to perform the compilation and linking with clang without warnings, 
the following flags must be removed:
-fno-tree-sra, -fms-extensions, -nostdinc, -fno-reorder-blocks, 
-mno-fp-ret-in-387.

Signed-off-by: Alice Suiu <alicesuiu17@xxxxxxxxx>
---
 Makefile.uk                 | 10 +++++++++-
 arch/x86/x86_64/Makefile.uk |  7 +++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Makefile.uk b/Makefile.uk
index b519a43..dee9f35 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -6,7 +6,7 @@
 
 COMPFLAGS    += -nostdinc -nostdlib
 COMPFLAGS    += -U __linux__ -U __FreeBSD__ -U __sun__
-COMPFLAGS    += -fno-stack-protector -fno-omit-frame-pointer
+COMPFLAGS    += -fno-stack-protector -fno-omit-frame-pointer -fno-tree-sra
 COMPFLAGS    += -Wall -Wextra
 
 # TODO: Remove -fms-extensions if not needed for our code (it was moved from 
Arm64 arch)
@@ -55,3 +55,11 @@ M4FLAGS      += -DUK_VERSION=$(UK_VERSION).$(UK_SUBVERSION)
 COMPFLAGS-$(call gcc_version_ge,6,1)   += -no-pie
 LIBLDFLAGS-$(call gcc_version_ge,6,1)  += -no-pie
 LDFLAGS-$(call gcc_version_ge,6,1)     += -no-pie
+
+ifeq ($(CONFIG_COMPILER), clang)
+CFLAGS:=$(filter-out -fms-extensions,$(CFLAGS))
+COMPFLAGS:=$(filter-out -fno-tree-sra,$(COMPFLAGS))
+COMPFLAGS:=$(filter-out -nostdinc,$(COMPFLAGS))
+LIBLDFLAGS:=$(filter-out -nostdinc,$(LIBLDFLAGS))
+LDFLAGS:=$(filter-out -nostdinc,$(LDFLAGS))
+endif
\ No newline at end of file
diff --git a/arch/x86/x86_64/Makefile.uk b/arch/x86/x86_64/Makefile.uk
index 3d0b34d..1bbe02c 100644
--- a/arch/x86/x86_64/Makefile.uk
+++ b/arch/x86/x86_64/Makefile.uk
@@ -41,3 +41,10 @@ ARCHFLAGS-$(CONFIG_MARCH_X86_64_BTVER1)         += 
-march=btver1
 ISR_ARCHFLAGS-$(CONFIG_MARCH_X86_64_BTVER1)     += -march=btver1
 ARCHFLAGS-$(CONFIG_MARCH_X86_64_BTVER2)         += -march=btver2
 ISR_ARCHFLAGS-$(CONFIG_MARCH_X86_64_BTVER2)     += -march=btver2
+
+
+ifeq ($(CONFIG_COMPILER), clang)
+ARCHFLAGS:=$(filter-out -fno-reorder-blocks,$(ARCHFLAGS))
+ISR_ARCHFLAGS:=$(filter-out -fno-reorder-blocks,$(ISR_ARCHFLAGS))
+ISR_ARCHFLAGS:=$(filter-out -mno-fp-ret-in-387,$(ISR_ARCHFLAGS))
+endif
\ No newline at end of file
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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