From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web11.23200.1683738409410024749 for ; Wed, 10 May 2023 10:06:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WI90v7jQ; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.168.131, mailfrom: quic_llindhol@quicinc.com) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34AD81kh025385; Wed, 10 May 2023 17:06:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=9P3xorLLjkwE/HCepBrK039jXwgax9eqRS8O2+9fa48=; b=WI90v7jQMdbgpuBz1+rQkANWq4yOKHiNwhJH+8wYRUEt5LIGy+kyaVp+CMhihG+YzMS5 NpHcJwBwU4I/tP+DPCBPcUeJBcxgrQK5YV+8pDucQGx100tdE5D33hdNHzwa1oQsKq34 DbdEYqLoGYTsAaIROIr6tX6+L/lnpFBBfwDt81qj3tC+saNyUbiZzCHO8Ee9zh1ircVL jGsD9BC6VHdi+l8JR/fJj2Vhy5tm4Y5jV2qM9GkYxpFbRlZuVB7RZBN4Gw4BVd5Z/55g 6pwCNdi0eiAnHFNqptS0p1yJ5JSL5XdZg03tEsI60nHnK7/u1LR+Evs3e4UFY59WuNht Mg== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qfuna2b0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 May 2023 17:06:42 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34AH6fNM009525 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 May 2023 17:06:41 GMT Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Wed, 10 May 2023 10:06:39 -0700 Date: Wed, 10 May 2023 18:06:36 +0100 From: "Leif Lindholm" To: Ard Biesheuvel CC: Rebecca Cran , Ard Biesheuvel , Thomas Abraham , Sami Mujawar , "devel@edk2.groups.io" Subject: Re: JunoPkg ARM build breakage: "Error: bad instruction `aarch64_bti(c)'" Message-ID: References: <45c61530-3cf4-f1bf-4ff1-b7bf242dbddb@bsdio.com> MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 9L6PI3Z1lfNdpl4Q4Vbl4wR3Zje6bB8f X-Proofpoint-GUID: 9L6PI3Z1lfNdpl4Q4Vbl4wR3Zje6bB8f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-10_04,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 clxscore=1011 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305100137 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Wed, May 10, 2023 at 18:54:04 +0200, Ard Biesheuvel wrote: > (cc Leif) > > On Wed, 10 May 2023 at 18:52, Rebecca Cran wrote: > > > > Thanks. Yes, that fixes it. > > > > > > I also tried running the build script with CLANGDWARF, and it seems to > > have found some valid problems with > > Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c > > > > Seems to me like an excellent opportunity to rip that thing out completely. Sounds like the ideal solution. The /dev/mem of program loaders. / Leif > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:216:11: > > error: variable 'FileSize' is used uninitialized whenever 'if' condition > > is false [-Werror,-Wsometimes-uninitialized] > > if (FileHandle != NULL) { > > ^~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:281:38: > > note: uninitialized use occurs here > > WriteBackDataCacheRange (FileData, FileSize); > > ^~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:216:7: > > note: remove the 'if' if its condition is always true > > if (FileHandle != NULL) { > > ^~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:179:9: > > error: variable 'FileSize' is used uninitialized whenever 'if' condition > > is true [-Werror,-Wsometimes-uninitialized] > > if ((ShellCommandLineGetFlag (ParamPackage, L"-?")) || > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:281:38: > > note: uninitialized use occurs here > > WriteBackDataCacheRange (FileData, FileSize); > > ^~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:179:5: > > note: remove the 'if' if its condition is always false > > if ((ShellCommandLineGetFlag (ParamPackage, L"-?")) || > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:179:9: > > error: variable 'FileSize' is used uninitialized whenever '||' condition > > is true [-Werror,-Wsometimes-uninitialized] > > if ((ShellCommandLineGetFlag (ParamPackage, L"-?")) || > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:281:38: > > note: uninitialized use occurs here > > WriteBackDataCacheRange (FileData, FileSize); > > ^~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:179:9: > > note: remove the '||' if its condition is always false > > if ((ShellCommandLineGetFlag (ParamPackage, L"-?")) || > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:172:7: > > error: variable 'FileSize' is used uninitialized whenever 'if' condition > > is true [-Werror,-Wsometimes-uninitialized] > > if (EFI_ERROR (Status)) { > > ^~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2/MdePkg/Include/Uefi/UefiBaseType.h:159:23: > > note: expanded from macro 'EFI_ERROR' > > #define EFI_ERROR(A) RETURN_ERROR(A) > > ^~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2/MdePkg/Include/Base.h:1061:35: note: expanded > > from macro 'RETURN_ERROR' > > #define RETURN_ERROR(StatusCode) (((INTN)(RETURN_STATUS)(StatusCode)) < 0) > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:281:38: > > note: uninitialized use occurs here > > WriteBackDataCacheRange (FileData, FileSize); > > ^~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:172:3: > > note: remove the 'if' if its condition is always false > > if (EFI_ERROR (Status)) { > > ^~~~~~~~~~~~~~~~~~~~~~~~~ > > /home/bcran/src/uefi/edk2-platforms/Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:136:39: > > note: initialize the variable 'FileSize' to silence this warning > > UINTN FileSize; > > ^ > > = 0 > > 4 errors generated. > > make: *** [GNUmakefile:342: > > /home/bcran/src/uefi/Build/ArmJuno/RELEASE_CLANGDWARF/AARCH64/Platform/ARM/Library/ArmShellCmdRunAxf/ArmShellCmdRunAxf/OUTPUT/RunAxf.obj] > > Error 1 > > > > -- > > > > Rebecca Cran > > > > > > > > On 5/10/23 10:27, Ard Biesheuvel wrote: > > > 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 > > >>