Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-25 Thread Aurelien Jarno
On 2022-01-25 19:04, Vagrant Cascadian wrote:
> On 2022-01-25, Vagrant Cascadian wrote:
> > On 2022-01-15, Aurelien Jarno wrote:
> >> On 2022-01-11 16:40, Vagrant Cascadian wrote:
> >>> On 2022-01-11, Lennart Sorensen wrote:
> >>> > On Mon, Jan 10, 2022 at 05:10:04PM -0800, Vagrant Cascadian wrote:
> >>> >> Something in the toolchain recently changed which causes u-boot 
> >>> >> arch:all
> >>> >> build to FTBFS... I suspect binutils, as building in "bookworm" still
> >>> >> works fine where binutils hasn't yet migrated.
> >>> >> 
> >>> >> On arch:all builds the qemu-ppce500 target is cross-compiled.
> >>> >> 
> >>> >> Full log:
> >>> >> 
> >>> >>   
> >>> >> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
> >>> >> 
> >>> >> The hopefully relevent lines from the build log:
> ...
> >>> >> {standard input}: Assembler messages:
> >>> >> {standard input}:127: Error: unrecognized opcode: `tlbre'
> >>> >> {standard input}:418: Error: unrecognized opcode: `tlbre'
> >>> >> {standard input}:821: Error: unrecognized opcode: `msync'
> >>> >> {standard input}:821: Error: unrecognized opcode: `tlbwe'
> >>> >> {standard input}:884: Error: unrecognized opcode: `tlbsx'
> >>> >> make[4]: *** [/<>/scripts/Makefile.build:253: 
> >>> >> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
> >>> >> make[3]: *** [/<>/Makefile:1810: 
> >>> >> arch/powerpc/cpu/mpc85xx] Error 2
> >>> >> make[3]: *** Waiting for unfinished jobs
> >>> >>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
> > ...
> >>> The binutils versions appear to be:
> >>> 
> >>>   succeeding, bookworm 2.37-10.1
> >>>   failing, sid 2.37.50.20220106-2
> >>> 
> >>
> >> Yep, this is due to commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a on
> >> the binutils side [1], which changes the behavior of `.machine`
> >> directives to override, rather than augment, the base CPU. GCC is called
> >> with -Wa,-me500 to enable PowerPC e500 instructions on the assembler
> >> side, but as the default GCC machine is ppc, a `.set machine ppc` is
> >> emitted at the beginning of the assembly code.
> >>
> >> One option would be to force the CPU to e500 on the GCC side, however
> >> support for it has been removed. The options is therefore to force the
> >> machine in the assembly code. This is what the attached patch does.
> >
> > Somehow I missed that you had attached a patch! I will try to get this
> > tested and uploaded to Debian soon...
> 
> Your patch fixed building qemu-ppce500, but now I think we have a
> potentially similar problem with qemu-riscv64 and qemu-riscv64_smode:
> 
> /<>/arch/riscv/cpu/cpu.c: Assembler messages:
> /<>/arch/riscv/cpu/cpu.c:94: Error: unrecognized opcode
>   `csrs sstatus,a5'
> /<>/arch/riscv/cpu/cpu.c:95: Error: unrecognized opcode
>   `csrw 0x003,0'
> make[4]: *** [/<>/scripts/Makefile.build:254:
>   arch/riscv/cpu/cpu.o] Error 1
> make[3]: *** [/<>/Makefile:1810: arch/riscv/cpu] Error 2
> make[3]: Leaving directory
>   '/<>/debian/build/qemu-riscv64_smode'

I guess this is due to:
http://lists.infradead.org/pipermail/linux-riscv/2022-January/011728.html

Unfortunately as the change has been done in a not yet released binutils
version, there is no way for the fix to have been done upstream yet.

Note that this also breaks at least linux and opensbi.

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net


signature.asc
Description: PGP signature


Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-25 Thread Vagrant Cascadian
On 2022-01-25, Vagrant Cascadian wrote:
> On 2022-01-15, Aurelien Jarno wrote:
>> On 2022-01-11 16:40, Vagrant Cascadian wrote:
>>> On 2022-01-11, Lennart Sorensen wrote:
>>> > On Mon, Jan 10, 2022 at 05:10:04PM -0800, Vagrant Cascadian wrote:
>>> >> Something in the toolchain recently changed which causes u-boot arch:all
>>> >> build to FTBFS... I suspect binutils, as building in "bookworm" still
>>> >> works fine where binutils hasn't yet migrated.
>>> >> 
>>> >> On arch:all builds the qemu-ppce500 target is cross-compiled.
>>> >> 
>>> >> Full log:
>>> >> 
>>> >>   
>>> >> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
>>> >> 
>>> >> The hopefully relevent lines from the build log:
...
>>> >> {standard input}: Assembler messages:
>>> >> {standard input}:127: Error: unrecognized opcode: `tlbre'
>>> >> {standard input}:418: Error: unrecognized opcode: `tlbre'
>>> >> {standard input}:821: Error: unrecognized opcode: `msync'
>>> >> {standard input}:821: Error: unrecognized opcode: `tlbwe'
>>> >> {standard input}:884: Error: unrecognized opcode: `tlbsx'
>>> >> make[4]: *** [/<>/scripts/Makefile.build:253: 
>>> >> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
>>> >> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] 
>>> >> Error 2
>>> >> make[3]: *** Waiting for unfinished jobs
>>> >>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
> ...
>>> The binutils versions appear to be:
>>> 
>>>   succeeding, bookworm 2.37-10.1
>>>   failing, sid 2.37.50.20220106-2
>>> 
>>
>> Yep, this is due to commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a on
>> the binutils side [1], which changes the behavior of `.machine`
>> directives to override, rather than augment, the base CPU. GCC is called
>> with -Wa,-me500 to enable PowerPC e500 instructions on the assembler
>> side, but as the default GCC machine is ppc, a `.set machine ppc` is
>> emitted at the beginning of the assembly code.
>>
>> One option would be to force the CPU to e500 on the GCC side, however
>> support for it has been removed. The options is therefore to force the
>> machine in the assembly code. This is what the attached patch does.
>
> Somehow I missed that you had attached a patch! I will try to get this
> tested and uploaded to Debian soon...

Your patch fixed building qemu-ppce500, but now I think we have a
potentially similar problem with qemu-riscv64 and qemu-riscv64_smode:

/<>/arch/riscv/cpu/cpu.c: Assembler messages:
/<>/arch/riscv/cpu/cpu.c:94: Error: unrecognized opcode
  `csrs sstatus,a5'
/<>/arch/riscv/cpu/cpu.c:95: Error: unrecognized opcode
  `csrw 0x003,0'
make[4]: *** [/<>/scripts/Makefile.build:254:
  arch/riscv/cpu/cpu.o] Error 1
make[3]: *** [/<>/Makefile:1810: arch/riscv/cpu] Error 2
make[3]: Leaving directory
  '/<>/debian/build/qemu-riscv64_smode'


live well,
  vagrant


>> --- u-boot-2022.01+dfsg.orig/arch/powerpc/cpu/mpc85xx/tlb.c
>> +++ u-boot-2022.01+dfsg/arch/powerpc/cpu/mpc85xx/tlb.c
>> @@ -50,7 +50,10 @@ void read_tlbcam_entry(int idx, u32 *val
>>  u32 _mas1;
>>  
>>  mtspr(MAS0, FSL_BOOKE_MAS0(1, idx, 0));
>> -asm volatile("tlbre;isync");
>> +asm volatile(".machine push;\n"
>> + ".machine e500;\n"
>> + "tlbre;isync;\n"
>> + ".machine pop;\n");
>>  _mas1 = mfspr(MAS1);
>>  
>>  *valid = (_mas1 & MAS1_VALID);
>> @@ -109,7 +112,10 @@ void init_used_tlb_cams(void)
>>  /* walk all the entries */
>>  for (i = 0; i < num_cam; i++) {
>>  mtspr(MAS0, FSL_BOOKE_MAS0(1, i, 0));
>> -asm volatile("tlbre;isync");
>> +asm volatile(".machine push;\n"
>> + ".machine e500;\n"
>> + "tlbre;isync;\n"
>> + ".machine pop;");
>>  if (mfspr(MAS1) & MAS1_VALID)
>>  use_tlb_cam(i);
>>  }
>> @@ -183,7 +189,10 @@ void disable_tlb(u8 esel)
>>  #ifdef CONFIG_ENABLE_36BIT_PHYS
>>  mtspr(MAS7, 0);
>>  #endif
>> -asm volatile("isync;msync;tlbwe;isync");
>> +asm volatile(".machine push;\n"
>> + ".machine e500;\n"
>> + "isync;msync;tlbwe;isync;\n"
>> + ".machine pop;\n");
>>  
>>  #ifdef CONFIG_ADDR_MAP
>>  if (gd->flags & GD_FLG_RELOC)
>> @@ -193,7 +202,11 @@ void disable_tlb(u8 esel)
>>  
>>  static void tlbsx (const volatile unsigned *addr)
>>  {
>> -__asm__ __volatile__ ("tlbsx 0,%0" : : "r" (addr), "m" (*addr));
>> +__asm__ __volatile__ (".machine push;\n"
>> +  ".machine e500;\n"
>> +  "tlbsx 0,%0;\n"
>> +  ".machine pop;\n"
>> +  : : "r" (addr), "m" (*addr));
>>  }
>>  
>>  /* return -1 if we didn't find anything */


signature.asc
Description: PGP signature


Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-25 Thread Vagrant Cascadian
A bug in Debian is causing a build failure of the qemu-ppce500 target:

  https://bugs.debian.org/1003490

I've CCed u-boot in case they're not aware of the issue.

Some background follows...

On 2022-01-15, Aurelien Jarno wrote:
> On 2022-01-11 16:40, Vagrant Cascadian wrote:
>> On 2022-01-11, Lennart Sorensen wrote:
>> > On Mon, Jan 10, 2022 at 05:10:04PM -0800, Vagrant Cascadian wrote:
>> >> Something in the toolchain recently changed which causes u-boot arch:all
>> >> build to FTBFS... I suspect binutils, as building in "bookworm" still
>> >> works fine where binutils hasn't yet migrated.
>> >> 
>> >> On arch:all builds the qemu-ppce500 target is cross-compiled.
>> >> 
>> >> Full log:
>> >> 
>> >>   
>> >> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
>> >> 
>> >> The hopefully relevent lines from the build log:
>> >> 
>> >>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/cpu/mpc85xx/.tlb.o.d 
>> >> -nostdinc -isystem /usr/lib/gcc-cross/powerpc-linux-gnu/11/include 
>> >> -Iinclude  -I/<>/include  
>> >> -I/<>/arch/powerpc/include -include 
>> >> /<>/include/linux/kconfig.h  
>> >> -I/<>/arch/powerpc/cpu/mpc85xx -Iarch/powerpc/cpu/mpc85xx 
>> >> -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security 
>> >> -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing 
>> >> -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks 
>> >> -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds 
>> >> -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized 
>> >> -fmacro-prefix-map=/<>/= -g -fstack-usage 
>> >> -Wno-format-nonliteral -Wno-address-of-packed-member 
>> >> -Wno-unused-but-set-variable -Werror=date-time -Wno-packed-not-aligned 
>> >> -D__powerpc__ -ffixed-r2 -m32 -fno-ira-hoist-pressure -Wa,-me500 
>> >> -msoft-float -mno-string -fpic -mrelocatable -ffunction-sections 
>> >> -fdata-sections -mcall-linux -msingle-pic-base -fno-jump-tables -pipe
>> >> -DKBUILD_BASENAME='"tlb"'  -DKBUILD_MODNAME='"tlb"' -c -o 
>> >> arch/powerpc/cpu/mpc85xx/tlb.o 
>> >> /<>/arch/powerpc/cpu/mpc85xx/tlb.c
>> >> ...
>> >> {standard input}: Assembler messages:
>> >> {standard input}:127: Error: unrecognized opcode: `tlbre'
>> >> {standard input}:418: Error: unrecognized opcode: `tlbre'
>> >> {standard input}:821: Error: unrecognized opcode: `msync'
>> >> {standard input}:821: Error: unrecognized opcode: `tlbwe'
>> >> {standard input}:884: Error: unrecognized opcode: `tlbsx'
>> >> make[4]: *** [/<>/scripts/Makefile.build:253: 
>> >> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
>> >> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] 
>> >> Error 2
>> >> make[3]: *** Waiting for unfinished jobs
>> >>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
...
>> The binutils versions appear to be:
>> 
>>   succeeding, bookworm 2.37-10.1
>>   failing, sid 2.37.50.20220106-2
>> 
>
> Yep, this is due to commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a on
> the binutils side [1], which changes the behavior of `.machine`
> directives to override, rather than augment, the base CPU. GCC is called
> with -Wa,-me500 to enable PowerPC e500 instructions on the assembler
> side, but as the default GCC machine is ppc, a `.set machine ppc` is
> emitted at the beginning of the assembly code.
>
> One option would be to force the CPU to e500 on the GCC side, however
> support for it has been removed. The options is therefore to force the
> machine in the assembly code. This is what the attached patch does.

Somehow I missed that you had attached a patch! I will try to get this
tested and uploaded to Debian soon...

live well,
  vagrant

> --- u-boot-2022.01+dfsg.orig/arch/powerpc/cpu/mpc85xx/tlb.c
> +++ u-boot-2022.01+dfsg/arch/powerpc/cpu/mpc85xx/tlb.c
> @@ -50,7 +50,10 @@ void read_tlbcam_entry(int idx, u32 *val
>   u32 _mas1;
>  
>   mtspr(MAS0, FSL_BOOKE_MAS0(1, idx, 0));
> - asm volatile("tlbre;isync");
> + asm volatile(".machine push;\n"
> +  ".machine e500;\n"
> +  "tlbre;isync;\n"
> +  ".machine pop;\n");
>   _mas1 = mfspr(MAS1);
>  
>   *valid = (_mas1 & MAS1_VALID);
> @@ -109,7 +112,10 @@ void init_used_tlb_cams(void)
>   /* walk all the entries */
>   for (i = 0; i < num_cam; i++) {
>   mtspr(MAS0, FSL_BOOKE_MAS0(1, i, 0));
> - asm volatile("tlbre;isync");
> + asm volatile(".machine push;\n"
> +  ".machine e500;\n"
> +  "tlbre;isync;\n"
> +  ".machine pop;");
>   if (mfspr(MAS1) & MAS1_VALID)
>   use_tlb_cam(i);
>   }
> @@ -183,7 +189,10 @@ void disable_tlb(u8 esel)
>  #ifdef CONFIG_ENABLE_36BIT_PHYS
>   mtspr(MAS7, 0);
>  #endif
> - asm volatile("isync;msync;tlbwe;isync");
> + asm volatile(".machine push;\n"
> +  ".machine e500;\n"
> + 

Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-20 Thread John Paul Adrian Glaubitz
Hi Vagrant!

On 1/11/22 02:10, Vagrant Cascadian wrote:
> Something in the toolchain recently changed which causes u-boot arch:all
> build to FTBFS... I suspect binutils, as building in "bookworm" still
> works fine where binutils hasn't yet migrated.
> 
> On arch:all builds the qemu-ppce500 target is cross-compiled.
> 
> Full log:
> 
>   
> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
> 
> The hopefully relevent lines from the build log:
> ...
> {standard input}: Assembler messages:
> {standard input}:127: Error: unrecognized opcode: `tlbre'
> {standard input}:418: Error: unrecognized opcode: `tlbre'
> {standard input}:821: Error: unrecognized opcode: `msync'
> {standard input}:821: Error: unrecognized opcode: `tlbwe'
> {standard input}:884: Error: unrecognized opcode: `tlbsx'
> make[4]: *** [/<>/scripts/Makefile.build:253: 
> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] Error 
> 2
> make[3]: *** Waiting for unfinished jobs
>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
> 
> 
> If anyone has thoughts what might be the issue, please chime in!

It's most likely this upstream change [1] in binutils that broke the build.

It also affects glibc [2] and the kernel [3][4], for example.

Adrian

> [1] 
> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a
> [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003847
> [3] 
> https://buildd.debian.org/status/fetch.php?pkg=linux&arch=powerpc&ver=5.15.15-1&stamp=1642579068&raw=0
> [4] 
> https://buildd.debian.org/status/fetch.php?pkg=linux&arch=ppc64&ver=5.15.15-1&stamp=1642578946&raw=0

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



Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-15 Thread Aurelien Jarno
control: tag -1 + upstream
control: tag -1 + patch

On 2022-01-11 16:40, Vagrant Cascadian wrote:
> On 2022-01-11, Lennart Sorensen wrote:
> > On Mon, Jan 10, 2022 at 05:10:04PM -0800, Vagrant Cascadian wrote:
> >> Package: u-boot
> >> Version: 2022.01+dfsg1-1
> >> Severity: serious
> >> X-Debbugs-Cc: debian-powe...@lists.debian.org, q...@packages.debian.org, 
> >> binut...@packages.debian.org
> >> 
> >> Something in the toolchain recently changed which causes u-boot arch:all
> >> build to FTBFS... I suspect binutils, as building in "bookworm" still
> >> works fine where binutils hasn't yet migrated.
> >> 
> >> On arch:all builds the qemu-ppce500 target is cross-compiled.
> >> 
> >> Full log:
> >> 
> >>   
> >> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
> >> 
> >> The hopefully relevent lines from the build log:
> >> 
> >>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/cpu/mpc85xx/.tlb.o.d 
> >> -nostdinc -isystem /usr/lib/gcc-cross/powerpc-linux-gnu/11/include 
> >> -Iinclude  -I/<>/include  
> >> -I/<>/arch/powerpc/include -include 
> >> /<>/include/linux/kconfig.h  
> >> -I/<>/arch/powerpc/cpu/mpc85xx -Iarch/powerpc/cpu/mpc85xx 
> >> -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security 
> >> -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing 
> >> -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks 
> >> -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds 
> >> -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized 
> >> -fmacro-prefix-map=/<>/= -g -fstack-usage 
> >> -Wno-format-nonliteral -Wno-address-of-packed-member 
> >> -Wno-unused-but-set-variable -Werror=date-time -Wno-packed-not-aligned 
> >> -D__powerpc__ -ffixed-r2 -m32 -fno-ira-hoist-pressure -Wa,-me500 
> >> -msoft-float -mno-string -fpic -mrelocatable -ffunction-sections 
> >> -fdata-sections -mcall-linux -msingle-pic-base -fno-jump-tables -pipe
> >> -DKBUILD_BASENAME='"tlb"'  -DKBUILD_MODNAME='"tlb"' -c -o 
> >> arch/powerpc/cpu/mpc85xx/tlb.o 
> >> /<>/arch/powerpc/cpu/mpc85xx/tlb.c
> >> ...
> >> {standard input}: Assembler messages:
> >> {standard input}:127: Error: unrecognized opcode: `tlbre'
> >> {standard input}:418: Error: unrecognized opcode: `tlbre'
> >> {standard input}:821: Error: unrecognized opcode: `msync'
> >> {standard input}:821: Error: unrecognized opcode: `tlbwe'
> >> {standard input}:884: Error: unrecognized opcode: `tlbsx'
> >> make[4]: *** [/<>/scripts/Makefile.build:253: 
> >> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
> >> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] 
> >> Error 2
> >> make[3]: *** Waiting for unfinished jobs
> >>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
> >> 
> >> 
> >> If anyone has thoughts what might be the issue, please chime in!
> >> 
> >> 
> >> I could remove qemu-ppce500 from the build targets(all other targets
> >> build fine); I am not sure if it is used by qemu or if qemu builds all
> >> it's own firmwares.
> >
> > Which gcc version?  I believe gcc 9 removed the code for powerpcspe
> > which gcc 8 deprecated.  So at this point I think only llvm/clang supports
> > the powerpcspe targets.
> 
> gcc-11 11.2.0-13 in both the successfull (bookworm) and
> failing case (sid).
> 
> Which is why I suspect binutils, which differs between bookworm and
> sid...
> 
> > I don't recall if binutils also dropped support or have kept it around.
> 
> The binutils versions appear to be:
> 
>   succeeding, bookworm 2.37-10.1
>   failing, sid 2.37.50.20220106-2
> 

Yep, this is due to commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a on
the binutils side [1], which changes the behavior of `.machine`
directives to override, rather than augment, the base CPU. GCC is called
with -Wa,-me500 to enable PowerPC e500 instructions on the assembler
side, but as the default GCC machine is ppc, a `.set machine ppc` is
emitted at the beginning of the assembly code.

One option would be to force the CPU to e500 on the GCC side, however
support for it has been removed. The options is therefore to force the
machine in the assembly code. This is what the attached patch does.

Regards,
Aurelien

[1] 
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a

-- 
Aurelien Jarno  GPG: 4096R/1DDD8C9B
aurel...@aurel32.net http://www.aurel32.net
--- u-boot-2022.01+dfsg.orig/arch/powerpc/cpu/mpc85xx/tlb.c
+++ u-boot-2022.01+dfsg/arch/powerpc/cpu/mpc85xx/tlb.c
@@ -50,7 +50,10 @@ void read_tlbcam_entry(int idx, u32 *val
 	u32 _mas1;
 
 	mtspr(MAS0, FSL_BOOKE_MAS0(1, idx, 0));
-	asm volatile("tlbre;isync");
+	asm volatile(".machine push;\n"
+		 ".machine e500;\n"
+		 "tlbre;isync;\n"
+		 ".machine pop;\n");
 	_mas1 = mfspr(MAS1);
 
 	*valid = (_mas1 & MAS1_VALID);
@@ -109,7 +112,10 @@ void init_used_tlb_cams(void)
 	/* walk all the entries */
 	for (i = 0; i < num

Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-11 Thread Vagrant Cascadian
On 2022-01-11, Lennart Sorensen wrote:
> On Mon, Jan 10, 2022 at 05:10:04PM -0800, Vagrant Cascadian wrote:
>> Package: u-boot
>> Version: 2022.01+dfsg1-1
>> Severity: serious
>> X-Debbugs-Cc: debian-powe...@lists.debian.org, q...@packages.debian.org, 
>> binut...@packages.debian.org
>> 
>> Something in the toolchain recently changed which causes u-boot arch:all
>> build to FTBFS... I suspect binutils, as building in "bookworm" still
>> works fine where binutils hasn't yet migrated.
>> 
>> On arch:all builds the qemu-ppce500 target is cross-compiled.
>> 
>> Full log:
>> 
>>   
>> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
>> 
>> The hopefully relevent lines from the build log:
>> 
>>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/cpu/mpc85xx/.tlb.o.d -nostdinc 
>> -isystem /usr/lib/gcc-cross/powerpc-linux-gnu/11/include -Iinclude  
>> -I/<>/include  -I/<>/arch/powerpc/include -include 
>> /<>/include/linux/kconfig.h  
>> -I/<>/arch/powerpc/cpu/mpc85xx -Iarch/powerpc/cpu/mpc85xx 
>> -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security 
>> -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing 
>> -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks 
>> -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds 
>> -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized 
>> -fmacro-prefix-map=/<>/= -g -fstack-usage 
>> -Wno-format-nonliteral -Wno-address-of-packed-member 
>> -Wno-unused-but-set-variable -Werror=date-time -Wno-packed-not-aligned 
>> -D__powerpc__ -ffixed-r2 -m32 -fno-ira-hoist-pressure -Wa,-me500 
>> -msoft-float -mno-string -fpic -mrelocatable -ffunction-sections 
>> -fdata-sections -mcall-linux -msingle-pic-base -fno-jump-tables -pipe
>> -DKBUILD_BASENAME='"tlb"'  -DKBUILD_MODNAME='"tlb"' -c -o 
>> arch/powerpc/cpu/mpc85xx/tlb.o 
>> /<>/arch/powerpc/cpu/mpc85xx/tlb.c
>> ...
>> {standard input}: Assembler messages:
>> {standard input}:127: Error: unrecognized opcode: `tlbre'
>> {standard input}:418: Error: unrecognized opcode: `tlbre'
>> {standard input}:821: Error: unrecognized opcode: `msync'
>> {standard input}:821: Error: unrecognized opcode: `tlbwe'
>> {standard input}:884: Error: unrecognized opcode: `tlbsx'
>> make[4]: *** [/<>/scripts/Makefile.build:253: 
>> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
>> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] 
>> Error 2
>> make[3]: *** Waiting for unfinished jobs
>>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
>> 
>> 
>> If anyone has thoughts what might be the issue, please chime in!
>> 
>> 
>> I could remove qemu-ppce500 from the build targets(all other targets
>> build fine); I am not sure if it is used by qemu or if qemu builds all
>> it's own firmwares.
>
> Which gcc version?  I believe gcc 9 removed the code for powerpcspe
> which gcc 8 deprecated.  So at this point I think only llvm/clang supports
> the powerpcspe targets.

gcc-11 11.2.0-13 in both the successfull (bookworm) and
failing case (sid).

Which is why I suspect binutils, which differs between bookworm and
sid...

> I don't recall if binutils also dropped support or have kept it around.

The binutils versions appear to be:

  succeeding, bookworm 2.37-10.1
  failing, sid 2.37.50.20220106-2


live well,
  vagrant



Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-11 Thread Lennart Sorensen
On Mon, Jan 10, 2022 at 05:10:04PM -0800, Vagrant Cascadian wrote:
> Package: u-boot
> Version: 2022.01+dfsg1-1
> Severity: serious
> X-Debbugs-Cc: debian-powe...@lists.debian.org, q...@packages.debian.org, 
> binut...@packages.debian.org
> 
> Something in the toolchain recently changed which causes u-boot arch:all
> build to FTBFS... I suspect binutils, as building in "bookworm" still
> works fine where binutils hasn't yet migrated.
> 
> On arch:all builds the qemu-ppce500 target is cross-compiled.
> 
> Full log:
> 
>   
> https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0
> 
> The hopefully relevent lines from the build log:
> 
>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/cpu/mpc85xx/.tlb.o.d -nostdinc 
> -isystem /usr/lib/gcc-cross/powerpc-linux-gnu/11/include -Iinclude  
> -I/<>/include  -I/<>/arch/powerpc/include -include 
> /<>/include/linux/kconfig.h  
> -I/<>/arch/powerpc/cpu/mpc85xx -Iarch/powerpc/cpu/mpc85xx 
> -D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security 
> -fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing 
> -fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks 
> -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds 
> -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized 
> -fmacro-prefix-map=/<>/= -g -fstack-usage -Wno-format-nonliteral 
> -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=date-time 
> -Wno-packed-not-aligned -D__powerpc__ -ffixed-r2 -m32 -fno-ira-hoist-pressure 
> -Wa,-me500 -msoft-float -mno-string -fpic -mrelocatable -ffunction-sections 
> -fdata-sections -mcall-linux -msingle-pic-base -fno-jump-tables -pipe
> -DKBUILD_BASENAME='"tlb"'  -DKBUILD_MODNAME='"tlb"' -c -o 
> arch/powerpc/cpu/mpc85xx/tlb.o /<>/arch/powerpc/cpu/mpc85xx/tlb.c
> ...
> {standard input}: Assembler messages:
> {standard input}:127: Error: unrecognized opcode: `tlbre'
> {standard input}:418: Error: unrecognized opcode: `tlbre'
> {standard input}:821: Error: unrecognized opcode: `msync'
> {standard input}:821: Error: unrecognized opcode: `tlbwe'
> {standard input}:884: Error: unrecognized opcode: `tlbsx'
> make[4]: *** [/<>/scripts/Makefile.build:253: 
> arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] Error 
> 2
> make[3]: *** Waiting for unfinished jobs
>   powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost
> 
> 
> If anyone has thoughts what might be the issue, please chime in!
> 
> 
> I could remove qemu-ppce500 from the build targets(all other targets
> build fine); I am not sure if it is used by qemu or if qemu builds all
> it's own firmwares.

Which gcc version?  I believe gcc 9 removed the code for powerpcspe
which gcc 8 deprecated.  So at this point I think only llvm/clang supports
the powerpcspe targets.

I don't recall if binutils also dropped support or have kept it around.

-- 
Len Sorensen



Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-10 Thread Vagrant Cascadian
Control: found 1003490 2021.10+dfsg-1

On 2022-01-10, Vagrant Cascadian wrote:
> Something in the toolchain recently changed which causes u-boot arch:all
> build to FTBFS... I suspect binutils, as building in "bookworm" still
> works fine where binutils hasn't yet migrated.

Also building 2021.10 on sid fails in the same way, so it's not a
source-code change in u-boot.


live well,
  vagrant


signature.asc
Description: PGP signature


Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target

2022-01-10 Thread Vagrant Cascadian
Package: u-boot
Version: 2022.01+dfsg1-1
Severity: serious
X-Debbugs-Cc: debian-powe...@lists.debian.org, q...@packages.debian.org, 
binut...@packages.debian.org

Something in the toolchain recently changed which causes u-boot arch:all
build to FTBFS... I suspect binutils, as building in "bookworm" still
works fine where binutils hasn't yet migrated.

On arch:all builds the qemu-ppce500 target is cross-compiled.

Full log:

  
https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=all&ver=2022.01%2Bdfsg-1&stamp=1641860624&raw=0

The hopefully relevent lines from the build log:

  powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/cpu/mpc85xx/.tlb.o.d -nostdinc 
-isystem /usr/lib/gcc-cross/powerpc-linux-gnu/11/include -Iinclude  
-I/<>/include  -I/<>/arch/powerpc/include -include 
/<>/include/linux/kconfig.h  
-I/<>/arch/powerpc/cpu/mpc85xx -Iarch/powerpc/cpu/mpc85xx 
-D__KERNEL__ -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security 
-fno-builtin -ffreestanding -std=gnu11 -fshort-wchar -fno-strict-aliasing 
-fno-PIE -Os -fno-stack-protector -fno-delete-null-pointer-checks 
-Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds 
-Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-uninitialized 
-fmacro-prefix-map=/<>/= -g -fstack-usage -Wno-format-nonliteral 
-Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=date-time 
-Wno-packed-not-aligned -D__powerpc__ -ffixed-r2 -m32 -fno-ira-hoist-pressure 
-Wa,-me500 -msoft-float -mno-string -fpic -mrelocatable -ffunction-sections 
-fdata-sections -mcall-linux -msingle-pic-base -fno-jump-tables -pipe
-DKBUILD_BASENAME='"tlb"'  -DKBUILD_MODNAME='"tlb"' -c -o 
arch/powerpc/cpu/mpc85xx/tlb.o /<>/arch/powerpc/cpu/mpc85xx/tlb.c
...
{standard input}: Assembler messages:
{standard input}:127: Error: unrecognized opcode: `tlbre'
{standard input}:418: Error: unrecognized opcode: `tlbre'
{standard input}:821: Error: unrecognized opcode: `msync'
{standard input}:821: Error: unrecognized opcode: `tlbwe'
{standard input}:884: Error: unrecognized opcode: `tlbsx'
make[4]: *** [/<>/scripts/Makefile.build:253: 
arch/powerpc/cpu/mpc85xx/tlb.o] Error 1
make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85xx] Error 2
make[3]: *** Waiting for unfinished jobs
  powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/lib/.traps.o.d -nost


If anyone has thoughts what might be the issue, please chime in!


I could remove qemu-ppce500 from the build targets(all other targets
build fine); I am not sure if it is used by qemu or if qemu builds all
it's own firmwares.


live well,
  vagrant


signature.asc
Description: PGP signature