Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] add patches to fix kernels on ppc64 BE with gcc9
Date: Fri, 05 Jul 2019 02:24:50 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-12815@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-power/void-packages linux
https://github.com/void-linux/void-packages/pull/12815

add patches to fix kernels on ppc64 BE with gcc9
See the comment in the patches for rationale. This will be reported and hopefully fixed upstream, for now we need a workaround, this one is fortunately pretty simple.

A patch file from https://github.com/void-linux/void-packages/pull/12815.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-linux-12815.patch --]
[-- Type: application/text/x-diff, Size: 3996 bytes --]

From d18e1cceb160238c34806efa5ff817e58618fb1c Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Thu, 4 Jul 2019 21:28:30 +0200
Subject: [PATCH 1/2] linux4.19: add patch to unbreak build on big-endian ppc64
 + gcc9

---
 .../linux4.19/patches/ppc64-be-gcc91.patch    | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch

diff --git a/srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch b/srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch
new file mode 100644
index 00000000000..f168c161e6c
--- /dev/null
+++ b/srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch
@@ -0,0 +1,28 @@
+Since gcc 9.1, adding `-mcall-aixdesc` to cflags makes it no longer define
+`__linux__`, which breaks compilation of the kernel in places where the macro
+is checked (which is multiple). This behavior is actually more correct than
+it was before, as `-mcall-aixdesc` is only meant to be used when compiling
+for AIX.
+
+However, it is not enough to just drop it and use `-mabi=elfv1`, as that
+results in a ton of undefined references all over the place when linking.
+So work around it until upstream sorts it out.
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -96,6 +96,7 @@ endif
+ ifdef CONFIG_PPC64
+ cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+ cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mcall-aixdesc)
++cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= -D__linux__
+ aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+ aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mabi=elfv2
+ endif
+@@ -151,6 +152,7 @@ AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2)
+ else
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcall-aixdesc)
++CFLAGS-$(CONFIG_PPC64)	+= -D__linux__
+ AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+ endif
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))

From c45211b5e00a363a3cc1a6986234db11e4e0ea67 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Thu, 4 Jul 2019 21:28:54 +0200
Subject: [PATCH 2/2] linux5.1: add patch to unbreak build on big-endian ppc64
 + gcc9

[ci skip]
---
 srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch

diff --git a/srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch b/srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch
new file mode 100644
index 00000000000..f168c161e6c
--- /dev/null
+++ b/srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch
@@ -0,0 +1,28 @@
+Since gcc 9.1, adding `-mcall-aixdesc` to cflags makes it no longer define
+`__linux__`, which breaks compilation of the kernel in places where the macro
+is checked (which is multiple). This behavior is actually more correct than
+it was before, as `-mcall-aixdesc` is only meant to be used when compiling
+for AIX.
+
+However, it is not enough to just drop it and use `-mabi=elfv1`, as that
+results in a ton of undefined references all over the place when linking.
+So work around it until upstream sorts it out.
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -96,6 +96,7 @@ endif
+ ifdef CONFIG_PPC64
+ cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+ cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mcall-aixdesc)
++cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= -D__linux__
+ aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+ aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mabi=elfv2
+ endif
+@@ -151,6 +152,7 @@ AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2)
+ else
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcall-aixdesc)
++CFLAGS-$(CONFIG_PPC64)	+= -D__linux__
+ AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+ endif
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))

             reply	other threads:[~2019-07-05  0:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05  0:24 voidlinux-github [this message]
2019-07-05  6:29 ` [PR PATCH] [Merged]: " voidlinux-github

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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-12815@inbox.vuxu.org \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.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).