[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Kernel build fails



I sent a mail fixing this a few days ago, but I didn't finalize the patch according to suggestions, my finger broke. 

The thread :



Le 11/01/2022 à 10:32, Mike a écrit :
> I managed to fix it in the end, patch attached, though i should have
> done a $(call cc-option-, -maltivec, -mabi=altivec) in the
> arch/powerpc/mm/Makefile
>   I wrongly assumed that the manual i had downloaded at 4.44am was for
> 32bit ppc only and found ptesync to be ppc64 only.
>
> binutils-2.37.50 - GNU assembler version 2.37.50 (powerpc-linux-gnu)
> using BFD version (GNU Binutils for Debian) 2.37.50.20220106
> gcc version 11.2.0 (Debian 11.2.0-13)
> ld.lld is missing but with LLVM/CLANG and LD=ld.bfd
> arch/powerpc/kernel/vdso32/gettimeofday.S:72:8:
> error: unsupported directive '.stabs'    .stabs
> "_restgpr_31_x:F-1",36,0,0,_restgpr_31_x; .globl _restgpr_31_x;
> _restgpr_31_x:
>
> Attached the config i'm using, and the debian config 5.15.0-2. It's
> still building.

Ok, I tried with your config on my Fedora Core 35 where I have:

powerpc64-linux-gnu-gcc (GCC) 11.2.1 20210728 (Red Hat Cross 11.2.1-1)
GNU ld version 2.37-3.fc35

 From packages:
- binutils-powerpc64-linux-gnu-2.37-3.fc35.x86_64
- gcc-powerpc64-linux-gnu-11.2.1-1.fc35.x86_64

And I don't have the problems you mention, so it must be something
special with Debian GCC.


Your change regarding ptesync is probably OK but is fragile I think,
because for instance there is also a 'ptesync' in
arch/powerpc/mm/pageattr.c and probably many other places.

Also please prefer CONFIG_PPC64 to __powerpc64__

Regarding the DSSALL issue, the following commit will probably help:

d51f86cfd8e3 ("powerpc/mm: Switch obsolete dssall to .long")

Regarding the .stabs with LLVM there is a patch at
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/68932ec2ba6b868d35006b96e90f0890f3da3c05.1638273868.git.christophe.leroy@csgroup.eu/

Thanks

Christophe

-Michael

On Wed, Jan 19, 2022, 21:54 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
Hello!

On 1/19/22 14:35, Elimar Riesebieter wrote:
> kernel build fails on powerpc 32bit no matter what version is used
> (5.14-5.16):
>
> {standard input}: Assembler messages:
>   {standard input}:29: Error: unrecognized opcode: `dssall'
>   make[5]: *** [scripts/Makefile.build:271: arch/powerpc/mm/mmu_context.o] Error 1
>   make[4]: *** [scripts/Makefile.build:514: arch/powerpc/mm] Error 2
>   make[3]: *** [Makefile:1861: arch/powerpc] Error 2
>   make[2]: *** [debian/rules:7: build-arch] Error 2
>
> I assume the latest binutils (2.37.50.20220106-2) don't work
> properly. Anyone made the same experience?

This issue shows on the buildds now as well:

> https://buildd.debian.org/status/fetch.php?pkg=linux&arch=powerpc&ver=5.15.15-1&stamp=1642579068&raw=0
> https://buildd.debian.org/status/fetch.php?pkg=linux&arch=ppc64&ver=5.15.15-1&stamp=1642578946&raw=0

I will report it upstream now.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Author: threader <michael.heltne@gmail.com>
Date:   Tue Jan 11 06:28:27 2022 +0100

    arch: powerpc: fix building, 'dssall' in mmu_context.c is an altivec instruction, so build that acoordingly if such is the case. 'ptesync' is a PPC64 instruction, so dont go there for ppc32
    
            Signed-off-by: Micahel B Heltne <michael.heltne@gmail.com>

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 86f49e3e7cf5..ac8c2d591636 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -3267,9 +3267,11 @@ void emulate_update_regs(struct pt_regs *regs, struct instruction_op *op)
                case BARRIER_LWSYNC:
                        asm volatile("lwsync" : : : "memory");
                        break;
+#ifdef __powerpc64__
                case BARRIER_PTESYNC:
                        asm volatile("ptesync" : : : "memory");
                        break;
+#endif
                }
                break;
 
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index df8172da2301..2775b56a77cb 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -4,6 +4,9 @@
 #
 
 ccflags-$(CONFIG_PPC64)        := $(NO_MINIMAL_TOC)
+ifeq ($(CONFIG_ALTIVEC),y)
+CFLAGS_mmu_context.o += -maltivec
+endif
 
 obj-y                          := fault.o mem.o pgtable.o mmap.o maccess.o pageattr.o \
                                   init_$(BITS).o pgtable_$(BITS).o \

Reply to: