From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3141CC5AC75 for ; Wed, 26 Jan 2022 01:03:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BD23A834B5; Wed, 26 Jan 2022 02:03:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=debian.org header.i=@debian.org header.b="K4SQOwPI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FA478365E; Wed, 26 Jan 2022 02:03:27 +0100 (CET) Received: from cascadia.aikidev.net (cascadia.aikidev.net [173.255.214.101]) by phobos.denx.de (Postfix) with ESMTP id 8834983035 for ; Wed, 26 Jan 2022 02:03:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=vagrant@debian.org Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100e]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id C40C11AB5A; Tue, 25 Jan 2022 17:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1643159002; bh=Vm41zpAt79h8YBpJS21k+9sERLPbU6G3gNEeC+ha8e8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=K4SQOwPIgCJAFxoCiwqYThGS9sPR6qoTJjNoyA5s9dmrJ7yNZ+NYLwzoIltZKiCTj fs2A9bHHuKjznk6J6Un/5QHty7SvHVEljPDXa6aVEybU8nlm4rnTEFIhxIvV/B6h8W xcU2qmREsiY1+Of4YNnH6okMlBLdvjsOEc4o3nbe/7xIkP5TinH/tnN3EI1MEjVDSE 5qZk+2Mg3/evAlcO30/KBMzA/tOLvkR6UqM62ysTTq6nVXV/P74YBtKhC/Wu/wdR5O 2W6XSH8Qi2iTtYsVpL/DI1FDvEVDfhlI6v4+DmmDx6toysBBGdq+S9umnGkX3U5Omq ZUNnWmrJRYjsw== From: Vagrant Cascadian To: Aurelien Jarno Cc: Lennart Sorensen , 1003490@bugs.debian.org, u-boot@lists.denx.de, Stefano Stabellini Subject: Re: Bug#1003490: u-boot: FTBFS on arch:all with qemu-ppce500 target In-Reply-To: References: <87wnj7oz6b.fsf@ponder> <87sftt4wi4.fsf@ponder> Date: Tue, 25 Jan 2022 17:03:09 -0800 Message-ID: <87ilu7b96a.fsf@ponder> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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. >> >>=20 >> >> On arch:all builds the qemu-ppce500 target is cross-compiled. >> >>=20 >> >> Full log: >> >>=20 >> >> https://buildd.debian.org/status/fetch.php?pkg=3Du-boot&arch=3Dall&= ver=3D2022.01%2Bdfsg-1&stamp=3D1641860624&raw=3D0 >> >>=20 >> >> The hopefully relevent lines from the build log: >> >>=20 >> >> powerpc-linux-gnu-gcc -Wp,-MD,arch/powerpc/cpu/mpc85xx/.tlb.o.d -no= stdinc -isystem /usr/lib/gcc-cross/powerpc-linux-gnu/11/include -Iinclude = -I/<>/include -I/<>/arch/powerpc/include -includ= e /<>/include/linux/kconfig.h -I/<>/arch/powerpc= /cpu/mpc85xx -Iarch/powerpc/cpu/mpc85xx -D__KERNEL__ -D__UBOOT__ -Wall -Wst= rict-prototypes -Wno-format-security -fno-builtin -ffreestanding -std=3Dgnu= 11 -fshort-wchar -fno-strict-aliasing -fno-PIE -Os -fno-stack-protector -fn= o-delete-null-pointer-checks -Wno-pointer-sign -Wno-stringop-truncation -Wn= o-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-maybe-un= initialized -fmacro-prefix-map=3D/<>/=3D -g -fstack-usage -Wno= -format-nonliteral -Wno-address-of-packed-member -Wno-unused-but-set-variab= le -Werror=3Ddate-time -Wno-packed-not-aligned -D__powerpc__ -ffixed-r2 -m3= 2 -fno-ira-hoist-pressure -Wa,-me500 -msoft-float -mno-string -fpic -mreloc= atable -ffunction-sections -fdata-sections -mcall-linux -msingle-pic-base -= fno-jump-tables -pipe -DKBUILD_BASENAME=3D'"tlb"' -DKBUILD_MODNAME=3D'"= tlb"' -c -o arch/powerpc/cpu/mpc85xx/tlb.o /<>/arch/powerpc/cp= u/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/power= pc/cpu/mpc85xx/tlb.o] Error 1 >> >> make[3]: *** [/<>/Makefile:1810: arch/powerpc/cpu/mpc85x= x] 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: >>=20 >> succeeding, bookworm 2.37-10.1 >> failing, sid 2.37.50.20220106-2 >>=20 > > 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; >=20=20 > 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 =3D mfspr(MAS1); >=20=20 > *valid =3D (_mas1 & MAS1_VALID); > @@ -109,7 +112,10 @@ void init_used_tlb_cams(void) > /* walk all the entries */ > for (i =3D 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"); >=20=20 > #ifdef CONFIG_ADDR_MAP > if (gd->flags & GD_FLG_RELOC) > @@ -193,7 +202,11 @@ void disable_tlb(u8 esel) >=20=20 > 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)); > } >=20=20 > /* return -1 if we didn't find anything */ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYfCd0wAKCRDcUY/If5cW quh9AQCROO+vCF0gOBaG37+yCgCnp0TRTqB6Ffn3uMJgx7XBxwD/ZqipNN5pazs3 cyIbh39g04SfTaHFlW2dGq0O6kQ2Bgc= =cv1/ -----END PGP SIGNATURE----- --=-=-=--