Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
@ 2019-07-12 17:48 voidlinux-github
  2019-07-13  3:01 ` voidlinux-github
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: voidlinux-github @ 2019-07-12 17:48 UTC (permalink / raw)
  To: ml

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

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

https://github.com/void-power/void-packages kernel-elfv2
https://github.com/void-linux/void-packages/pull/13064

linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
This adds patches to build the kernel as ELFv2 binaries for big endian ppc64, just like is default for little endian. While IBM does not officially support this and the upstream is not interested in it (because of the former), it has some mainly performance benefits (on unrelated note, we build all big endian userland as ELFv2 also, which IBM does not support either, but musl requires it and glibc at least allows it).

I tested this on a Power Mac G5 as well as in a virtual machine and it seems to be working very nicely. It's also a small patch that shouldn't conflict with anything much ever and is trivlal to redo or even ditch if needed (userland ABI does not affect kernel ABI or the other way around), it also fixes the GCC 9.1 build by side effect (as `-mcall-aixdesc` is no longer necessary).

@pullmoll / @stenstorp, mind giving this a spin also? I think it's worth a try at least. From my side there's still some stuff to confirm, so consider WIP for now, though I'm not expecting any changes to be necessary.

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

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

From 52374ae0df5e37e557b24004b7d35da779fe36d2 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 12 Jul 2019 19:36:34 +0200
Subject: [PATCH 1/3] linux5.1: build ppc64 BE with ELFv2

---
 srcpkgs/linux5.1/patches/ppc64-be-elfv2.patch | 84 +++++++++++++++++++
 srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch | 28 -------
 2 files changed, 84 insertions(+), 28 deletions(-)
 create mode 100644 srcpkgs/linux5.1/patches/ppc64-be-elfv2.patch
 delete mode 100644 srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch

diff --git a/srcpkgs/linux5.1/patches/ppc64-be-elfv2.patch b/srcpkgs/linux5.1/patches/ppc64-be-elfv2.patch
new file mode 100644
index 00000000000..ec65b442bdb
--- /dev/null
+++ b/srcpkgs/linux5.1/patches/ppc64-be-elfv2.patch
@@ -0,0 +1,84 @@
+This makes the Linux kernel build as ELFv2 on big endian ppc64. The upstream
+doesn't seem to be interested in this but it's a small patch that is unlikely
+to break/easy to remake and in worst case can always be ditched.
+
+Using ELFv2 has some potential performance benefits and is already always used
+on little endian. It requires a relatively modern toolchain, which we already
+have.
+
+Ping q66 if it does not apply.
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -93,10 +93,8 @@ MULTIPLEWORD	:= -mmultiple
+ endif
+ 
+ ifdef CONFIG_PPC64
+-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mcall-aixdesc)
+-aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+-aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mabi=elfv2
++cflags-y    += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
++aflags-y    += $(call cc-option,-mabi=elfv2,$(call cc-option,-mabi=elfv1))
+ endif
+ 
+ ifndef CONFIG_CC_IS_CLANG
+@@ -144,14 +142,8 @@ endif
+ endif
+ 
+ CFLAGS-$(CONFIG_PPC64)	:= $(call cc-option,-mtraceback=no)
+-ifdef CONFIG_CPU_LITTLE_ENDIAN
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
+-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)
+-AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+-endif
++AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,$(call cc-option,-mabi=elfv1))
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mno-pointers-to-nested-functions)
+ 
+--- a/arch/powerpc/boot/Makefile
++++ b/arch/powerpc/boot/Makefile
+@@ -48,8 +48,8 @@ ifdef CONFIG_CPU_BIG_ENDIAN
+ BOOTCFLAGS	+= -mbig-endian
+ else
+ BOOTCFLAGS	+= -mlittle-endian
+-BOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
+ endif
++BOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
+ 
+ BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
+ 
+--- a/drivers/crypto/vmx/Makefile
++++ b/drivers/crypto/vmx/Makefile
+@@ -5,7 +5,7 @@ vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o aes
+ ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+ TARGET := linux-ppc64le
+ else
+-TARGET := linux-ppc64
++TARGET := linux-ppc64v2
+ endif
+ 
+ quiet_cmd_perl = PERL $@
+--- a/drivers/crypto/vmx/ppc-xlate.pl
++++ b/drivers/crypto/vmx/ppc-xlate.pl
+@@ -40,7 +40,7 @@ my $globl = sub {
+ };
+ my $text = sub {
+     my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
+-    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64le/);
++    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64(le|v2)/);
+     $ret;
+ };
+ my $machine = sub {
+@@ -142,7 +142,7 @@ my $vmr = sub {
+ 
+ # Some ABIs specify vrsave, special-purpose register #256, as reserved
+ # for system use.
+-my $no_vrsave = ($flavour =~ /linux-ppc64le/);
++my $no_vrsave = ($flavour =~ /linux-ppc64(le|v2)/);
+ my $mtspr = sub {
+     my ($f,$idx,$ra) = @_;
+     if ($idx == 256 && $no_vrsave) {
diff --git a/srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch b/srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch
deleted file mode 100644
index f168c161e6c..00000000000
--- a/srcpkgs/linux5.1/patches/ppc64-be-gcc91.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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 fceb49a9fd5af0e2c3b0f16f6283f5f19e938b99 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 12 Jul 2019 19:37:24 +0200
Subject: [PATCH 2/3] linux5.2: build ppc64 BE with ELFv2

---
 srcpkgs/linux5.2/patches/ppc64-be-elfv2.patch | 84 +++++++++++++++++++
 srcpkgs/linux5.2/patches/ppc64-be-gcc91.patch | 28 -------
 2 files changed, 84 insertions(+), 28 deletions(-)
 create mode 100644 srcpkgs/linux5.2/patches/ppc64-be-elfv2.patch
 delete mode 100644 srcpkgs/linux5.2/patches/ppc64-be-gcc91.patch

diff --git a/srcpkgs/linux5.2/patches/ppc64-be-elfv2.patch b/srcpkgs/linux5.2/patches/ppc64-be-elfv2.patch
new file mode 100644
index 00000000000..ec65b442bdb
--- /dev/null
+++ b/srcpkgs/linux5.2/patches/ppc64-be-elfv2.patch
@@ -0,0 +1,84 @@
+This makes the Linux kernel build as ELFv2 on big endian ppc64. The upstream
+doesn't seem to be interested in this but it's a small patch that is unlikely
+to break/easy to remake and in worst case can always be ditched.
+
+Using ELFv2 has some potential performance benefits and is already always used
+on little endian. It requires a relatively modern toolchain, which we already
+have.
+
+Ping q66 if it does not apply.
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -93,10 +93,8 @@ MULTIPLEWORD	:= -mmultiple
+ endif
+ 
+ ifdef CONFIG_PPC64
+-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mcall-aixdesc)
+-aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+-aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mabi=elfv2
++cflags-y    += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
++aflags-y    += $(call cc-option,-mabi=elfv2,$(call cc-option,-mabi=elfv1))
+ endif
+ 
+ ifndef CONFIG_CC_IS_CLANG
+@@ -144,14 +142,8 @@ endif
+ endif
+ 
+ CFLAGS-$(CONFIG_PPC64)	:= $(call cc-option,-mtraceback=no)
+-ifdef CONFIG_CPU_LITTLE_ENDIAN
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
+-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)
+-AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+-endif
++AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,$(call cc-option,-mabi=elfv1))
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mno-pointers-to-nested-functions)
+ 
+--- a/arch/powerpc/boot/Makefile
++++ b/arch/powerpc/boot/Makefile
+@@ -48,8 +48,8 @@ ifdef CONFIG_CPU_BIG_ENDIAN
+ BOOTCFLAGS	+= -mbig-endian
+ else
+ BOOTCFLAGS	+= -mlittle-endian
+-BOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
+ endif
++BOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
+ 
+ BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
+ 
+--- a/drivers/crypto/vmx/Makefile
++++ b/drivers/crypto/vmx/Makefile
+@@ -5,7 +5,7 @@ vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o aes
+ ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+ TARGET := linux-ppc64le
+ else
+-TARGET := linux-ppc64
++TARGET := linux-ppc64v2
+ endif
+ 
+ quiet_cmd_perl = PERL $@
+--- a/drivers/crypto/vmx/ppc-xlate.pl
++++ b/drivers/crypto/vmx/ppc-xlate.pl
+@@ -40,7 +40,7 @@ my $globl = sub {
+ };
+ my $text = sub {
+     my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
+-    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64le/);
++    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64(le|v2)/);
+     $ret;
+ };
+ my $machine = sub {
+@@ -142,7 +142,7 @@ my $vmr = sub {
+ 
+ # Some ABIs specify vrsave, special-purpose register #256, as reserved
+ # for system use.
+-my $no_vrsave = ($flavour =~ /linux-ppc64le/);
++my $no_vrsave = ($flavour =~ /linux-ppc64(le|v2)/);
+ my $mtspr = sub {
+     my ($f,$idx,$ra) = @_;
+     if ($idx == 256 && $no_vrsave) {
diff --git a/srcpkgs/linux5.2/patches/ppc64-be-gcc91.patch b/srcpkgs/linux5.2/patches/ppc64-be-gcc91.patch
deleted file mode 100644
index f168c161e6c..00000000000
--- a/srcpkgs/linux5.2/patches/ppc64-be-gcc91.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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 a60f4676506ee8acc627cd59f24d37f55fb7ef4d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 12 Jul 2019 19:37:56 +0200
Subject: [PATCH 3/3] linux4.19: build ppc64 BE with ELFv2

[ci skip]
---
 .../linux4.19/patches/ppc64-be-elfv2.patch    | 84 +++++++++++++++++++
 .../linux4.19/patches/ppc64-be-gcc91.patch    | 28 -------
 2 files changed, 84 insertions(+), 28 deletions(-)
 create mode 100644 srcpkgs/linux4.19/patches/ppc64-be-elfv2.patch
 delete mode 100644 srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch

diff --git a/srcpkgs/linux4.19/patches/ppc64-be-elfv2.patch b/srcpkgs/linux4.19/patches/ppc64-be-elfv2.patch
new file mode 100644
index 00000000000..ec65b442bdb
--- /dev/null
+++ b/srcpkgs/linux4.19/patches/ppc64-be-elfv2.patch
@@ -0,0 +1,84 @@
+This makes the Linux kernel build as ELFv2 on big endian ppc64. The upstream
+doesn't seem to be interested in this but it's a small patch that is unlikely
+to break/easy to remake and in worst case can always be ditched.
+
+Using ELFv2 has some potential performance benefits and is already always used
+on little endian. It requires a relatively modern toolchain, which we already
+have.
+
+Ping q66 if it does not apply.
+
+--- a/arch/powerpc/Makefile
++++ b/arch/powerpc/Makefile
+@@ -93,10 +93,8 @@ MULTIPLEWORD	:= -mmultiple
+ endif
+ 
+ ifdef CONFIG_PPC64
+-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+-cflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mcall-aixdesc)
+-aflags-$(CONFIG_CPU_BIG_ENDIAN)		+= $(call cc-option,-mabi=elfv1)
+-aflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -mabi=elfv2
++cflags-y    += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
++aflags-y    += $(call cc-option,-mabi=elfv2,$(call cc-option,-mabi=elfv1))
+ endif
+ 
+ ifndef CONFIG_CC_IS_CLANG
+@@ -144,14 +142,8 @@ endif
+ endif
+ 
+ CFLAGS-$(CONFIG_PPC64)	:= $(call cc-option,-mtraceback=no)
+-ifdef CONFIG_CPU_LITTLE_ENDIAN
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
+-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)
+-AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv1)
+-endif
++AFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mabi=elfv2,$(call cc-option,-mabi=elfv1))
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))
+ CFLAGS-$(CONFIG_PPC64)	+= $(call cc-option,-mno-pointers-to-nested-functions)
+ 
+--- a/arch/powerpc/boot/Makefile
++++ b/arch/powerpc/boot/Makefile
+@@ -48,8 +48,8 @@ ifdef CONFIG_CPU_BIG_ENDIAN
+ BOOTCFLAGS	+= -mbig-endian
+ else
+ BOOTCFLAGS	+= -mlittle-endian
+-BOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
+ endif
++BOOTCFLAGS	+= $(call cc-option,-mabi=elfv2)
+ 
+ BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
+ 
+--- a/drivers/crypto/vmx/Makefile
++++ b/drivers/crypto/vmx/Makefile
+@@ -5,7 +5,7 @@ vmx-crypto-objs := vmx.o aesp8-ppc.o ghashp8-ppc.o aes.o aes_cbc.o aes_ctr.o aes
+ ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
+ TARGET := linux-ppc64le
+ else
+-TARGET := linux-ppc64
++TARGET := linux-ppc64v2
+ endif
+ 
+ quiet_cmd_perl = PERL $@
+--- a/drivers/crypto/vmx/ppc-xlate.pl
++++ b/drivers/crypto/vmx/ppc-xlate.pl
+@@ -40,7 +40,7 @@ my $globl = sub {
+ };
+ my $text = sub {
+     my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
+-    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64le/);
++    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64(le|v2)/);
+     $ret;
+ };
+ my $machine = sub {
+@@ -142,7 +142,7 @@ my $vmr = sub {
+ 
+ # Some ABIs specify vrsave, special-purpose register #256, as reserved
+ # for system use.
+-my $no_vrsave = ($flavour =~ /linux-ppc64le/);
++my $no_vrsave = ($flavour =~ /linux-ppc64(le|v2)/);
+ my $mtspr = sub {
+     my ($f,$idx,$ra) = @_;
+     if ($idx == 256 && $no_vrsave) {
diff --git a/srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch b/srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch
deleted file mode 100644
index f168c161e6c..00000000000
--- a/srcpkgs/linux4.19/patches/ppc64-be-gcc91.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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))

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

* Re: linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
  2019-07-12 17:48 [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian voidlinux-github
@ 2019-07-13  3:01 ` voidlinux-github
  2019-07-13  4:05 ` voidlinux-github
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-07-13  3:01 UTC (permalink / raw)
  To: ml

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

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/13064#issuecomment-511082255
Comment:
I'm going to test this on my G5 as well.

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

* Re: linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
  2019-07-12 17:48 [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian voidlinux-github
  2019-07-13  3:01 ` voidlinux-github
@ 2019-07-13  4:05 ` voidlinux-github
  2019-07-13  4:29 ` voidlinux-github
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-07-13  4:05 UTC (permalink / raw)
  To: ml

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

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/13064#issuecomment-511086121
Comment:
Oh yes, this seems to make a **big** difference from my impression. Tested `ppc64` with kernel `5.2.0`.
The system startup feels like it is twice as fast (or not slow) as before. Running an update with `xi -u` also went noticeably faster, also for the `dracut` + `grub` updates.

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

* Re: linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
  2019-07-12 17:48 [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian voidlinux-github
  2019-07-13  3:01 ` voidlinux-github
  2019-07-13  4:05 ` voidlinux-github
@ 2019-07-13  4:29 ` voidlinux-github
  2019-07-13  7:19 ` [PR PATCH] [Merged]: " voidlinux-github
  2019-07-13 13:27 ` voidlinux-github
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-07-13  4:29 UTC (permalink / raw)
  To: ml

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

New comment by pullmoll on void-packages repository

https://github.com/void-linux/void-packages/pull/13064#issuecomment-511086121
Comment:
Oh yes, this seems to make a **big** difference from my impression. Tested `ppc64` with kernel `5.2.0`.
The system startup feels like it is twice as fast (or not slow) as before. Running an update with `xi -u` also went noticeably faster, also for the `dracut` + `grub` updates.

Edit: Actually the huge difference was because I removed `page_poison=1` from the `/etc/default/grub` command line for ppc64-glibc and only this time saw the effects. This is because I have two systems, glibc and musl, on one HDD and two times `/boot/grub` on the root partitions. So it takes two rounds of `update-grub`, on on each arch, to make any changes effective.

So on an unrelated note: If you want some more speed, disable page poisoning on the Linux command line.

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

* Re: [PR PATCH] [Merged]: linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
  2019-07-12 17:48 [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian voidlinux-github
                   ` (2 preceding siblings ...)
  2019-07-13  4:29 ` voidlinux-github
@ 2019-07-13  7:19 ` voidlinux-github
  2019-07-13 13:27 ` voidlinux-github
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-07-13  7:19 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
https://github.com/void-linux/void-packages/pull/13064
Description: This adds patches to build the kernel as ELFv2 binaries for big endian ppc64, just like is default for little endian. While IBM does not officially support this and the upstream is not interested in it (because of the former), it has some mainly performance benefits (on unrelated note, we build all big endian userland as ELFv2 also, which IBM does not support either, but musl requires it and glibc at least allows it).

I tested this on a Power Mac G5 as well as in a virtual machine and it seems to be working very nicely. It's also a small patch that shouldn't conflict with anything much ever and is trivlal to redo or even ditch if needed (userland ABI does not affect kernel ABI or the other way around), it also fixes the GCC 9.1 build by side effect (as `-mcall-aixdesc` is no longer necessary).

@pullmoll / @stenstorp, mind giving this a spin also? I think it's worth a try at least. From my side there's still some stuff to confirm, so consider WIP for now, though I'm not expecting any changes to be necessary.

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

* Re: linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian
  2019-07-12 17:48 [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian voidlinux-github
                   ` (3 preceding siblings ...)
  2019-07-13  7:19 ` [PR PATCH] [Merged]: " voidlinux-github
@ 2019-07-13 13:27 ` voidlinux-github
  4 siblings, 0 replies; 6+ messages in thread
From: voidlinux-github @ 2019-07-13 13:27 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/13064#issuecomment-511122136
Comment:
Yeah, ELFv2 itself shouldn't make a massive difference, but some is better than none, especially if we can have it basically for free. Also, I wasn't expecting that to get merged right now, but whatever, I wasn't planning to do any more changes in it anyway, so might as well give it a try.

Btw, I'll also be switching the default page size from 64kB to 4kB. This should also make some difference on older hardware (G5 doesn't support 64k pages in hardware, so the kernel emulates them, first to support 64k is POWER8), I had some concerns about stuff that hardcodes 64k pages for ppc64 (like webengine, but turns out it just wastes a bit more memory without causing any harm) and also about running VM guests with 64k page size on 4k page hosts, and ext4 filesystems being incompatible, but I'm testing a 4k page kernel here right now and everything seems to be working.

Most distros take the choice of using 64kB pages on ppc64le nowadays, but there are few workloads that can benefit from it (and they're restricted exclusively to servers) and both page sizes are supported in hardware even on modern stuff, so I'll go with the more practical/compatible with the rest of the world option :) I never liked big default pages myself (here I agree with Linus Torvalds, who wrote a post on why default pages above 4kB are stupid), and if we can do away with them, that's for the best (makes guard pages practical again, besides other reasons...)

People who want 64k can compile their own kernel.

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

end of thread, other threads:[~2019-07-13 13:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12 17:48 [PR PATCH] linux4.19/5.1/5.2: build with ELFv2 ABI on ppc64 big endian voidlinux-github
2019-07-13  3:01 ` voidlinux-github
2019-07-13  4:05 ` voidlinux-github
2019-07-13  4:29 ` voidlinux-github
2019-07-13  7:19 ` [PR PATCH] [Merged]: " voidlinux-github
2019-07-13 13:27 ` voidlinux-github

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).