From patchwork Sun Mar 30 03:45:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 877159 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1224291wrs; Sat, 29 Mar 2025 20:45:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/QASgUaYSH5GpM/5jCG66lUevTMznq2ra59zjxvpBuKda4VomdxnwcuebJm7q63XVxKu9mA==@linaro.org X-Google-Smtp-Source: AGHT+IHcyU5CpENwdtZuGHxFvTApU8eU6hOkWsmRfy89G1FbxwB9EBB3lw5gegOammeTjp1CAbG+ X-Received: by 2002:a05:6214:19cb:b0:6e8:fee2:aae7 with SMTP id 6a1803df08f44-6eed62468d5mr57523716d6.39.1743306351621; Sat, 29 Mar 2025 20:45:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1743306351; cv=pass; d=google.com; s=arc-20240605; b=Zqs85GEs1L8Q7MIMXaZ7HBkAF0upVZf9PYxg9ZTeOPVLEq13xkqJYr/tICi9m++xFH 9yl4H/WwOH5Fi+VGzn1bwQnKEblz7yEXs5q8COTCwqfPSdvUIsUdRKEeSkx+ElrTI5Jt dASmAMEBT4sksPrLardg8B1HMDDX7hN9saOK/41OV04qE04MfICD5S/RwGerBMBK8V+K +Go449olcnD3tbYdbm114HsKQ70P6ttNo/ey8fdjv3Bwyi6HgQ3mMgazLiY+DjfzbtAn GDxCnrx/m4GSgcnlGe9y++RH+2myZ66kljSbwYAzj4QSLnLa0SG2FI5RrBHuclQVzatH z8gQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dkim-filter:arc-filter:dmarc-filter:delivered-to:dkim-filter; bh=Lmx85D/wzEYvPlkKttaOkJ0LZ8ouUf1hwhETPb387I0=; fh=72kqq0iQhigvR9Vv/oqX5ebs3Yyyw7XhzWxOOEPdupI=; b=gwvRcVMVip6xZEd4dkIk9gzYuA+2mbMT+K0WIie5IerXL+JXl9nLrICzRKpTWIxf4f xFYCIIT2xXzQWp4m6yU5nD0t+l+SSGCeBIT06DUpe3h7x1KE56n3liU2fZzhtyf2F7/V 6XJ+pjETEzFrP7few5XQDtPg9DF6n5CwZHdtuWucvmyKwIIh9maUDEFPresOiB//5n8J BlhRsR+clpvpPi+wn4Y9KyhK3ib9UbmnNZ/8NfTb3fsmHL7oN3cTPdb6Sgty6V+rrXfo zfqkLUfaUdMC0Gk7giKJEZF5baFa71yUJ6iY4xekUY9n/onmrw8K/AqIvXfEVkgxcd1a Xijw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jk9tTs29; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 6a1803df08f44-6eec96580edsi45070356d6.131.2025.03.29.20.45.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Mar 2025 20:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jk9tTs29; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gdb-patches-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 26CF2384978D for ; Sun, 30 Mar 2025 03:45:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26CF2384978D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Jk9tTs29 X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id 3C4673857BAF for ; Sun, 30 Mar 2025 03:45:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C4673857BAF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C4673857BAF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743306343; cv=none; b=NV6LdqOSOs1zQ2G1myfzJoT06b3Zwv8nMwJZ1AKCVglwALxSuM4Nkbd+iH97UFzWdOWPVFuQu8SbXXuqNbve4REFTTx7gRUMZLJxNOKeJzHErsvbNGr5UHEMi4n20FszG+NUv3gEVHsgI3YsCTn4rDspUzHRCwC6zvyo8arTodk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743306343; c=relaxed/simple; bh=4X8RT4+LIkWCBSuTpIht4Pqvsu9XI2gVYAq7wGWgXVM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hbAiQ8hI0CxmcqTedUj9CmKm9MXtIfosKU3D90librXoFxMGCQKM6f0uc1VnZj4mi8cxRzLw4nJkG5CsywPuox5xqrnKDI+5JUYToorIfjqU73mlOMYGmIaD1v88Zrg2C7r+njw/nAjzaVrMkat9zEcN6pCVCEobwD48+NA6PY8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C4673857BAF Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-3015001f862so4372667a91.3 for ; Sat, 29 Mar 2025 20:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743306342; x=1743911142; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Lmx85D/wzEYvPlkKttaOkJ0LZ8ouUf1hwhETPb387I0=; b=Jk9tTs29EImCPFMtM+seR6IgCl8K55BVmni7mMV3fLyp0SgHBc/Vjk/FJZy2vUwhG/ GRTIlcQV5hBOKqsHUX23QNWO7CLvlm/SS7FXeCzNzijaOTLtFbdZxGFe1yVOhFP7+Zm4 dzr9dnFw0B34oqVnf33Elj9zqKzcYjyfac8qdjEAfwHdWCQkB/BCYq98LjNgTxXt1ehv t4+oa4qwcyDLCfTVKv6dRx+60Y6kMoU3Oerla6gQoZzzMYnocV552TmWb0tJs/pNa8it DFZA7faf5tgq0Ib1+Y4/lD13pMfiIER/jfRmpQP6x9Jitugy3j+Kqsx4w8fkAkcGfG/J Rctw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743306342; x=1743911142; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Lmx85D/wzEYvPlkKttaOkJ0LZ8ouUf1hwhETPb387I0=; b=xSuFohBk3fBGVJuL2CxeYKrT1ytMF/aD4h2HzSymmWmPeF4FUxsZCbhQPLFll9FvnP zroMCyF8nIMXcpYjOh1DIYUpVZsp7repb+n6WhGiT+HFOb0KD3kK4jV81u6gT44Tjfva c/YiIUgydPRYV+X48KQ989oHaPsjlutWpzKQeWWnYWYpiwIdbW+G8p5nIkieUyQV/eNF gOZN84FDn2NmHlLnhmZvB52qsxh+QQcuTsKPGPXYirzubmgjIgVo17LS73pExdzJ8ypy 4DeOQ7PMV0kCJ2YFCAA8aHY22k/46326u5pZg7HE3N3IL5/tlX6JwA1OOJrhQZ4BI9/O 01Ww== X-Gm-Message-State: AOJu0YzNdLoJ83K3/wRnBBZGDAVodvUEb3L6RZDyTmKkap4pJ2PQhiix S4BbdKXaPNOJVBeYp9LDafk+qgl5GY20+YC+/sHQ+RG6GWDpxG2tQsuYu/XghYRrYEh7g5ngEjl n X-Gm-Gg: ASbGncv750YgJQqxjfI4wu5Kft6inRD5bH3pSJffhwcftVk5sBC/03xyZwNkNjH9RRP 2udlXYU01Q0VIdNjQWO2PNc1SQRokMUdVr9NHt5r5TlSRL+e7OSTOciXg1RmqMTf1i1b406pZmj rCaI9ou2orSvnXLIgQO0bFOX694ES9Z1Sqw7eBVyZfuvLRoksuhiUeHlBqdvqnUewalXidUodZP 6AYY3y+URyGMBa3hCZM9G9UQ7uvFV4AdYJR+f/2zwCOQJed2V7qnOCbzzj057NKu1dVmlFfExKG kO3cq8k3nJVCRlVu+VWF9TcGu3deQVMGd93I/dBC6ZC+1Smm+lQL3jA= X-Received: by 2002:a17:90b:4b06:b0:2ff:4a8d:74f8 with SMTP id 98e67ed59e1d1-30531f78cccmr6517075a91.6.1743306342051; Sat, 29 Mar 2025 20:45:42 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8209:8f7d:38e7:5a59:4532]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2291eec71besm44855855ad.14.2025.03.29.20.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Mar 2025 20:45:41 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH] testsuite: fix is_aarch32_target Date: Sun, 30 Mar 2025 00:45:39 -0300 Message-ID: <20250330034539.965018-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patch=linaro.org@sourceware.org Commit c221b2f77080 Testsuite: Add gdb_can_simple_compile changed the source file name extension of the test program from .s to .c resulting in compile fails. This, in turn, causes is_aarch32_target checks to fail. Change the test source from an assembly program to a C program using inline assembly. is_amd64_regs_target had a similar problem, which was fixed by commit 224d30d39365 testsuite: fix is_amd64_regs_target This fix — and commit message — are mostly copied from it. --- gdb/testsuite/lib/gdb.exp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) I'm not actually affected by this bug, and just noticed it because of the strange compilation error when building the aarch32.c test file: compiler exited with status 1 output is: /path/gdb/testsuite/temp/232375/aarch32.c:1:9: error: unknown type name 'mov' 1 | mov r0, r0 | ^~~ /path/gdb/testsuite/temp/232375/aarch32.c:2:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'mov' 2 | mov r1, r1 | ^~~ It only affects aarch64 machines with the aarch64 "execution domain"¹ (i.e., the default one) using a toolchain configured to produce 32-bit binaries. Our aarch32 systems are containers using the linux32 command, so GDB and DejaGNU see armv8l as the architecture/"execution domain" and is_aarch32_target works correctly. ¹ See setarch(8) man page. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 761a4f117568..59967c70cda9 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3937,13 +3937,16 @@ gdb_caching_proc is_aarch32_target {} { return 0 } - set list {} - foreach reg \ - {r0 r1 r2 r3} { - lappend list "\tmov $reg, $reg" - } + return [gdb_can_simple_compile aarch32 { + int main (void) { + asm ("\tmov r0, r0"); + asm ("\tmov r1, r1"); + asm ("\tmov r2, r2"); + asm ("\tmov r3, r3"); - return [gdb_can_simple_compile aarch32 [join $list \n]] + return 0; + } + }] } # Return 1 if this target is an aarch64, either lp64 or ilp32.