regression with binutils 2.28 for ppc
Alan Modra
amodra@gmail.com
Fri Feb 18 01:34:20 GMT 2022
On Thu, Feb 17, 2022 at 02:03:24PM -0600, Peter Bergner wrote:
> On 2/17/22 3:28 AM, Waldemar Brodkorb wrote:
> > -mcpu=powerpc -mbig-endian -m32 -msoft-float -mcpu=powerpc64 -mno-altivec -mno-vsx
>
> So a 32-bit compile, which is why the assembler complains about ptesync.
Not from what you posted there. The last -mcpu=powerpc64 ought to
enable ppc64. If you remove that, then yes, you'll get a complaint
about ptesync.
> You could try adding -Wa,-mppc64 or -Wa,-many to your options as a work around.
> Newish GCCs removed passing -many to the assembler and the commit you
> mentioned changed handling of sticky cpu options which is exposing the
> issue.
-Wa cpu hacks won't work any more. gcc emits a .machine directive
early in the assembly output that will override them. I think that
early .machine is just plain wrong. .machine ought to only be emitted
by gcc to handle something like a pragma or attribute changing code
generation. That's the only compromise I can see to satisfy the
disparate users of the toolchain. On the one hand you have developers
who'd like an error when they accidentally use the wrong assembly (and
gcc developers who'd rather not find out gcc is emitting invalid
instructions by user reports of crashes!), and on the other hand you
have kernel delelopers who need to write code supporting a whole range
of cpus who just want the assembler to accept anything.
> The use of those ptesyncs in the kernel really needs to be audited though!
> If they are legitimate, then the inline assembler needs to wrap their
> use with ".machine push ; .machine ppc64 ; ptesync ; .machine pop".
Right. Or we should allow the user command line to control the
assembler, even with -Wa,-many if they so desire. But that's killed
by that stupid .machine from gcc.
I didn't even get as far as Waldemar. With recent gcc, binutils and
linux git source my
ARCH=powerpc CROSS_COMPILE=powerpc-linux- pmac32_defconfig
kernel compile bombs here:
powerpc-linux-gcc -Wp,-MMD,arch/powerpc/kernel/ptrace/.ptrace.o.d -nostdinc -I./arch/powerpc/include -I./arch/powerpc/include/generated -I./include -I./arch/powerpc/include/uapi -I./arch/powerpc/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -I ./arch/powerpc -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mcpu=powerpc -mcpu=powerpc -mbig-endian -m32 -msoft-float -pipe -ffixed-r2 -mmultiple -mno-readonly-in-sdata -mcpu=powerpc64 -mno-altivec -mno-vsx -fno-asynchronous-unwind-tables -mno-string -Wa,-maltivec -mbig-endian -mstack-protector-guard=tls -mstack-protector-guard-reg=r2 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=1024 -fstack-protector-strong -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -ftrivial-auto-var-init=zero -fno-stack-clash-protection -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -mstack-protector-guard-offset=576 -Werror -DKBUILD_MODFILE='"arch/powerpc/kernel/ptrace/ptrace"' -DKBUILD_BASENAME='"ptrace"' -DKBUILD_MODNAME='"ptrace"' -D__KBUILD_MODNAME=kmod_ptrace -c -o arch/powerpc/kernel/ptrace/ptrace.o arch/powerpc/kernel/ptrace/ptrace.c
{standard input}: Assembler messages:
{standard input}:997: Error: unrecognized opcode: `mfsrin'
{standard input}:1003: Error: unrecognized opcode: `mtsrin'
{standard input}:1028: Error: unrecognized opcode: `mfsrin'
{standard input}:1034: Error: unrecognized opcode: `mtsrin'
{standard input}:1061: Error: unrecognized opcode: `mfsrin'
{standard input}:1067: Error: unrecognized opcode: `mtsrin'
make[3]: *** [scripts/Makefile.build:288: arch/powerpc/kernel/ptrace/ptrace.o] Error 1
So, last -mcpu is powerpc64. gas quite correctly flags an error on
instructions phased out for ppc64.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list