xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jason Andryuk <jandryuk@gmail.com>
To: Ayush Dosaj <ayushdosaj2313@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Subject: Re: Xen Compilation Error on Ubuntu 20.04
Date: Thu, 30 Apr 2020 16:53:42 -0400	[thread overview]
Message-ID: <CAKf6xptZyZPGL34SKMcEyMyHzqvMpqoY4fdMFaabUb45dnC4bg@mail.gmail.com> (raw)
In-Reply-To: <CAOCxVi0=iKzeJ0gfZ8XoMTXYrZaHbok=F30pw1rNdsUhkQcXjw@mail.gmail.com>

On Thu, Apr 30, 2020 at 4:18 AM Ayush Dosaj <ayushdosaj2313@gmail.com> wrote:
>
> Hi Andrew, Xen Development team.
>
> I compiled and installed Xen by appending -fcf-protection=none to CFLAGS on Ubuntu 20.04 but it still crashes on startup.

Ayush, try the patch below.  EMBEDDED_EXTRA_CFLAGS ensures it is set
down in xen/arch/x86/boot/build32.mk

-Jason

diff --git a/Config.mk b/Config.mk
index 0f303c79b2..efb3d42bc4 100644
--- a/Config.mk
+++ b/Config.mk
@@ -205,6 +205,7 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))

 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
+EMBEDDED_EXTRA_CFLAGS += -fcf-protection=none

 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 4b7ab78467..c3cbae69d2 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -69,6 +69,7 @@ CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
 ifeq ($(CONFIG_INDIRECT_THUNK),y)
 CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register
 CFLAGS += -fno-jump-tables
+$(call cc-option-add,CFLAGS,CC,-fcf-protection=none)
 endif

 # If supported by the compiler, reduce stack alignment to 8 bytes. But allow


  reply	other threads:[~2020-04-30 20:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 17:17 Xen Compilation Error on Ubuntu 20.04 Ayush Dosaj
2020-04-29 17:25 ` Andrew Cooper
2020-04-29 17:28   ` Ayush Dosaj
2020-04-30  8:16     ` Ayush Dosaj
2020-04-30 20:53       ` Jason Andryuk [this message]
2020-05-01  0:14 Pry Mar

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=CAKf6xptZyZPGL34SKMcEyMyHzqvMpqoY4fdMFaabUb45dnC4bg@mail.gmail.com \
    --to=jandryuk@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ayushdosaj2313@gmail.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).