From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1585) id 9D7AF3858439; Tue, 19 Jul 2022 13:33:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D7AF3858439 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Luis Machado To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [AArch64] Fix testcase compilation failure X-Act-Checkin: binutils-gdb X-Git-Author: Luis Machado X-Git-Refname: refs/heads/master X-Git-Oldrev: 76e4fa70e79ee959c0e11eaacd4cf863291b1ddb X-Git-Newrev: 3c539d41b48e5a70cc22b0151ee79b8bd752341d Message-Id: <20220719133313.9D7AF3858439@sourceware.org> Date: Tue, 19 Jul 2022 13:33:13 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2022 13:33:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3c539d41b48e= 5a70cc22b0151ee79b8bd752341d commit 3c539d41b48e5a70cc22b0151ee79b8bd752341d Author: Luis Machado Date: Tue Jun 28 14:08:46 2022 +0100 [AArch64] Fix testcase compilation failure =20 Newer distros carry newer headers that contains MTE definitions. Accou= nt for that fact in the MTE testcases (gdb.arch/aarch64-mte.exp) and define constants conditionally to prevent compilation failures. Diff: --- gdb/testsuite/gdb.arch/aarch64-mte.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.arch/aarch64-mte.c b/gdb/testsuite/gdb.arch/= aarch64-mte.c index bd7f1a6cf53..fc38d58fe5e 100644 --- a/gdb/testsuite/gdb.arch/aarch64-mte.c +++ b/gdb/testsuite/gdb.arch/aarch64-mte.c @@ -30,22 +30,27 @@ #include =20 /* From arch/arm64/include/uapi/asm/hwcap.h */ +#ifndef HWCAP2_MTE #define HWCAP2_MTE (1 << 18) +#endif =20 /* From arch/arm64/include/uapi/asm/mman.h */ +#ifndef PROT_MTE #define PROT_MTE 0x20 +#endif =20 -/* From include/uapi/linux/prctl.h */ +#ifndef PR_SET_TAGGED_ADDR_CTRL #define PR_SET_TAGGED_ADDR_CTRL 55 -#define PR_GET_TAGGED_ADDR_CTRL 56 #define PR_TAGGED_ADDR_ENABLE (1UL << 0) +#endif + +/* From include/uapi/linux/prctl.h */ +#ifndef PR_MTE_TCF_SHIFT #define PR_MTE_TCF_SHIFT 1 -#define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT) #define PR_MTE_TCF_SYNC (1UL << PR_MTE_TCF_SHIFT) #define PR_MTE_TCF_ASYNC (2UL << PR_MTE_TCF_SHIFT) -#define PR_MTE_TCF_MASK (3UL << PR_MTE_TCF_SHIFT) #define PR_MTE_TAG_SHIFT 3 -#define PR_MTE_TAG_MASK (0xffffUL << PR_MTE_TAG_SHIFT) +#endif =20 void access_memory (unsigned char *tagged_ptr, unsigned char *untagged_ptr)