All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Subject: [Xen-devel] [RFC XEN PATCH 19/23] update *FLAGS for arch/x86/Makefile
Date: Wed, 23 Oct 2019 17:48:33 +0100	[thread overview]
Message-ID: <20191023164837.2700240-20-anthony.perard@citrix.com> (raw)
In-Reply-To: <20191023164837.2700240-1-anthony.perard@citrix.com>

---
 xen/arch/x86/Makefile | 65 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 49b7eb9fd116..41486c512f10 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -1,3 +1,68 @@
+# select defconfig based on actual architecture
+KBUILD_DEFCONFIG := $(ARCH)_defconfig
+
+export XEN_IMG_OFFSET := 0x200000
+
+KBUILD_CFLAGS += -I$(srctree)/include
+KBUILD_CFLAGS += -I$(srctree)/include/asm-x86/mach-generic
+KBUILD_CFLAGS += -I$(srctree)/include/asm-x86/mach-default
+KBUILD_CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET)
+
+# Prevent floating-point variables from creeping into Xen.
+KBUILD_CFLAGS += -msoft-float
+
+KBUILD_CFLAGS += $(foreach o,$(EMBEDDED_EXTRA_CFLAGS),$(call cc-option,$(o)))
+KBUILD_CFLAGS += $(call cc-option,-Wnested-externs)
+KBUILD_CFLAGS += $(call as-instr,vmcall,-DHAVE_AS_VMX)
+KBUILD_CFLAGS += $(call as-instr,crc32 %eax$(comma)%eax,-DHAVE_AS_SSE4_2)
+KBUILD_CFLAGS += $(call as-instr,invept (%rax)$(comma)%rax,-DHAVE_AS_EPT)
+KBUILD_CFLAGS += $(call as-instr,rdrand %eax,-DHAVE_AS_RDRAND)
+KBUILD_CFLAGS += $(call as-instr,rdfsbase %rax,-DHAVE_AS_FSGSBASE)
+KBUILD_CFLAGS += $(call as-instr,xsaveopt (%rax),-DHAVE_AS_XSAVEOPT)
+KBUILD_CFLAGS += $(call as-instr,rdseed %eax,-DHAVE_AS_RDSEED)
+KBUILD_CFLAGS += $(call as-instr,clwb (%rax),-DHAVE_AS_CLWB)
+KBUILD_CFLAGS += $(call as-instr,.equ \"x\"$(comma)1,-DHAVE_AS_QUOTED_SYM)
+KBUILD_CFLAGS += $(call as-instr,invpcid (%rax)$(comma)%rax,-DHAVE_AS_INVPCID)
+
+# GAS's idea of true is -1.  Clang's idea is 1
+KBUILD_CFLAGS += $(call as-instr,\
+    .if ((1 > 0) < 0); .error "";.endif,,-DHAVE_AS_NEGATIVE_TRUE)
+
+# Check to see whether the assmbler supports the .nop directive.
+KBUILD_CFLAGS += $(call as-instr,\
+    .L1: .L2: .nops (.L2 - .L1)$(comma)9,-DHAVE_AS_NOPS_DIRECTIVE)
+
+KBUILD_CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables
+
+# Xen doesn't use SSE interally.  If the compiler supports it, also skip the
+# SSE setup for variadic function calls.
+KBUILD_CFLAGS += -mno-sse $(call cc-option,-mskip-rax-setup)
+
+# -fvisibility=hidden reduces -fpic cost, if it's available
+ifeq ($(call cc-option-yn,-fvisibility=hidden),y)
+KBUILD_CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
+endif
+
+# Compile with thunk-extern, indirect-branch-register if avaiable.
+ifeq ($(call cc-option-yn,-mindirect-branch-register),y)
+KBUILD_CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register
+KBUILD_CFLAGS += -DCONFIG_INDIRECT_THUNK
+KBUILD_CFLAGS += -fno-jump-tables
+export CONFIG_INDIRECT_THUNK=y
+endif
+
+# If supported by the compiler, reduce stack alignment to 8 bytes. But allow
+# this to be overridden elsewhere.
+# XXX adding to cflags instead of CFLAGS-stack-boundary
+KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+
+# Set up the assembler include path properly for older toolchains.
+KBUILD_CFLAGS += -Wa,-I$(srctree)/include
+
+# XXX from xen.git/config/x86_64.mk
+LDFLAGS_emulation_OpenBSD := _obsd
+LDFLAGS_emulation_FreeBSD := _fbsd
+KBUILD_LDFLAGS += -melf_x86_64$(LDFLAGS_emulation_$(XEN_OS))
 
 efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
                       -O $(BASEDIR)/include/xen/compile.h ]; then \
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-10-23 17:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 16:48 [Xen-devel] [RFC XEN PATCH 00/23] Kconfig update + WIP of using Kbuild Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 01/23] xen: Fix strange byte in common/Kconfig Anthony PERARD
2019-10-24 10:41   ` [Xen-devel] [PATCH for-4.13 " Andrew Cooper
2019-10-24 10:48     ` Jürgen Groß
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 02/23] xen: Makefile: Remove outdated comment Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 04/23] build: Import Kbuild from Linux v5.3 Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 05/23] xen: Kbuild: Remove extra -include from C flags Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 06/23] xen, Kbuild: filter-out -Wa, % from CFLAGS for %.i:%.c rules Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 07/23] xen, Kbuild: Handle obj-bin-y and %.init.o objects Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 08/23] xen, Kbuild: Change filechk_offsets Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 09/23] xen, Kbuild: Filter-out -Wa, in %.s:%.c rules Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 10/23] xen,Kbuild: Handle __OBJECT_*__ Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 11/23] First conversion to kbuild makefiles Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 12/23] Build guest_walk* in arch/x86/mm Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 13/23] convert common/libelf/Makefile to kbuild makefile Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 14/23] convert common/libfdt " Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 15/23] convert tools/Makefile to kbuild Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 16/23] convert include/Makefile to Kbuild Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 17/23] convert arch/x86/boot/Makefile to kbuild Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 18/23] arch/x86: Start moving build targets out of Makefile into Kbuild Anthony PERARD
2019-10-23 16:48 ` Anthony PERARD [this message]
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 20/23] update arch/Makefile Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 21/23] Import root Makefile from Linux v5.3 Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 22/23] Changes to root Makefile Anthony PERARD
2019-10-23 16:48 ` [Xen-devel] [RFC XEN PATCH 23/23] xen/tools/kconfig: Delete duplicate makefiles Anthony PERARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191023164837.2700240-20-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.