From patchwork Tue Mar 12 16:21:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 779763 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2108801wrt; Tue, 12 Mar 2024 09:22:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyADWT4MH/Zo+zq4aayMjWELtH2IQEAfWYlBcll6QyDMs4UjjXGLsEBsggPadK5+2onxgkgrlSi/UDbgN+O5gf X-Google-Smtp-Source: AGHT+IFRrgmGIFHR3eANx0l1dTNNu/QBGEdI1N+9dFxIhwCYfqyLLqfSElQMeaAKCUycjDllh2Qq X-Received: by 2002:a05:6214:9c2:b0:68f:709d:a47f with SMTP id dp2-20020a05621409c200b0068f709da47fmr10683940qvb.47.1710260549898; Tue, 12 Mar 2024 09:22:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710260549; cv=pass; d=google.com; s=arc-20160816; b=iFpozWE6GhDhAOnDjT97BOtEiYM/S3vaqaUY2VA388ELfjnkUnEfhM0Batod/eWJaX oKs+R5IBW6SYg/Pd6Gw/8yiA0ZbHvUL0HwiA8bzQi6269xXDUfKsrqtB6qeoMXcpm5o8 WsX8ZXzOv6wM8WmY+yPaA9VirfJxuZA0JHScoy8wiKrITTcDLO53oprKsoFpkVer5Dsv tITLJ8+Cwsx3XE4cCCGQthgwk9FGKPN0bEUGNyC16xjCcwBWgsM0ImyitXN8xFYEkML4 yQsJtHcC6HUduNOFJW2jOMtDlwR98GXrJZEspO24qtNuLJixAKK4OwxKRwEKPuHNMqBJ McGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=IXuZbGci6araf1psoT7pszenLYLi2fGoR+v1/z539yo=; fh=k4A9fGM2KUtA3m3HgvE6TF6MwPw8Oc7La+zAHJuZSnk=; b=T9p2GA6CmXJKwo+ifIDLVn0IB3jzig68K0TEm6vPQZeihtR3JAoawOSIkch0iagO+e dQKhJxRbyAWQlcgaXGWEmz0IQEZ6o4QoZ2ic+zxBN1ragfbq1unSZVNZmILGLJn9E85F e4+7nJcFuzJei+k+7/AyWBvuxgeOmMHQt4F82bKPH6rrgdOx8ViavVCD5Nbf4vF6i4N3 SFmLELW3KJXRN9EExHyF5jvIBZ251jiNpvg6bVBUSUSJ9Wj1VGdO1BAk2OGN9lgjoKG9 C4v/4ZR/hMDEttz6oXTE6Pdj50y4OyNJOF+u51GlgVJTzeu0tFAsFN3h2VWEfct+yTxR 76Vw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fwUq1kFp; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p17-20020a05620a113100b007883ff354c0si7672999qkk.84.2024.03.12.09.22.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fwUq1kFp; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-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 853BB3857B9B for ; Tue, 12 Mar 2024 16:22:29 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id CB4BE385841E for ; Tue, 12 Mar 2024 16:21:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB4BE385841E 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 CB4BE385841E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::636 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710260490; cv=none; b=HrtChvJ0vmBJbLrbM+IJyCio//mjmKEmIKfMEw70pM2GYO+2gW2XBCsB75cADVWQDlcUE4QXFhaqRMwgNWz0gs239sO+0ypbFNzq8sU63ONBPg1D5CYO8TdtSiLk2t2og9OvaV+5M+LF0dAQ7zzORG8SJyviVkSnrUTmD35chxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710260490; c=relaxed/simple; bh=7arUqFkaTo+/W3oRPhJ9Onmd8semfqBSFOBDQsPpI2g=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=xbOBvN/h1YHm+5rYcM6csMeB+zHQ1ct9qgDGHhXGOWOZJsjtpWg2ZpJ5000qXBBzpk6jcTyniLeNasE+0hUV1EOhLm0CvI1AhTARykW5a1nfH3Yj8nJSPi6C9R96TvLyDNtzLk+09ji9dw8z/AfWewF64D5R90yquy2Gf0ZR0e4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1dd68d4cff1so31672795ad.2 for ; Tue, 12 Mar 2024 09:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710260487; x=1710865287; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IXuZbGci6araf1psoT7pszenLYLi2fGoR+v1/z539yo=; b=fwUq1kFpEXlk/C7SymJqmuV76Yq4hXDL2eurhknsdU7KKR7nkELdlkW6BxohpPg8dT z7kgHhyF/iQLXP5HaNAFhsemMX4D51zzDALOvDpQBBXKRwzJyCRayyXiFKEi1XH3J24t 1Tk5KjFziMRIpUdPY+Gm7uQOn5ORtXFw9sqRTUb/wNPbKiib9HSal8oeJChGR1sBP9Fj MFsJ7aRYR7nBWxM/VsV/kR6WCfkGspJzvw150/EAAN0F6DR9iCUo9tvel/N+4Vo8IZnB D3CGvKon8QZSBOhUK+OwAQDO/RQnYv6qIRer6m81sP5s2BKRb1+16ZHcKqk5wfg/W0vN OOiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710260487; x=1710865287; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IXuZbGci6araf1psoT7pszenLYLi2fGoR+v1/z539yo=; b=WoJ58Cjru+iGHS4oJqp3wm2BWbwBWY8IJqTCJcO6njtGgnC6xeL0F6gVXbI1KiaoRP Ts+GuOobSt5u+VSOvGcX6iiv7nRmc01eFRjmkKxVzxFAyHHXOXWrLI6Akcxadums2rMg LV6/JGSCmcTne9hzthNq05iBZmUB4uPCLkcsc7vixV7N8ao0ly0eh7PFTitY2EfqEwAr NcbWZTMMa5p+sm6aHeG7laYUIdj8fchafjBEM/PdJHj8pmYUyekqStKCUq+dvKQtZfCT Ggi1yiB//WYx7abFBrrjFdMrR1rK9qXZ+3b847ddWF3KzhfbheZGoQRih6W3bD1TyMdx QI/w== X-Gm-Message-State: AOJu0YyiWw04+5WMQn6Q2teOqJT/KTDGMK+57lIai1Hvk67qkEARcgAM d+Ai1JSbGaB/U7alIHNjrAqDzc9QQ+sTsaJbZaneKedVB43wH4rKxJPaoSZEn11lIg9BLDErh2o T X-Received: by 2002:a17:902:bc8b:b0:1dc:2f30:e0dc with SMTP id bb11-20020a170902bc8b00b001dc2f30e0dcmr7452888plb.36.1710260487095; Tue, 12 Mar 2024 09:21:27 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:8dfd:281a:8caa:77d5:74db]) by smtp.gmail.com with ESMTPSA id o13-20020a170903008d00b001dbcf653017sm6913990pld.289.2024.03.12.09.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:21:26 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Szabolcs Nagy , "H . J . Lu" , Arjun Shankar Subject: [PATCH v2 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Date: Tue, 12 Mar 2024 13:21:18 -0300 Message-Id: <20240312162120.1360522-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240312162120.1360522-1-adhemerval.zanella@linaro.org> References: <20240312162120.1360522-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org So it does not fail for arm config that defaults to -mtp=soft (which issues a call to __aeabi_read_tp). Reviewed-by: H.J. Lu --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 59ff1e415d..117b48a421 100755 --- a/configure +++ b/configure @@ -7020,7 +7020,7 @@ void foo (void) } EOF if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles - conftest.c -o conftest 1>&5' + -shared conftest.c -o conftest 1>&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? diff --git a/configure.ac b/configure.ac index 65799e5685..19b88a47a5 100644 --- a/configure.ac +++ b/configure.ac @@ -1297,7 +1297,7 @@ void foo (void) } EOF if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles - conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD]) + -shared conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD]) then libc_cv_mtls_dialect_gnu2=yes else From patchwork Tue Mar 12 16:21:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 779761 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2108432wrt; Tue, 12 Mar 2024 09:21:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXytgdPjGqKj7j4Lt7mEmLHVP444uyDQZIIo1g0RwJTxCFylbmfNJI05WeKkeFMlhzTnTwO2na++CnkYDMZkSHs X-Google-Smtp-Source: AGHT+IEjMNQ8XR9YWda0De52oOcATQ9jr7VH9lD04chl7PVmOYeBaKzZujn7I+pmcxXQLUP6ua24 X-Received: by 2002:a4a:350b:0:b0:5a1:cbaf:a681 with SMTP id l11-20020a4a350b000000b005a1cbafa681mr579436ooa.0.1710260508908; Tue, 12 Mar 2024 09:21:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710260508; cv=pass; d=google.com; s=arc-20160816; b=E6uZYwkmzchA597Ztd+BisyFbAY6JrQht730rdt9KKVhjJIeV4vAYZuThZz6ittYvS /d5CAiBBjzAcnZXnP2AFsoz7oTLfP9NeeEdzRFAE5UbM0AsD0g1B87+mnf3LamY12BYV E1iXB+Z98cuW400WmB7D2dNbePPNKlUG81Y2kj1HnJSCNn4kxXEn7wtYi3x4m4XjRZCR fs+rDAGo4bfAkewvYLAhDbFBZb3gEEgYbdykDrKcUWrzGzLvXFgcP1HaFW4Z2Je8CzU0 wqBDjRz9ogAY1zuQsAZRxcT0gvmPKazkX3ts/ofISOiClmXRExEQzIr9OXc8A0i6A+MU PS8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=F6aUQzCIWzbjqVbcdfAW1Fo4Klr2WEBA0NnXD2m9mes=; fh=k4A9fGM2KUtA3m3HgvE6TF6MwPw8Oc7La+zAHJuZSnk=; b=IARGGZwdkfVMI5TIhUrmLD0m6aiMfZrIpCS/ZuSBBvWnk0dzuqLpQHlQUWl44ivs3d Q4xYIE6sPoH5HYr3bhNg7dd3DY3Wvo19FMIGGYAMcdnaEIz/eLCTBU8AIXTXP8mQowK0 OrTrY8MnvlskiLCmZYeM9sB1eTZ4y0aNmW19SqrEodB6PkndNwKi4Qx25q6fNj26vhXK 1UD8ZznXZedaDKhb2b0HvGZ++M9HYt0aQiPaJyLOaz4HsmPb6kCIFZs8kDrdCRFXaJZZ 363ylVdz2R5t+GPXpFYtkot/0WFkx7+EernNXrw+uU4Y25uRx6HGfjMa7rj0eGh07972 0UWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u3QrZoH5; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-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 o3-20020ab05443000000b007d9ff0125b8si1096994uaa.188.2024.03.12.09.21.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-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=u3QrZoH5; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-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 469FC3857C62 for ; Tue, 12 Mar 2024 16:21:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id ED654385801E for ; Tue, 12 Mar 2024 16:21:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED654385801E 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 ED654385801E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710260494; cv=none; b=bvfK6QM5jLvCx9nZPB7f6hHpJRKOtzZPvMaKYGVCCvwhLOH+BJCKS450pxKCTY5xx4UZRWoT9GBdIb2jpn7sKOvCeSUMrBZ3EZvoSrosFmzJVcrcvVO3ez3DVGMUKwN+IIKZKZqO3Thidg8TKmQvSFK17VdZkDdrwOiL70Bo90w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710260494; c=relaxed/simple; bh=PAlSD4YbfgGgoc7/6S8hHylegW2ZD4PEYYg4pjk3AlU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Rx3RILBEP9UM5/Yn9Kha0yjK2dts42Yhl3IUQdSzUDUYV4Ujpv4awawOp9U1XnIZnIAv6/5g2XFFzm02b+EbcunQz46t97iwK4a3LPnA2Jf4yYhegnEQKvKANR/BvSZvfELRlcv4I4UU1bBLC83k8310zoVif45Fn3zcDNVGlXk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1dd7df835a8so29495845ad.1 for ; Tue, 12 Mar 2024 09:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710260489; x=1710865289; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F6aUQzCIWzbjqVbcdfAW1Fo4Klr2WEBA0NnXD2m9mes=; b=u3QrZoH5WDhcEk9k7XhLthuee+mGo+/xZ7fbPRRN52AgzHPW2Ao9Lyu5GX02projK+ AnSy7z/FXhLJUmlk16gahBugrVo80NxdQgN7IrSPzrhASservWbsb43HoWzGl8t3zgpq ktBwPnLySKQOiljIA5Bl9kh8aA0nKiP3wCM+oqBvsurfQo56Ux5L551Kh3E827mdMJEX QDjnwuJdbMTxrCzoyM/nJQaOIUt+FqeM6kGludqhcGiFspG6hMtri/nLXGId4sEZ6MpK luEsOhs6c/svORMWEsGULhE0EOov81RWRR1FZ9liALvDQa9K+izURKjEt2Y1QqsDOv4G fBTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710260489; x=1710865289; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F6aUQzCIWzbjqVbcdfAW1Fo4Klr2WEBA0NnXD2m9mes=; b=tSA5bKJS8uRC71PcEYYprvs2biP8KU8awXEioDNdMc4j/jg9V5uraQHNaQenfWpee8 yGaZzAJrxFzGncQYBpQDrsSX3d9PrJRvu86GjaUtDUzTQkSOs67sP3Uvl97OZH6O/dpA 6jEQMlyng1R3sH1lQjRlFrDyfQYHQF3OrYHE959qeLk9+ef9VUCT6DnEbul09rddTN4n chSxrLu+0NdRhZ29/CoVpQ1/W2eGrycuhZ/U247aknOg/stfu43th6LMpF5fxHt7twhL Gho1G5pXsqTBFsA1vf+4WjXgBiYVRtCl0cvLu9BvCYapYhUPG1TEVz2quXLOeR4YwyGV yBvg== X-Gm-Message-State: AOJu0Yzoy3mgvVOupQsq9iFv7NNgsmRa3SdjF8hoECHoxOQSjewEFEP2 GqJQ8bYKOj7VByMioJKVyCacucgkL2dNB8kj/Yjs2For4sThlId6Gcrf9U0IUxh25RCLuogeyZ9 h X-Received: by 2002:a17:902:d491:b0:1db:f830:c381 with SMTP id c17-20020a170902d49100b001dbf830c381mr870719plg.44.1710260489211; Tue, 12 Mar 2024 09:21:29 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:8dfd:281a:8caa:77d5:74db]) by smtp.gmail.com with ESMTPSA id o13-20020a170903008d00b001dbcf653017sm6913990pld.289.2024.03.12.09.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:21:28 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Szabolcs Nagy , "H . J . Lu" , Arjun Shankar Subject: [PATCH v2 2/3] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) Date: Tue, 12 Mar 2024 13:21:19 -0300 Message-Id: <20240312162120.1360522-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240312162120.1360522-1-adhemerval.zanella@linaro.org> References: <20240312162120.1360522-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org ARM _dl_tlsdesc_dynamic slow path has two issues: * The ip/r12 is defined by AAPCS as a scratch register, and gcc is used to save the stack pointer before on some function calls. So it should also be saved/restored as well. It fixes the tst-gnu2-tls2. * None of the possible VFP registers are saved/restored. ARM has the additional complexity to have different VFP bank sizes (depending of VFP support by the chip). The tst-gnu2-tls2 test is extended to check for VFP registers, although only for hardfp builds. Different than setcontext, _dl_tlsdesc_dynamic does not have HWCAP_ARM_IWMMXT (I don't have a way to properly test it and it is almost a decade since newer hardware was released). With this patch there is no need to mark tst-gnu2-tls2 as XFAIL. Checked on arm-linux-gnueabihf. Reviewed-by: H.J. Lu --- config.h.in | 3 + elf/Makefile | 4 -- elf/tst-gnu2-tls2.h | 4 ++ elf/tst-gnu2-tls2mod0.c | 3 +- elf/tst-gnu2-tls2mod1.c | 3 +- elf/tst-gnu2-tls2mod2.c | 3 +- sysdeps/arm/configure | 32 +++++++++ sysdeps/arm/configure.ac | 15 +++++ sysdeps/arm/dl-tlsdesc.S | 70 +++++++++++++++++--- sysdeps/arm/tst-gnu2-tls2.h | 128 ++++++++++++++++++++++++++++++++++++ 10 files changed, 250 insertions(+), 15 deletions(-) create mode 100644 sysdeps/arm/tst-gnu2-tls2.h diff --git a/config.h.in b/config.h.in index 2f0669e19b..cf4212f5eb 100644 --- a/config.h.in +++ b/config.h.in @@ -141,6 +141,9 @@ /* LOONGARCH floating-point ABI for ld.so. */ #undef LOONGARCH_ABI_FRLEN +/* Define whether ARM used hard-float and support VFPvX-D32. */ +#undef HAVE_ARM_PCS_VFP_D32 + /* Linux specific: minimum supported kernel version. */ #undef __LINUX_KERNEL_VERSION diff --git a/elf/Makefile b/elf/Makefile index 520a270f0f..393a27ef2a 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3059,10 +3059,6 @@ $(objpfx)tst-gnu2-tls2.out: \ $(objpfx)tst-gnu2-tls2mod2.so ifeq (yes,$(have-mtls-dialect-gnu2)) -# This test fails if dl_tlsdesc_dynamic doesn't preserve all caller-saved -# registers. See https://sourceware.org/bugzilla/show_bug.cgi?id=31372 -test-xfail-tst-gnu2-tls2 = yes - CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=gnu2 CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=gnu2 CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=gnu2 diff --git a/elf/tst-gnu2-tls2.h b/elf/tst-gnu2-tls2.h index 77964a57a3..1ade8151e2 100644 --- a/elf/tst-gnu2-tls2.h +++ b/elf/tst-gnu2-tls2.h @@ -27,6 +27,10 @@ extern struct tls *apply_tls (struct tls *); /* An architecture can define them to verify that clobber caller-saved registers aren't changed by the implicit TLSDESC call. */ +#ifndef INIT_TLSDESC_CALL +# define INIT_TLSDESC_CALL() +#endif + #ifndef BEFORE_TLSDESC_CALL # define BEFORE_TLSDESC_CALL() #endif diff --git a/elf/tst-gnu2-tls2mod0.c b/elf/tst-gnu2-tls2mod0.c index 45556a0e17..3fe3c14277 100644 --- a/elf/tst-gnu2-tls2mod0.c +++ b/elf/tst-gnu2-tls2mod0.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include "tst-gnu2-tls2.h" +#include __thread struct tls tls_var0 __attribute__ ((visibility ("hidden"))); struct tls * apply_tls (struct tls *p) { + INIT_TLSDESC_CALL (); BEFORE_TLSDESC_CALL (); tls_var0 = *p; struct tls *ret = &tls_var0; diff --git a/elf/tst-gnu2-tls2mod1.c b/elf/tst-gnu2-tls2mod1.c index e10b9dbc0a..e210538468 100644 --- a/elf/tst-gnu2-tls2mod1.c +++ b/elf/tst-gnu2-tls2mod1.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include "tst-gnu2-tls2.h" +#include __thread struct tls tls_var1[100] __attribute__ ((visibility ("hidden"))); struct tls * apply_tls (struct tls *p) { + INIT_TLSDESC_CALL (); BEFORE_TLSDESC_CALL (); tls_var1[1] = *p; struct tls *ret = &tls_var1[1]; diff --git a/elf/tst-gnu2-tls2mod2.c b/elf/tst-gnu2-tls2mod2.c index 141af51e55..6d3031dc5f 100644 --- a/elf/tst-gnu2-tls2mod2.c +++ b/elf/tst-gnu2-tls2mod2.c @@ -16,13 +16,14 @@ License along with the GNU C Library; if not, see . */ -#include "tst-gnu2-tls2.h" +#include __thread struct tls tls_var2 __attribute__ ((visibility ("hidden"))); struct tls * apply_tls (struct tls *p) { + INIT_TLSDESC_CALL (); BEFORE_TLSDESC_CALL (); tls_var2 = *p; struct tls *ret = &tls_var2; diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure index 35e2918922..4ef4d46cbd 100644 --- a/sysdeps/arm/configure +++ b/sysdeps/arm/configure @@ -187,6 +187,38 @@ else default-abi = soft" fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether VFP supports 32 registers" >&5 +printf %s "checking whether VFP supports 32 registers... " >&6; } +if test ${libc_cv_arm_pcs_vfp_d32+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +void foo (void) +{ + asm volatile ("vldr d16,=17" : : : "d16"); +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + libc_cv_arm_pcs_vfp_d32=yes +else $as_nop + libc_cv_arm_pcs_vfp_d32=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcs_vfp_d32" >&5 +printf "%s\n" "$libc_cv_arm_pcs_vfp_d32" >&6; } +if test "$libc_cv_arm_pcs_vfp_d32" = yes ; +then + printf "%s\n" "#define HAVE_ARM_PCS_VFP_D32 1" >>confdefs.h + +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether PC-relative relocs in movw/movt work properly" >&5 printf %s "checking whether PC-relative relocs in movw/movt work properly... " >&6; } if test ${libc_cv_arm_pcrel_movw+y} diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac index 5172e30bbe..cd00ddc9d9 100644 --- a/sysdeps/arm/configure.ac +++ b/sysdeps/arm/configure.ac @@ -21,6 +21,21 @@ else LIBC_CONFIG_VAR([default-abi], [soft]) fi +AC_CACHE_CHECK([whether VFP supports 32 registers], + libc_cv_arm_pcs_vfp_d32, [ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +void foo (void) +{ + asm volatile ("vldr d16,=17" : : : "d16"); +} +]])], + [libc_cv_arm_pcs_vfp_d32=yes], + [libc_cv_arm_pcs_vfp_d32=no])]) +if test "$libc_cv_arm_pcs_vfp_d32" = yes ; +then + AC_DEFINE(HAVE_ARM_PCS_VFP_D32) +fi + AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly], libc_cv_arm_pcrel_movw, [ cat > conftest.s <<\EOF diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S index 764c56e70f..ada106521d 100644 --- a/sysdeps/arm/dl-tlsdesc.S +++ b/sysdeps/arm/dl-tlsdesc.S @@ -19,6 +19,7 @@ #include #include #include +#include #include "tlsdesc.h" .text @@ -83,14 +84,20 @@ _dl_tlsdesc_dynamic(struct tlsdesc *tdp) .align 2 _dl_tlsdesc_dynamic: /* Our calling convention is to clobber r0, r1 and the processor - flags. All others that are modified must be saved */ - eabi_save ({r2,r3,r4,lr}) - push {r2,r3,r4,lr} - cfi_adjust_cfa_offset (16) + flags. All others that are modified must be saved. r5 is + used as the hwcap value to avoid reload after __tls_get_addr + call. If required we will save the vector register on the slow + path. */ + eabi_save ({r2,r3,r4,r5,ip,lr}) + push {r2,r3,r4,r5,ip,lr} + cfi_adjust_cfa_offset (24) cfi_rel_offset (r2,0) cfi_rel_offset (r3,4) cfi_rel_offset (r4,8) - cfi_rel_offset (lr,12) + cfi_rel_offset (r5,12) + cfi_rel_offset (ip,16) + cfi_rel_offset (lr,20) + ldr r1, [r0] /* td */ GET_TLS (lr) mov r4, r0 /* r4 = tp */ @@ -113,22 +120,69 @@ _dl_tlsdesc_dynamic: rsbne r0, r4, r3 bne 2f 1: mov r0, r1 + + /* Load the hwcap to check for vector support. */ + ldr r2, 3f + ldr r1, .Lrtld_global_ro +0: add r2, pc, r2 + ldr r2, [r2, r1] + ldr r5, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET] + +#ifdef __SOFTFP__ + tst r5, #HWCAP_ARM_VFP + beq .Lno_vfp +#endif + + /* Store the VFP registers. Don't use VFP instructions directly + because this code is used in non-VFP multilibs. */ +#define VFP_STACK_REQ (32*8 + 8) + sub sp, sp, VFP_STACK_REQ + cfi_adjust_cfa_offset (VFP_STACK_REQ) + mov r3, sp + .inst 0xeca30b20 /* vstmia r3!, {d0-d15} */ + tst r5, #HWCAP_ARM_VFPD32 + beq 4f + .inst 0xece30b20 /* vstmia r3!, {d16-d31} */ + /* Store the floating-point status register. */ +4: .inst 0xeef12a10 /* vmrs r2, fpscr */ + str r2, [r3] +.Lno_vfp: bl __tls_get_addr rsb r0, r4, r0 +#ifdef __SOFTFP__ + tst r5, #HWCAP_ARM_VFP + beq 2f +#endif + mov r3, sp + .inst 0xecb30b20 /* vldmia r3!, {d0-d15} */ + tst r5, #HWCAP_ARM_VFPD32 + beq 5f + .inst 0xecf30b20 /* vldmia r3!, {d16-d31} */ + ldr r4, [r3] +5: .inst 0xeee14a10 /* vmsr fpscr, r4 */ + add sp, sp, VFP_STACK_REQ + cfi_adjust_cfa_offset (-VFP_STACK_REQ) + 2: #if ((defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)) \ || defined (ARM_ALWAYS_BX)) - pop {r2,r3,r4, lr} - cfi_adjust_cfa_offset (-16) + pop {r2,r3,r4,r5,ip, lr} + cfi_adjust_cfa_offset (-20) cfi_restore (lr) + cfi_restore (ip) + cfi_restore (r5) cfi_restore (r4) cfi_restore (r3) cfi_restore (r2) bx lr #else - pop {r2,r3,r4, pc} + pop {r2,r3,r4,r5,ip, pc} #endif eabi_fnend cfi_endproc .size _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic + +3: .long _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS +.Lrtld_global_ro: + .long C_SYMBOL_NAME(_rtld_global_ro)(GOT) #endif /* SHARED */ diff --git a/sysdeps/arm/tst-gnu2-tls2.h b/sysdeps/arm/tst-gnu2-tls2.h new file mode 100644 index 0000000000..e413ac21fb --- /dev/null +++ b/sysdeps/arm/tst-gnu2-tls2.h @@ -0,0 +1,128 @@ +/* Test TLSDESC relocation. ARM version. + Copyright (C) 2024 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include + +#ifndef __SOFTFP__ + +# ifdef HAVE_ARM_PCS_VFP_D32 +# define SAVE_VFP_D32 \ + asm volatile ("vldr d16,=17" : : : "d16"); \ + asm volatile ("vldr d17,=18" : : : "d17"); \ + asm volatile ("vldr d18,=19" : : : "d18"); \ + asm volatile ("vldr d19,=20" : : : "d19"); \ + asm volatile ("vldr d20,=21" : : : "d20"); \ + asm volatile ("vldr d21,=22" : : : "d21"); \ + asm volatile ("vldr d22,=23" : : : "d22"); \ + asm volatile ("vldr d23,=24" : : : "d23"); \ + asm volatile ("vldr d24,=25" : : : "d24"); \ + asm volatile ("vldr d25,=26" : : : "d25"); \ + asm volatile ("vldr d26,=27" : : : "d26"); \ + asm volatile ("vldr d27,=28" : : : "d27"); \ + asm volatile ("vldr d28,=29" : : : "d28"); \ + asm volatile ("vldr d29,=30" : : : "d29"); \ + asm volatile ("vldr d30,=31" : : : "d30"); \ + asm volatile ("vldr d31,=32" : : : "d31"); +# else +# define SAVE_VFP_D32 +# endif + +# define INIT_TLSDESC_CALL() \ + unsigned long hwcap = getauxval (AT_HWCAP) + +/* Set each vector register to a value from 1 to 32 before the TLS access, + dump to memory after TLS access, and compare with the expected values. */ + +# define BEFORE_TLSDESC_CALL() \ + if (hwcap & HWCAP_ARM_VFP) \ + { \ + asm volatile ("vldr d0,=1" : : : "d0"); \ + asm volatile ("vldr d1,=2" : : : "d1"); \ + asm volatile ("vldr d2,=3" : : : "d1"); \ + asm volatile ("vldr d3,=4" : : : "d3"); \ + asm volatile ("vldr d4,=5" : : : "d4"); \ + asm volatile ("vldr d5,=6" : : : "d5"); \ + asm volatile ("vldr d6,=7" : : : "d6"); \ + asm volatile ("vldr d7,=8" : : : "d7"); \ + asm volatile ("vldr d8,=9" : : : "d8"); \ + asm volatile ("vldr d9,=10" : : : "d9"); \ + asm volatile ("vldr d10,=11" : : : "d10"); \ + asm volatile ("vldr d11,=12" : : : "d11"); \ + asm volatile ("vldr d12,=13" : : : "d12"); \ + asm volatile ("vldr d13,=14" : : : "d13"); \ + asm volatile ("vldr d14,=15" : : : "d14"); \ + asm volatile ("vldr d15,=16" : : : "d15"); \ + } \ + if (hwcap & HWCAP_ARM_VFPD32) \ + { \ + SAVE_VFP_D32 \ + } + +# define VFP_STACK_REQ (16*8) +# if __BYTE_ORDER == __BIG_ENDIAN +# define DISP 7 +# else +# define DISP 0 +# endif + +# ifdef HAVE_ARM_PCS_VFP_D32 +# define CHECK_VFP_D32 \ + char vfp[VFP_STACK_REQ]; \ + asm volatile ("vstmia %0, {d16-d31}\n" \ + : \ + : "r" (vfp) \ + : "memory"); \ + \ + char expected[VFP_STACK_REQ] = { 0 }; \ + for (int i = 0; i < 16; ++i) \ + expected[i * 8 + DISP] = i + 17; \ + \ + if (memcmp (vfp, expected, VFP_STACK_REQ) != 0) \ + abort (); +# else +# define CHECK_VFP_D32 +# endif + +# define AFTER_TLSDESC_CALL() \ + if (hwcap & HWCAP_ARM_VFP) \ + { \ + char vfp[VFP_STACK_REQ]; \ + asm volatile ("vstmia %0, {d0-d15}\n" \ + : \ + : "r" (vfp) \ + : "memory"); \ + \ + char expected[VFP_STACK_REQ] = { 0 }; \ + for (int i = 0; i < 16; ++i) \ + expected[i * 8 + DISP] = i + 1; \ + \ + if (memcmp (vfp, expected, VFP_STACK_REQ) != 0) \ + abort (); \ + } \ + if (hwcap & HWCAP_ARM_VFPD32) \ + { \ + CHECK_VFP_D32 \ + } + +#endif /* __SOFTFP__ */ + +#include_next From patchwork Tue Mar 12 16:21:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 779762 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2108466wrt; Tue, 12 Mar 2024 09:21:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/y+Zmx2pNGpszTd8EAVMRZbHc6gJQMe3qrPeqh9BpfLtjm1B71M/7gCAkq+klUz3nefQMFE8IZWiZSCKhycxx X-Google-Smtp-Source: AGHT+IG/2CE4ql4SlIthXHYh0Tz3A0PukEbLZseenpL2HE+fNra+ipsUvE1Nf0UuO6ocCS10V+4a X-Received: by 2002:a67:f9c4:0:b0:473:2d09:3965 with SMTP id c4-20020a67f9c4000000b004732d093965mr6086097vsq.6.1710260512718; Tue, 12 Mar 2024 09:21:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710260512; cv=pass; d=google.com; s=arc-20160816; b=wZkF98C6Ujw3F/dmAgn6bmWw0LefguSbSyO5qE9B4Fh1mo26FuAF+VBq1eGtlNRajR Mm3wTcrR8UrJwxFnTDZh3KeJghuvvC0JXcdT4uaZj8vNoifoojzma3L/TvGQySi52ZTY QNak945U6wkwKgSxmMTemK0pE03ttMtMQY1/ZG+T//wPtgmBFDrUwtXq3N8+hkiuTvgr Nttp9XPDd3f/hhbCswrpfK8wPxQEdbz1vy6XlQbwkTe3ONXlc5N6U6HqH/yfDymZdc26 SsEgFuZmx7txD3swBqYX5SG2v1cTbTsUo7A958cmrzWci9uWHmRWXej8d1bDKYEDXFdb 9wug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=1/FKsj9cIACqPMko/t8kADkXYb48AHb7bVN6uODKQHs=; fh=k4A9fGM2KUtA3m3HgvE6TF6MwPw8Oc7La+zAHJuZSnk=; b=zZmuu7dOFpAQJ5CZy5M/nydPf4+WV8C1DvWU/HuviweLcZCOxoYr3586oyNaNR+Cwr hxOyuv2+nFHf2b0m7g4DLSlBjkKkO5r2FgXerStE201k7TAK7bgaqpNF5FOp0ocAH7Ky hfuujhOjp1lujt3DypbXN2AjOXrFVceOlBzenzte2PZQwGyI5JaJZuC4Qr1xO4gbPErw aMsmdSLAG5p0yCroS6TzVG4z8+wRTRm0K0Be2hRfEWvl4TONxmQoVL5OudZ+nY5pP+P4 j5bxpN5fGrKvl5x4w8aXA+P3eyLYVP4AjA4s2rfUMJJMz/72nDmpE8cafXbNCCEMNgxi /6UA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tNS4GQE1; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-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 j17-20020a056102241100b00470732c6d75si764797vsi.695.2024.03.12.09.21.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-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=tNS4GQE1; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-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 4BE223858032 for ; Tue, 12 Mar 2024 16:21:52 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id E0BF0385828D for ; Tue, 12 Mar 2024 16:21:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0BF0385828D 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 E0BF0385828D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710260498; cv=none; b=UqA/bqULZ+7RF6/7H7loF6T3frWhBKeouJQ5YTliv28dJADB63d2Ay6ljWkMcy+2hYHIn3bX3bgEjF3DPyyVGeXzLfMt+OLZSBhNPcPnFkCHgMZVnEWN2ZpeGhOXf+OXK/MZQiq3baH8Ymb+irBXpiXhA1LVIUvoF+ra+C9sdhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710260498; c=relaxed/simple; bh=+G8uwsJP27xAkuyYIedqTq0auvYCnK2pR2lH5ECBqjs=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Xnp/OP2UaTTn1vg2Z8NQc4DgNMLtUcnPwPEScGluk7LIRLOeCdxBPsty/uK3LTYtlRKaMgh1oNZfLd3O4pUFEwN4Poi1U54Mj2PseP19CN6NtbZd3VwGz3GuCerosKjrKHjXfWo/Rx1en1euMfkO3elrTzukg4onTPb7Gxmhl8s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1dd955753edso22547355ad.1 for ; Tue, 12 Mar 2024 09:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710260491; x=1710865291; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1/FKsj9cIACqPMko/t8kADkXYb48AHb7bVN6uODKQHs=; b=tNS4GQE19lr6yWdoziAccczdkPMpeLGoeF5Rn5HuL6O/Bslf7VziFTP8qJPOwgQxub ZGDqNQA4tji1UQXxTwDATU2Z7xLPP5redffifszWSkB8UoCravtW/TTHki83xNItjntS FzyhwIJd/jA91z9M65D6xh/HU9A9unwxH5zovBoZ+Io2Ln+YSEyDki1EpC3a2rO8nZGj iXskQD1Oa8Qqt/H4nP986MblPXbSaqTRnjUUFiE+8NxmmNqMUDAxQhqqs3pHMGAng4in vpH35PGlbmj/9txYQ6AEZIcAl2pzC1H+2dawwgQLwiLAYb/x1l+YfkMG17cUy7JyAC3q u1xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710260491; x=1710865291; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1/FKsj9cIACqPMko/t8kADkXYb48AHb7bVN6uODKQHs=; b=e78V2/GtRy6QHfgDKy8nPm3MjeOVVDBADdYPMS+bNk2eS2jMlecQyBCUCnKf1Gr5c9 CfzV2+s3UxxelPNCbL/YDCpVPl11nLBfgxT64QuDsy+wSOSPDHz5IOCaUr13evFdmQV3 pBXh1Jd28n2mfBFaPLVpsmM1cTkb5Wg4UmAy2On/L10ZGV+Sx6ig+vfQBDg9xmdlO7bX OgM1KIeAGzbPbeTAZPOgwu0W5SWrJYDX6zQUs8d404S8br0Mq+p6DR3tskiQunEJg98k kdLuGbxoyiVPOPFJ/ww43mqO5fZl1zShHDOyLMUEG9zPA5jrG9m2xH0/N0IztiaTfpC9 FENg== X-Gm-Message-State: AOJu0Ywpgeq8MNRUyMmwUgfMfxkLCkbZT0akskUnNQeBMcbdaJDwaag5 sOnrISeSunhGgSYtnekzhEnu44jtVImPIcxtgf2Yym9BkYBXxts/qeHMq6PCCOcQRkr+fRjE1Lm o X-Received: by 2002:a17:902:7b95:b0:1dc:418f:890b with SMTP id w21-20020a1709027b9500b001dc418f890bmr8833075pll.40.1710260491249; Tue, 12 Mar 2024 09:21:31 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:8dfd:281a:8caa:77d5:74db]) by smtp.gmail.com with ESMTPSA id o13-20020a170903008d00b001dbcf653017sm6913990pld.289.2024.03.12.09.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 09:21:30 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Szabolcs Nagy , "H . J . Lu" , Arjun Shankar Subject: [PATCH v2 3/3] elf: Enable TLS descriptor tests on aarch64 Date: Tue, 12 Mar 2024 13:21:20 -0300 Message-Id: <20240312162120.1360522-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240312162120.1360522-1-adhemerval.zanella@linaro.org> References: <20240312162120.1360522-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org The aarch64 uses 'trad' for traditional tls and 'desc' for tls descriptors, but unlike other targets it defaults to 'desc'. The gnutls2 configure check does not set aarch64 as an ABI that uses TLS descriptors, which then disable somes stests. Also rename the internal machinery fron gnu2 to tls descriptors. Checked on aarch64-linux-gnu. Reviewed-by: H.J. Lu --- configure | 23 +++++++++++++---------- configure.ac | 15 +++++++++------ elf/Makefile | 26 +++++++++++++------------- sysdeps/aarch64/preconfigure | 1 + sysdeps/arm/Makefile | 8 ++++---- 5 files changed, 40 insertions(+), 33 deletions(-) diff --git a/configure b/configure index 117b48a421..432e40a592 100755 --- a/configure +++ b/configure @@ -653,7 +653,7 @@ LIBGD libc_cv_cc_loop_to_function libc_cv_cc_submachine libc_cv_cc_nofma -libc_cv_mtls_dialect_gnu2 +libc_cv_mtls_descriptor libc_cv_has_glob_dat libc_cv_fpie libc_cv_z_execstack @@ -4760,6 +4760,9 @@ libc_config_ok=no # whether to use such directories. with_fp_cond=1 +# A preconfigure script may define another name to TLS descriptor variant +mtls_descriptor=gnu2 + if frags=`ls -d $srcdir/sysdeps/*/preconfigure 2> /dev/null` then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysdeps preconfigure fragments" >&5 @@ -7006,9 +7009,9 @@ fi printf "%s\n" "$libc_cv_has_glob_dat" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -mtls-dialect=gnu2" >&5 -printf %s "checking for -mtls-dialect=gnu2... " >&6; } -if test ${libc_cv_mtls_dialect_gnu2+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tls descriptor support" >&5 +printf %s "checking for tls descriptor support... " >&6; } +if test ${libc_cv_mtls_descriptor+y} then : printf %s "(cached) " >&6 else $as_nop @@ -7019,7 +7022,7 @@ void foo (void) i = 10; } EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles -shared conftest.c -o conftest 1>&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 @@ -7027,17 +7030,17 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nost printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - libc_cv_mtls_dialect_gnu2=yes + libc_cv_mtls_descriptor=$mtls_descriptor else - libc_cv_mtls_dialect_gnu2=no + libc_cv_mtls_descriptor=no fi rm -f conftest* fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_dialect_gnu2" >&5 -printf "%s\n" "$libc_cv_mtls_dialect_gnu2" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_descriptor" >&5 +printf "%s\n" "$libc_cv_mtls_descriptor" >&6; } config_vars="$config_vars -have-mtls-dialect-gnu2 = $libc_cv_mtls_dialect_gnu2" +have-mtls-descriptor = $libc_cv_mtls_descriptor" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if -Wno-ignored-attributes is required for aliases" >&5 printf %s "checking if -Wno-ignored-attributes is required for aliases... " >&6; } diff --git a/configure.ac b/configure.ac index 19b88a47a5..bdc385d03c 100644 --- a/configure.ac +++ b/configure.ac @@ -442,6 +442,9 @@ libc_config_ok=no # whether to use such directories. with_fp_cond=1 +# A preconfigure script may define another name to TLS descriptor variant +mtls_descriptor=gnu2 + dnl Let sysdeps/*/preconfigure act here. LIBC_PRECONFIGURE([$srcdir], [for sysdeps]) @@ -1287,7 +1290,7 @@ fi rm -f conftest*]) AC_SUBST(libc_cv_has_glob_dat) -AC_CACHE_CHECK([for -mtls-dialect=gnu2], libc_cv_mtls_dialect_gnu2, +AC_CACHE_CHECK([for tls descriptor support], libc_cv_mtls_descriptor, [dnl cat > conftest.c <&AS_MESSAGE_LOG_FD]) then - libc_cv_mtls_dialect_gnu2=yes + libc_cv_mtls_descriptor=$mtls_descriptor else - libc_cv_mtls_dialect_gnu2=no + libc_cv_mtls_descriptor=no fi rm -f conftest*]) -AC_SUBST(libc_cv_mtls_dialect_gnu2) -LIBC_CONFIG_VAR([have-mtls-dialect-gnu2], [$libc_cv_mtls_dialect_gnu2]) +AC_SUBST(libc_cv_mtls_descriptor) +LIBC_CONFIG_VAR([have-mtls-descriptor], [$libc_cv_mtls_descriptor]) dnl clang emits an warning for a double alias redirection, to warn the dnl original symbol is sed even when weak definition overrides it. diff --git a/elf/Makefile b/elf/Makefile index 393a27ef2a..4f1903391a 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1001,13 +1001,13 @@ modules-names-tests = $(filter-out ifuncmod% tst-tlsmod%,\ # For +depfiles in Makerules. extra-test-objs += tst-auditmod17.os -ifeq (yes,$(have-mtls-dialect-gnu2)) +ifneq (no,$(have-mtls-descriptor)) tests += tst-gnu2-tls1 modules-names += tst-gnu2-tls1mod $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so tst-gnu2-tls1mod.so-no-z-defs = yes -CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2 -endif # $(have-mtls-dialect-gnu2) +CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=$(have-mtls-descriptor) +endif # $(have-mtls-descriptor) ifeq (yes,$(have-protected-data)) modules-names += tst-protected1moda tst-protected1modb @@ -2975,11 +2975,11 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \ $(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \ $(objpfx)tst-audit-tlsdesc-mod2.so \ $(shared-thread-library) -ifeq (yes,$(have-mtls-dialect-gnu2)) +ifneq (no,$(have-mtls-descriptor)) # The test is valid for all TLS types, but we want to exercise GNU2 # TLS if possible. -CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2 -CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2 +CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=$(have-mtls-descriptor) endif $(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library) $(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \ @@ -3058,11 +3058,11 @@ $(objpfx)tst-gnu2-tls2.out: \ $(objpfx)tst-gnu2-tls2mod1.so \ $(objpfx)tst-gnu2-tls2mod2.so -ifeq (yes,$(have-mtls-dialect-gnu2)) -CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=gnu2 -CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=gnu2 -CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=gnu2 -CFLAGS-tst-gnu2-tls2mod0.c += -mtls-dialect=gnu2 -CFLAGS-tst-gnu2-tls2mod1.c += -mtls-dialect=gnu2 -CFLAGS-tst-gnu2-tls2mod2.c += -mtls-dialect=gnu2 +ifneq (no,$(have-mtls-descriptor)) +CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-gnu2-tls2mod0.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-gnu2-tls2mod1.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-gnu2-tls2mod2.c += -mtls-dialect=$(have-mtls-descriptor) endif diff --git a/sysdeps/aarch64/preconfigure b/sysdeps/aarch64/preconfigure index d9bd1f8558..19657b627b 100644 --- a/sysdeps/aarch64/preconfigure +++ b/sysdeps/aarch64/preconfigure @@ -2,5 +2,6 @@ case "$machine" in aarch64*) base_machine=aarch64 machine=aarch64 + mtls_descriptor=desc ;; esac diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile index d5cea717a9..619474eca9 100644 --- a/sysdeps/arm/Makefile +++ b/sysdeps/arm/Makefile @@ -13,15 +13,15 @@ $(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os lib-noranlib: $(objpfx)libgcc-stubs.a ifeq ($(build-shared),yes) -ifeq (yes,$(have-mtls-dialect-gnu2)) +ifneq (no,$(have-mtls-descriptor)) tests += tst-armtlsdescloc tst-armtlsdescextnow tst-armtlsdescextlazy modules-names += tst-armtlsdesclocmod modules-names += tst-armtlsdescextlazymod tst-armtlsdescextnowmod CPPFLAGS-tst-armtlsdescextnowmod.c += -Dstatic= CPPFLAGS-tst-armtlsdescextlazymod.c += -Dstatic= -CFLAGS-tst-armtlsdesclocmod.c += -mtls-dialect=gnu2 -CFLAGS-tst-armtlsdescextnowmod.c += -mtls-dialect=gnu2 -CFLAGS-tst-armtlsdescextlazymod.c += -mtls-dialect=gnu2 +CFLAGS-tst-armtlsdesclocmod.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-armtlsdescextnowmod.c += -mtls-dialect=$(have-mtls-descriptor) +CFLAGS-tst-armtlsdescextlazymod.c += -mtls-dialect=$(have-mtls-descriptor) LDFLAGS-tst-armtlsdescextnowmod.so += -Wl,-z,now tst-armtlsdescloc-ENV = LD_BIND_NOW=1 tst-armtlsdescextnow-ENV = LD_BIND_NOW=1