All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/qemu: fix host-qemu compilation with recent GCC
@ 2022-04-06 21:10 Dario Binacchi via buildroot
  2022-04-14 19:34 ` Arnout Vandecappelle
  2022-04-26 20:49 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Dario Binacchi via buildroot @ 2022-04-06 21:10 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Dario Binacchi, Dario Binacchi

Fixes:
cc1: error: ‘-fcf-protection’ is not compatible with this target

The new Ubuntu GCC packages (e.g. Ubuntu 11.2.0-7ubuntu2, 11.2.0) turn
on ‘-fcf-protection’ globally, which causes a build failure in the x86
realmode code. Turn it off explicitly on compilers that understand this
option.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 ...able-fcf-protection-on-march-486-m16.patch | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch

diff --git a/package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch b/package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch
new file mode 100644
index 0000000000..7a841fcb60
--- /dev/null
+++ b/package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch
@@ -0,0 +1,49 @@
+From 9584d3d00a454f47b0341465142bcf0735d734ae Mon Sep 17 00:00:00 2001
+From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
+Date: Wed, 23 Mar 2022 10:07:13 +0100
+Subject: [PATCH] build: disable fcf-protection on -march=486 -m16
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some of the roms build with -march=i486 -m16 which is incompatible
+with -fcf-protection. That in turn is can be set by default, for
+example in Ubuntu [1].
+That causes:
+ cc1: error: ‘-fcf-protection’ is not compatible with this target
+
+This won't work on -march=i486 -m16 and no matter if set or not we can
+override it to "none" if the option is known to the compiler to be
+able to build reliably.
+
+Fixes: https://gitlab.com/qemu-project/qemu/-/issues/889
+
+[1]: https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-fcf-protection
+
+Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
+Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
+Reviewed-by: Thomas Huth <thuth@redhat.com>
+Message-Id: <20220323090713.1002588-1-christian.ehrhardt@canonical.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+ pc-bios/optionrom/Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
+index 5d55d25acca2..f1ef89807355 100644
+--- a/pc-bios/optionrom/Makefile
++++ b/pc-bios/optionrom/Makefile
+@@ -14,6 +14,10 @@ cc-option = $(if $(shell $(CC) $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1
+ 
+ override CFLAGS += -march=i486 -Wall
+ 
++# If -fcf-protection is enabled in flags or compiler defaults that will
++# conflict with -march=i486
++override CFLAGS += $(call cc-option, -fcf-protection=none)
++
+ # Flags for dependency generation
+ override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
+ 
+-- 
+2.32.0
+
-- 
2.17.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/qemu: fix host-qemu compilation with recent GCC
  2022-04-06 21:10 [Buildroot] [PATCH 1/1] package/qemu: fix host-qemu compilation with recent GCC Dario Binacchi via buildroot
@ 2022-04-14 19:34 ` Arnout Vandecappelle
  2022-04-26 20:49 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-04-14 19:34 UTC (permalink / raw)
  To: Dario Binacchi, buildroot; +Cc: Romain Naour, Dario Binacchi



On 06/04/2022 23:10, Dario Binacchi via buildroot wrote:
> Fixes:
> cc1: error: ‘-fcf-protection’ is not compatible with this target
> 
> The new Ubuntu GCC packages (e.g. Ubuntu 11.2.0-7ubuntu2, 11.2.0) turn
> on ‘-fcf-protection’ globally, which causes a build failure in the x86
> realmode code. Turn it off explicitly on compilers that understand this
> option.
> 
> Signed-off-by: Dario Binacchi <dariobin@libero.it>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

  Two Sob is a bit exaggerated :-)

> ---
>   ...able-fcf-protection-on-march-486-m16.patch | 49 +++++++++++++++++++
>   1 file changed, 49 insertions(+)
>   create mode 100644 package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch
> 
> diff --git a/package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch b/package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch
> new file mode 100644
> index 0000000000..7a841fcb60
> --- /dev/null
> +++ b/package/qemu/0002-build-disable-fcf-protection-on-march-486-m16.patch
> @@ -0,0 +1,49 @@
> +From 9584d3d00a454f47b0341465142bcf0735d734ae Mon Sep 17 00:00:00 2001
> +From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> +Date: Wed, 23 Mar 2022 10:07:13 +0100
> +Subject: [PATCH] build: disable fcf-protection on -march=486 -m16
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Some of the roms build with -march=i486 -m16 which is incompatible
> +with -fcf-protection. That in turn is can be set by default, for
> +example in Ubuntu [1].
> +That causes:
> + cc1: error: ‘-fcf-protection’ is not compatible with this target
> +
> +This won't work on -march=i486 -m16 and no matter if set or not we can
> +override it to "none" if the option is known to the compiler to be
> +able to build reliably.
> +
> +Fixes: https://gitlab.com/qemu-project/qemu/-/issues/889
> +
> +[1]: https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-fcf-protection
> +
> +Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> +Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> +Reviewed-by: Thomas Huth <thuth@redhat.com>
> +Message-Id: <20220323090713.1002588-1-christian.ehrhardt@canonical.com>
> +Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

  And here your Sob was missing! I took the liberty of adding it.

  Applied to master, thanks.

  Regards,
  Arnout

> +---
> + pc-bios/optionrom/Makefile | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
> +index 5d55d25acca2..f1ef89807355 100644
> +--- a/pc-bios/optionrom/Makefile
> ++++ b/pc-bios/optionrom/Makefile
> +@@ -14,6 +14,10 @@ cc-option = $(if $(shell $(CC) $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1
> +
> + override CFLAGS += -march=i486 -Wall
> +
> ++# If -fcf-protection is enabled in flags or compiler defaults that will
> ++# conflict with -march=i486
> ++override CFLAGS += $(call cc-option, -fcf-protection=none)
> ++
> + # Flags for dependency generation
> + override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
> +
> +--
> +2.32.0
> +
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/qemu: fix host-qemu compilation with recent GCC
  2022-04-06 21:10 [Buildroot] [PATCH 1/1] package/qemu: fix host-qemu compilation with recent GCC Dario Binacchi via buildroot
  2022-04-14 19:34 ` Arnout Vandecappelle
@ 2022-04-26 20:49 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-04-26 20:49 UTC (permalink / raw)
  To: Dario Binacchi via buildroot; +Cc: Romain Naour, Dario Binacchi, Dario Binacchi

>>>>> "Dario" == Dario Binacchi via buildroot <buildroot@buildroot.org> writes:

 > Fixes:
 > cc1: error: ‘-fcf-protection’ is not compatible with this target

 > The new Ubuntu GCC packages (e.g. Ubuntu 11.2.0-7ubuntu2, 11.2.0) turn
 > on ‘-fcf-protection’ globally, which causes a build failure in the x86
 > realmode code. Turn it off explicitly on compilers that understand this
 > option.

 > Signed-off-by: Dario Binacchi <dariobin@libero.it>
 > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Committed to 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-26 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06 21:10 [Buildroot] [PATCH 1/1] package/qemu: fix host-qemu compilation with recent GCC Dario Binacchi via buildroot
2022-04-14 19:34 ` Arnout Vandecappelle
2022-04-26 20:49 ` Peter Korsgaard

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.