From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.22145.1683736034575211527 for ; Wed, 10 May 2023 09:27:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qz49RDMu; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 16AA0649E2 for ; Wed, 10 May 2023 16:27:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8139DC4339C for ; Wed, 10 May 2023 16:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683736033; bh=3/mTXMHiB1RFa4BAh8bMOvgIyZx/44uIWHKtsGbrVhs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Qz49RDMugI4upiSzSUhI1RpNOVYq/tGyo66EsDfqsdUFqS5qZBqPXW6jTsZQyn8+f atgRjht9myq5lzCgQ0ZvkXf4Ltwp9SWWP9LCV22pXI5nP2Wmq2wfD7PIf8C20FMcEb t+55Rq0vJtSuM4VeIsVColIQ/EGRVkqi0fF+WJh5qQsPV4Pjcz3AimWQuqboRqBmDP ZldBe1qXLPnTW12BnyPVM1C4M2HUmkIHqs/QfyXz4W4AzgoxmhjCTI/Sdd/5t0SYBt qg0k8fK98rrMlB5hkhqzfp1Z792plZaggitkMGvGgdGSqeTmqAAy9VlwdqpZyBFf+U 8DQcFQdICY1VQ== Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-4f25d79f6bfso2238807e87.2 for ; Wed, 10 May 2023 09:27:13 -0700 (PDT) X-Gm-Message-State: AC+VfDzMccVipmq5zuiTHIoSMVlVQ5nfEu1U7QZ///4c8ZWzmZ/UA9mi 2tg2Mq3AAcn0rtTxrKLsWddjFFbIGioiQjVg9z8= X-Google-Smtp-Source: ACHHUZ5cqpguEjpQDYkTkyrf3dJZeYtRVKnprBH/2Q3zV6ZyJneHmPHMfzwIRUvfNaGVE0A9rNN6M4nnKCxcBdp6nKE= X-Received: by 2002:a2e:99cb:0:b0:2ad:b1cb:faed with SMTP id l11-20020a2e99cb000000b002adb1cbfaedmr1093147ljj.7.1683736031488; Wed, 10 May 2023 09:27:11 -0700 (PDT) MIME-Version: 1.0 References: <45c61530-3cf4-f1bf-4ff1-b7bf242dbddb@bsdio.com> In-Reply-To: <45c61530-3cf4-f1bf-4ff1-b7bf242dbddb@bsdio.com> From: "Ard Biesheuvel" Date: Wed, 10 May 2023 18:27:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: JunoPkg ARM build breakage: "Error: bad instruction `aarch64_bti(c)'" To: Rebecca Cran Cc: Ard Biesheuvel , Thomas Abraham , Sami Mujawar , "devel@edk2.groups.io" Content-Type: text/plain; charset="UTF-8" Hi Rebecca, On Wed, 10 May 2023 at 18:23, Rebecca Cran wrote: > > I ran my script that tries to build all Arm platforms in edk2-platforms > (with the exception of known broken ones) with the GCC5/GCC toolchain, > and noticed a new breakage since I last ran it a few months ago. > > Building JunoPkg for ARM doesn't work. > > I also noticed it passes both -march=armv7-a and -march=armv8-a. > This looks like a bug in the Juno package - if I grep for aarch64_bti in edk2, every single hit is in a aarch64 specific source or header file, but it is getting pulled into an ARM build. Does the below help? diff --git a/Platform/ARM/Library/ArmShellCmdRunAxf/Arm/Pivot.S b/Platform/ARM/Library/ArmShellCmdRunAxf/Arm/Pivot.S index 50efcfacdfe6..7d5eed94b25f 100644 --- a/Platform/ARM/Library/ArmShellCmdRunAxf/Arm/Pivot.S +++ b/Platform/ARM/Library/ArmShellCmdRunAxf/Arm/Pivot.S @@ -4,7 +4,7 @@ // SPDX-License-Identifier: BSD-2-Clause-Patent // -#include +#include // VOID // RunAxfPivot ( > > "arm-none-eabi-gcc" -march=armv7-a -mfloat-abi=soft -march=armv8-a -c -x > assembler -imacros AutoGen.h -mlittle-endian -o > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/OUTPUT/Arm/Pivot.obj > -I/home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/Arm > -I/home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf > -I/home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/DEBUG > -I/home/bcran/src/uefi/edk2/ArmPkg > -I/home/bcran/src/uefi/edk2/ArmPkg/Include > -I/home/bcran/src/uefi/edk2/MdeModulePkg > -I/home/bcran/src/uefi/edk2/MdeModulePkg/Test/Mock/Include > -I/home/bcran/src/uefi/edk2/MdeModulePkg/Include > -I/home/bcran/src/uefi/edk2/MdePkg > -I/home/bcran/src/uefi/edk2/MdePkg/Include > -I/home/bcran/src/uefi/edk2/MdePkg/Test/UnitTest/Include > -I/home/bcran/src/uefi/edk2/MdePkg/Test/Mock/Include > -I/home/bcran/src/uefi/edk2/MdePkg/Include/Arm > -I/home/bcran/src/uefi/edk2-platforms/Platform/ARM > -I/home/bcran/src/uefi/edk2-platforms/Platform/ARM/Include > -I/home/bcran/src/uefi/edk2/ShellPkg > -I/home/bcran/src/uefi/edk2/ShellPkg/Include > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/OUTPUT/Arm/Pivot.iiii > Trim --trim-long --source-code -o > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe/OUTPUT/Arm/CopyMem.iiii > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe/OUTPUT/Arm/CopyMem.ii > Trim --trim-long --source-code -o > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/OUTPUT/Arm/ctzsi2.iiii > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/OUTPUT/Arm/ctzsi2.ii > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/OUTPUT/Arm/Pivot.iiii: > Assembler messages: > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/OUTPUT/Arm/Pivot.iiii:17: > Error: bad instruction `aarch64_bti(c)' > make: *** [GNUmakefile:363: > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_GCC5/ARM/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/OUTPUT/Arm/Pivot.obj] > Error 1 > > > -- > Rebecca Cran >