From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-23 13:02:26
I was building BookE and big endian with a little endian cross
compiler and it stopped working. My BookS BE tests must have been
building using the ELFv2 ABI. After this, the build sometimes still
strangely fails with dot symbols in syscall table unable to be found,
but that's looking like it may be a linker bug (Alan is going to take
a look).
Thanks,
Nick
Nicholas Piggin (3):
powerpc/64e: convert cmpi to cmpwi in head_64.S
powerpc: allow compilation on cross-endian toolchain
powerpc/64e: don't branch to dot symbols
arch/powerpc/Makefile | 6 ++++++
arch/powerpc/boot/Makefile | 1 +
arch/powerpc/kernel/exceptions-64e.S | 6 +++---
arch/powerpc/kernel/head_64.S | 8 ++++----
4 files changed, 14 insertions(+), 7 deletions(-)
--
2.10.2
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-23 13:02:31
From 80f23935cadb ("powerpc: Convert cmp to cmpd in idle enter sequence"):
PowerPC's "cmp" instruction has four operands. Normally people write
"cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently
people forget, and write "cmp" with just three operands.
With older binutils this is silently accepted as if this was "cmpw",
while often "cmpd" is wanted. With newer binutils GAS will complain
about this for 64-bit code. For 32-bit code it still silently assumes
"cmpw" is what is meant.
In this instance the code comes directly from ISA v2.07, including the
cmp, but cmpd is correct. Backport to stable so that new toolchains can
build old kernels.
In this case, cmpwi is called for, so this is just a build fix for
new toolchians.
Stable: v3.0
Cc: Segher Boessenkool <redacted>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/head_64.S | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-23 13:02:34
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
generate powerpc64 code
The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds abi
annotations together with endianness.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/Makefile | 6 ++++++
arch/powerpc/boot/Makefile | 1 +
2 files changed, 7 insertions(+)
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-23 13:02:37
This converts one that was missed by b1576fec7f4d ("powerpc: No need
to use dot symbols when branching to a function").
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/exceptions-64e.S | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Alan Modra <hidden> Date: 2016-11-23 23:03:27
On Thu, Nov 24, 2016 at 12:02:06AM +1100, Nicholas Piggin wrote:
I was building BookE and big endian with a little endian cross
compiler and it stopped working. My BookS BE tests must have been
building using the ELFv2 ABI. After this, the build sometimes still
strangely fails with dot symbols in syscall table unable to be found,
but that's looking like it may be a linker bug (Alan is going to take
a look).
Yes it is a bug. In compatibility code that was supposed to handle
mixing old object files that use dot-symbols on function entry with
newer object files that don't. Here, "old" means mid 2004 or
earlier.
As you can imagine, I'm not hugely concerned about the ld bug..
Since every binutils back to at least 2.17 has the bug, what changed
in the kernel to expose it? Are you building without -mcall-aixdesc?
--
Alan Modra
Australia Development Lab, IBM
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-24 01:04:55
On Thu, 24 Nov 2016 09:33:20 +1030
Alan Modra [off-list ref] wrote:
On Thu, Nov 24, 2016 at 12:02:06AM +1100, Nicholas Piggin wrote:
quoted
I was building BookE and big endian with a little endian cross
compiler and it stopped working. My BookS BE tests must have been
building using the ELFv2 ABI. After this, the build sometimes still
strangely fails with dot symbols in syscall table unable to be found,
but that's looking like it may be a linker bug (Alan is going to take
a look).
Yes it is a bug. In compatibility code that was supposed to handle
mixing old object files that use dot-symbols on function entry with
newer object files that don't. Here, "old" means mid 2004 or
earlier.
As you can imagine, I'm not hugely concerned about the ld bug..
Since every binutils back to at least 2.17 has the bug, what changed
in the kernel to expose it? Are you building without -mcall-aixdesc?
Yeah, it's my attempt to get powerpc64le compiler to build big endian
with -mabi=elfv2, so I'd have missed -mcall-aixdesc somewhere.
Thanks,
Nick
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-24 09:04:35
On Thu, 24 Nov 2016 00:02:08 +1100
Nicholas Piggin [off-list ref] wrote:
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
Okay I was missing mcall-aixdesc, thanks again to Alan for pointing
it out.
This updated patch seems to do better, and it builds BE kernel with
powerpc64le-gcc, and LE with powerpc64-gcc here (I did see a link
failure but then couldn't reproduce it so it might have been a stale
file hanging around somewhere).
From: Nicholas Piggin <npiggin@gmail.com>
Date: Wed, 23 Nov 2016 17:27:39 +1100
Subject: [PATCH] powerpc: allow compilation on cross-endian toolchain
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
generate powerpc64 code
The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
annotations together with endianness. The kernel with ELFv2 ABI
also uses -mcall-aixdesc, but boot/ does not.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/Makefile | 7 +++++++
arch/powerpc/boot/Makefile | 1 +
2 files changed, 8 insertions(+)
From: Nicholas Piggin <npiggin@gmail.com> Date: 2016-11-26 03:00:19
On Thu, 24 Nov 2016 20:04:23 +1100
Nicholas Piggin [off-list ref] wrote:
On Thu, 24 Nov 2016 00:02:08 +1100
Nicholas Piggin [off-list ref] wrote:
quoted
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
Okay I was missing mcall-aixdesc, thanks again to Alan for pointing
it out.
Final patch here which just slightly changes how the boot code flags
are set (don't introduce unnecessary setting of elfv1 on 32-bit builds).
--
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
generate powerpc64 code
The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
annotations together with endianness. The kernel with ELFv2 ABI
also uses -mcall-aixdesc, but boot/ does not.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/Makefile | 7 +++++++
arch/powerpc/boot/Makefile | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
Yes, I forgot 32-bit will pick those up. 3rd time's a charm, this compiles
64 bit be/le and 32-bit now.
--
Subject: [PATCH] powerpc: allow compilation on cross-endian toolchain
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
generate powerpc64 code
The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
annotations together with endianness. The kernel with ELFv2 ABI
also uses -mcall-aixdesc, but boot/ does not.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/Makefile | 11 ++++++++++-
arch/powerpc/boot/Makefile | 4 +++-
2 files changed, 13 insertions(+), 2 deletions(-)
From: Michael Ellerman <hidden> Date: 2016-11-29 12:58:11
On Wed, 2016-11-23 at 13:02:07 UTC, Nicholas Piggin wrote:
quoted
From 80f23935cadb ("powerpc: Convert cmp to cmpd in idle enter sequence"):
PowerPC's "cmp" instruction has four operands. Normally people write
"cmpw" or "cmpd" for the second cmp operand 0 or 1. But, frequently
people forget, and write "cmp" with just three operands.
With older binutils this is silently accepted as if this was "cmpw",
while often "cmpd" is wanted. With newer binutils GAS will complain
about this for 64-bit code. For 32-bit code it still silently assumes
"cmpw" is what is meant.
In this instance the code comes directly from ISA v2.07, including the
cmp, but cmpd is correct. Backport to stable so that new toolchains can
build old kernels.
In this case, cmpwi is called for, so this is just a build fix for
new toolchians.
Stable: v3.0
Cc: Segher Boessenkool <redacted>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
From: Michael Ellerman <hidden> Date: 2016-11-29 12:58:15
On Wed, 2016-11-23 at 13:02:09 UTC, Nicholas Piggin wrote:
This converts one that was missed by b1576fec7f4d ("powerpc: No need
to use dot symbols when branching to a function").
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Yes, I forgot 32-bit will pick those up. 3rd time's a charm, this compiles
64 bit be/le and 32-bit now.
--
Subject: [PATCH] powerpc: allow compilation on cross-endian toolchain
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
generate powerpc64 code
The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
annotations together with endianness. The kernel with ELFv2 ABI
also uses -mcall-aixdesc, but boot/ does not.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
FWIW, this fixes the issue with vmx build when doing a BE build with LE
toolchain:
/tmp/ccR5lr0U.s: Error: .size expression for aes_p8_set_encrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for .aes_p8_set_encrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for aes_p8_set_decrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for .aes_p8_set_decrypt_key does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for aes_p8_encrypt does not evaluate to a constant
/tmp/ccR5lr0U.s: Error: .size expression for .aes_p8_encrypt does not evaluate to a constant
Tested-by: Naveen N. Rao <redacted>
Thanks,
Naveen
From: Michael Ellerman <hidden> Date: 2017-03-08 07:25:46
On Sun, 2016-11-27 at 02:46:20 UTC, Nicholas Piggin wrote:
Subject: [PATCH] powerpc: allow compilation on cross-endian toolchain
GCC can compile with either endian, but the ABI version always
defaults to the default endian. Alan Modra says:
you need both -mbig and -mabi=elfv1 to make a powerpc64le gcc
generate powerpc64 code
The opposite is true for powerpc64 when generating -mlittle it
requires -mabi=elfv2 to generate v2 ABI. This change adds ABI
annotations together with endianness. The kernel with ELFv2 ABI
also uses -mcall-aixdesc, but boot/ does not.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>