From patchwork Thu Feb 29 19:46:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 776900 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1004519wrn; Thu, 29 Feb 2024 11:48:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWgrrxYzCblQFAdQaG5OhodJQ3WN1hZAoabyhm3m2c5zQpNir3tBk8JuJIk26+rpeD+UDU6Hs69JFQ5NA32/peC X-Google-Smtp-Source: AGHT+IGMwthjhaLkyOLYTr34wHFhtPcURA9KGY1A03UpTL6psg73sPbihREmsyiTiA9cTzB4F/Yj X-Received: by 2002:ac8:4e55:0:b0:42e:aa98:f35 with SMTP id e21-20020ac84e55000000b0042eaa980f35mr3431055qtw.66.1709236083985; Thu, 29 Feb 2024 11:48:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709236083; cv=pass; d=google.com; s=arc-20160816; b=MxmnuEUq7Q1D6lZyKM9xZzmVXd9Ory2i8kwc65eJBu6J4f9zbnd0Khnzs7fATEFA+Q OnCk0wvnhBsB2XNGxCk5TP9usYbxkEB51jcgJG+21ZjPrUF5GAxVmGJlSwRhjUksr0/5 CnhB9oH3Q92a3ESm4fvQ3ggclcvogGB8/0s6tfrQxh1vHBsiHFBvQoWRC1neRtuiOwjx hriWu4ixQ08xBt+fbzw4tYCON9hFYH+JObKeaqZtd449+tzvinvBJS7F/oFj+lqY4fa7 Qh753nE1pLe9KtsPFIAzzE7YF+OBwi85P9j0C6judcYmElfFYHxYfbFHUF6CWsiOZIXE S/Sg== 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=MJR92ySGcLAUEr/RiArHg/xnmWQ1MLj8la+pJNWsNHQ=; fh=r/+2bI1lru/Vq/uHJOEmQnAizPQ/CjrMEWBQn8qzvus=; b=W+DqCy92WBjmfHZGrhL8710KUnzhi13xDBJNDnpfxBz+wNCAPnEqQ0xZtUrbz64tJf vBIvbhErtbYl3uBVk6B2poU5/8yjSox4+cbtvRJgEsKN8K2MtTD7ndbzmKtF0ws4YnWU 2qoAlyOappWmNZU5OOtNoRkbFMwW6c/1RLk4+vjv4XLgjl/xn6ido4a9WBympsgE0glV keu/Eg/HtmsqaUVEKuG4hvoMru/bmC7OSrwdb5nnuOxOBxRSDSFMHxyrJAbEFubq2xxs m/PFc+3cDkdVUB6Kzrzl+XM+YOAOr1tF9KyKCGOL1N4uw6NT7DFOAHsT8AYmPWPtFZiM IKGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BIGDrB63; 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 g2-20020ac85d42000000b0042ec2a49e0bsi1215169qtx.441.2024.02.29.11.48.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:48:03 -0800 (PST) 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=BIGDrB63; 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 A0D1C3858017 for ; Thu, 29 Feb 2024 19:48:03 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id 3E76F385829A for ; Thu, 29 Feb 2024 19:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E76F385829A 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 3E76F385829A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::102f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709236013; cv=none; b=NqZf7GseaUXz6SvcUtuB6rWS7yKDxPHdyqTXJmETrcyYNQ7msQl3TyvKki2reoL5pPZ+XbJtOlW4G646OuDwtdQbKGOpT1KiJx/q8j3zKFSenQ1PHmYWsSAtHI+m53D2G+PUN+/KiJNM3iEzyCvbOElU4n1fc57WJ/Egi8eJCCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709236013; c=relaxed/simple; bh=9wQSkZIhXvyacN+wia2LRkuuffeqRF2czoReUDUGroo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=VxTB0F3tU8M9TcEnJu/CKnncns/eRrWLuVjLC40QlRsjtWVKE281HaGVzpIzI1P5tg5NZs/cG8cAuAg0BickR6keQoNKYFhpx2IN/A4ZtAGwW62imygoqRMwj4LUERkcHizGd+BGkDUgu9Xa9rbvP6VdeUvFT+7Wx2c3WlTdgfg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-29954bb87b4so963622a91.2 for ; Thu, 29 Feb 2024 11:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709236009; x=1709840809; 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=MJR92ySGcLAUEr/RiArHg/xnmWQ1MLj8la+pJNWsNHQ=; b=BIGDrB63xR7h2LloHRnbbQTV7NT8yZx6/YWgzvXk410lDKFYWs1PhBR9whA9YDMjq5 5Zt/XkpuoeLUqjwOD1MA8fYBrx0M9+uElIPQw1jxY9dTEEsXeAx7+P2XcJxWpFP/MpD+ m8kBT86tdSKmLa93A5RPh+MsXZQ3XiPwnKIOglr3LJ0O3oELU0OvVB3+AlQwSJpEYXSE Lx3TIMd7HFnI4ai4LmgeVr9BwI23sa5GVw7Up+EikCELshIMconD9/qr9nLpFFVz0FmW zyYIqfrrVuRFJhu7u9XxjiL63JmIbWCheI7Cau4MG4OQrbCb2asvdSi8UpvSvGmj1a4m aqXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709236009; x=1709840809; 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=MJR92ySGcLAUEr/RiArHg/xnmWQ1MLj8la+pJNWsNHQ=; b=okYCJ0VtbQ9zTQNQ2Py8qwzgnDmmkZ7Ha702T8+n+56DGuEpwvoU3Y6wvvJ420AieE Foag9RWMAHcuFtfC8nOYpey1h5I2HIKUXrYvL17NMTBZopq8Afb2csy1M8iaL3zBmxvs 4zpYpWcJNXx9ogyqqHjfaimfRGR3pLjJ0+zoe4nptN8zk5eyaFIG1mv4jDjaKhYCurxm tTjTsQVSXVUZp9BXCL+8sx2q34K3/ZPi8nj+vsigwqWjLBdYjTP29NdbkOoL4dhAlfQf PiBuYkD06wfPVYOh2DXsrTHsBkB3vVZeaLea9xl+JvHJtZ/XyM3/5P04x1CXgJPtIq2W Vl2A== X-Gm-Message-State: AOJu0YwBwEqMq18hUc0MUlWlAYG43AamKWdVHeBCHk8dkWJzs2PzwfFC ukn0uAzRDQsFSHYbjPVWNl+MJk15FoMoP1/NWwhkrr3Eyfhl+ebB8Rwe5uCNMD0uUDqrHoyNd/V F X-Received: by 2002:a17:90b:3bd0:b0:29a:a37f:22c6 with SMTP id ph16-20020a17090b3bd000b0029aa37f22c6mr40543pjb.28.1709236009480; Thu, 29 Feb 2024 11:46:49 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:3a1a:a62d:15eb:5bb4:832d]) by smtp.gmail.com with ESMTPSA id cz13-20020a17090ad44d00b0029ad44cc063sm3957206pjb.35.2024.02.29.11.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:46:48 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Szabolcs Nagy , "H . J . Lu" Subject: [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Date: Thu, 29 Feb 2024 16:46:40 -0300 Message-Id: <20240229194642.3398122-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240229194642.3398122-1-adhemerval.zanella@linaro.org> References: <20240229194642.3398122-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 is not fail for arm config that defaults to -mtp=soft (which issues a call to __aeabi_read_tp). --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 59ff1e415d..ab8a10ed92 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' + -Wl,--unresolved-symbols=ignore-all 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..4bb9aeef95 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]) + -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD]) then libc_cv_mtls_dialect_gnu2=yes else From patchwork Thu Feb 29 19:46:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 776898 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1004247wrn; Thu, 29 Feb 2024 11:47:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVBzS0Urpj1incdv/+lDP7iFw7N2h3YDguAR9/vdsXN4LyjgylLEmj+vn7X/K2vgX+52s2LkQIhZXa+i0gnghyt X-Google-Smtp-Source: AGHT+IFJ2OmBZQSpayKliZVgxMVJAviQnyuGdbzQSqvWU6BUXH6y9FAnjR1l79GrqO9gPtZ6LHNS X-Received: by 2002:a0c:f706:0:b0:690:4d7:f5a2 with SMTP id w6-20020a0cf706000000b0069004d7f5a2mr3478418qvn.1.1709236032173; Thu, 29 Feb 2024 11:47:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709236032; cv=pass; d=google.com; s=arc-20160816; b=lTwu8lzYXAbKk/cSnLnZMHVGjTO02Eh+9d6VuoBlvgmjsaYDRkYBknsR41rrR5TN7J zOurWNMixh4dTA052o6GWtYaYXg2Rm4rIrXoM4DByybsiGVkG4xahKPDcjZUxh+PiT2C BdDoClJegpQUVsTr02WG49DOHNkPB2wv5qTYEEysegTSpdyWTvtyw1kCFLfzGzuJUhiK ozC0MtAzzasdnCh3Ad8zf0Tm0lGTL5c/C6opLQ9GlYVwIzk95DhXsVmfWqaxDOE9E7Mc pKEeAv8tlHUdQx0BRICZ5KWzJtQ5412yvFgECSJiJ1a2XCBDGNQ1JIzvWndXNT5F0S5l SF4A== 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=ca983BidQhF3kXBuG5kdBy2pJtGa1jO9/93kM7+2dOI=; fh=r/+2bI1lru/Vq/uHJOEmQnAizPQ/CjrMEWBQn8qzvus=; b=GLmlNRuZWDTu5hw2cMy56j/ve5wM/S7c52F/SLrOD65xBHTMxNoXb3OHlTGCKd/Tqu P686XTNQZfHmrAeMGr+5Sc98XQmvHecnKzpuLrZks5a3VI5+DOotrbAtf4MiZA3rUuOM KS08PtY+onRcO0boN1hoACY7JyBEj7El0Z2IG6p6vwc4kJY5xbpUAm0cr7KC8BibWsR5 ZbWCXTHqGGAJUqyiXqraZ2f9i4hcsgBCjw/spSxM4COAOWXdwUeG4Racln6Og/qnlqd+ YfYUB8ITLH1/DdW1ylYkNptu7M5CKhv9jydJ3cN2UpfEghUsVWzd3fldCi0QM0V0RbKT 6bUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W/aCiBV+"; 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 a2-20020a0562140c2200b0068ed85b0d64si1901885qvd.381.2024.02.29.11.47.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:47:12 -0800 (PST) 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="W/aCiBV+"; 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 B8A53385802F for ; Thu, 29 Feb 2024 19:47:11 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 42B863858286 for ; Thu, 29 Feb 2024 19:46:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42B863858286 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 42B863858286 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1033 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709236016; cv=none; b=rvxOWLaSm2hOQhQ3sCsWjmbEZFfFOvUqL80/yFcIyuqEOdvYboy8CH3ROKiEs0MmLOlT9cifW5aJTWQ6pH6VZIzixKfF4u3hJiOpr0ogCMeg7i/yzduBrDlewp4voGlcCqHRJFXx3lzt1XDG273w3qNJBVMe9e1bRCJwbQSyV+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709236016; c=relaxed/simple; bh=7eaQxvqnYtiyRHo4ycuj/UD7og1JQccObCkNQ9KnC8c=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=E0Vl7iD/Ie7SW+7q4owH4yuagUuN+gDS5pO6WjaPEhY0jh/0kqKoIpWcxMn87xSOus9oprSLWDvHYj0profar90mhWEMuWeJq9jxplx0LyUCW4wKS9oCiqPPW1v3qSSA64pDWe477qyNoiogFMOMfQgu/CyelC3UP49Izy/eO64= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-29a858a0981so978341a91.0 for ; Thu, 29 Feb 2024 11:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709236011; x=1709840811; 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=ca983BidQhF3kXBuG5kdBy2pJtGa1jO9/93kM7+2dOI=; b=W/aCiBV+9giRCdO+4K6IeLLxoudskxou72BIK1Dp1Zkqb7bbd+2OgQST3DmhmuyoHg XAcwAayk2KuX0DEvC6lt3ft7x/bY/Z9+mKU2KMvrasy1G3kb2txZ1p8L+vKUacIjxXGj 6WB0IAiDcSnI8OHSgj+Kb/N5/sCfGvYBSmGVyXpFNSEsuaCqNYsdFpMvbANQpf9ljaqd WqGCyl+iYY47Vp+ObkzIHWLx6y0bx2KhVd7J0cpez/oaMc4snfi+B87eZakJ3t+2Rwkx uUdH8TT4d4bebDSZOHVSL7fGQpkwbApPBKqn2CcdUbPuHhPTiHdlErXTXeLtSro9nmG+ hYew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709236011; x=1709840811; 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=ca983BidQhF3kXBuG5kdBy2pJtGa1jO9/93kM7+2dOI=; b=xCmjJIWYfKKDvPDqW8z8cpj56qBoQ5QWexN2yqwPpaCum3pjt80SF72kAIU+Valo59 Oyt7KgQNo/Wh972cafTOKgioBq1nWEnfFksUKQpnCqkfi817nzAetBR5WcXjh581o3Ae 6tewUB9g14lWVVvccN2YRq/3sc0drNqKxSH8WjaM3aRskOk1wea6IlZyIkhRo1qYOcTx NutLiYmMRIu4cGWVATfs7V6n3Gx7itQKB/Jt2ZzkzON6MJjCgLBRABqzZPVD+Tsyn7Db eBdknHMc/bqWtO0khAZQlyHjitvt3vBwHnmIkGYH0b5zKY69Azbu7vWaJE++H2gHJpsn SujQ== X-Gm-Message-State: AOJu0YzZg5bFS4oEic+iyw56G3Y50U69y6Bo91tpCZ2SSzlfOcsoQE9x 3kmdOyJaCEOqnfCmTCqlPnLzi6nvyXazR2uCRLFuLVlKtmlexADoX/CwJDOoQ9TdZeMx2UITM4l y X-Received: by 2002:a17:90a:4897:b0:29b:1925:aa77 with SMTP id b23-20020a17090a489700b0029b1925aa77mr57431pjh.14.1709236011473; Thu, 29 Feb 2024 11:46:51 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:3a1a:a62d:15eb:5bb4:832d]) by smtp.gmail.com with ESMTPSA id cz13-20020a17090ad44d00b0029ad44cc063sm3957206pjb.35.2024.02.29.11.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:46:50 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Szabolcs Nagy , "H . J . Lu" Subject: [PATCH 2/3] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) Date: Thu, 29 Feb 2024 16:46:41 -0300 Message-Id: <20240229194642.3398122-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240229194642.3398122-1-adhemerval.zanella@linaro.org> References: <20240229194642.3398122-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 shows 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 HWCAP_ARM_VFP | HWCAP_ARM_VFPD32. Different than setcontext, this 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. --- 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 | 96 +++++++++++++++++++++++++++++++++++++ 10 files changed, 218 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 02dc476e27..a300cf2602 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3056,10 +3056,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..5c395fd22d 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 + patch if required. */ + 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..7a73d7d1df --- /dev/null +++ b/sysdeps/arm/tst-gnu2-tls2.h @@ -0,0 +1,96 @@ +/* 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 + +#ifdef HAVE_ARM_PCS_VFP_D32 +# 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 | HWCAP_ARM_VFPD32)) \ + { \ + 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"); \ + 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"); \ + } + +# define VFP_STACK_REQ (32*8) +# if __BYTE_ORDER == __BIG_ENDIAN +# define DISP 7 +# else +# define DISP 0 +# endif + +# define AFTER_TLSDESC_CALL() \ + if (hwcap & HWCAP_ARM_VFP) \ + { \ + char vfp[VFP_STACK_REQ]; \ + asm volatile ("vstmia %0, {d0-d15}\n" \ + "vstmia %1, {d16-d31}\n" \ + : \ + : "r" (vfp), "r" (vfp + 128) \ + : "memory"); \ + \ + char expected[VFP_STACK_REQ]; \ + memset (expected, 0, sizeof expected); \ + for (int i = 0; i < 32; ++i) \ + expected[i * 8 + DISP] = i + 1; \ + \ + if (memcmp (vfp, expected, VFP_STACK_REQ) != 0) \ + abort (); \ + } +#endif + +#include_next From patchwork Thu Feb 29 19:46:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 776899 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1004304wrn; Thu, 29 Feb 2024 11:47:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUn80V3xuynRQzOmg6nvuARFbQTs/659i+Jt+X3uagp6mhhQEmFfpuvAWbhTxWhXeObb9xXcioLgZU86qRsKtrr X-Google-Smtp-Source: AGHT+IEsJBZQ1kYNh/gNSwvgrtDsj2LjJWai9Hrn8JmsyWzsvawchpFy/w54sWmKD60YB2V/Xxen X-Received: by 2002:a0c:f94f:0:b0:690:4ded:22ab with SMTP id i15-20020a0cf94f000000b006904ded22abmr2758171qvo.16.1709236042252; Thu, 29 Feb 2024 11:47:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709236042; cv=pass; d=google.com; s=arc-20160816; b=Yj4YkyMbWcsKA+rwBNPKMtdQRMSSyeLgMkU7ojc5NWQwbQfJWCLT8NsSeCsrf6K/Cb h3y4wdsU+OUgwZfQ78GsLXUofp+8lPduqrUis70fA/Dv/s6YOcxGncKdOzB2cO7PTtmr VUB5d8DETM/Wrl3+DPWGiQTqunp4OIrS2bkF//yW6RSTyQWY6vEl5MS6M8jnWX0SNuds G5yyU+cv1GpTuzsIzIybb+l4rubqumObnzibfl81BVty25fqaHs/sf1jkVJrT+Yobyzl BUskrzeTHA6qp+5v/pg0hRkvUK8HKJJu/SlOVZ5LX/qRRg5BpqH9TX8bRLp89gyPoexm QO4Q== 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=oYtm8/IQpMJuYX6ShqWMa4f7nfeEcfn3XNXnCWrWuy0=; fh=r/+2bI1lru/Vq/uHJOEmQnAizPQ/CjrMEWBQn8qzvus=; b=iPuDFyOW1u3C//xM9jxtgErjTOnCVRD8vU2LOpQ7S1VjQQw2bOltdeehq7vvTWliso trTtXsKp3iqXoDFGOe3UT5rUkM3A8elAWJbPe/43YWZwEsM7cyLyQAkZy8VdAmBWU2bo EzQudx51X31gmnsSYW5TGWj5oaGUlAa22hFNtS3jtkeXYO+jHcJAAClrBa9ciQRj7qDX fqE9oY6kgVXPjVSSITpcZUqLYWiCD/Q7FDWhLbKI0McEim7s6sg9ImPGQksqFbEskQWp aJTDQ5SbE1UeIPlG50qKVoIMgExUIGYnXC3jhMPw6QyJH//jq+5t1JAQOqj3JYGwBzjh yRag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ULfiW43H; 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 hf5-20020a0562140e8500b006902f5cefb0si1990313qvb.495.2024.02.29.11.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:47:22 -0800 (PST) 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=ULfiW43H; 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 BEDDC3858034 for ; Thu, 29 Feb 2024 19:47:21 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 2D4223858C39 for ; Thu, 29 Feb 2024 19:46:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D4223858C39 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 2D4223858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709236017; cv=none; b=h84Hluv0wyPTrH3Pu9aTxIltkThud683QKsmlYI0S+1ZK6tpNq7L6b72KP2Y3Ygpgv+QQjLX1JHDP7yS01Zepy+PwsMMe/En9BzU17bYr6l44LjUEzn8mhdvkk+WKHmFESxHd3S2phyK+BacKyn+OWAcw5JLiI1Gu7rWgmQQzJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709236017; c=relaxed/simple; bh=LjqaOgBHlzvghC5qDJ0ZYRtKH7g+tY0xfPu10/EXiOI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=J8IK7oEFVw2W6VhSFEHO2G0+h0FJtfDJ+JrBvYE/E3gUifwZuDxru4LNgNuVmTm7mG1F98bl3F2hCVqhjhYC9ssMUg0QYoYkvLSxeM0502SWWUKMGA3a1/vIrZFsdwshlLZBEBMdNZAebwOOr3g1KuPqvA+u3O0QN+nwx8bT2WU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5dc20645871so923318a12.1 for ; Thu, 29 Feb 2024 11:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709236013; x=1709840813; 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=oYtm8/IQpMJuYX6ShqWMa4f7nfeEcfn3XNXnCWrWuy0=; b=ULfiW43HojBCmt+GpGY+lwbboQeed56AIiy6JJFMQPpPlsyofVEw6Ga9/Gql9P6GrT /2HYHtVoPr/hXs6IX53HWFZye9RscareXRj9NkUEXfruBvKZO/shbuXHoTL7sVVL817w JCg2yihdV6C2QF5lQCoRRXvUvl09/LkRnG5arDDAvE+go4fCflWPR9X1JQIIsySBaJX7 pUydXv/UwoKeFE9hbpxlNMLw0CNoMOHcMgreGeiN0iQH8jj66D6pmxsO+AzX4xni8jlN 7RyC3sPyRRmBbLmkrLgYLCNeT8DbKHDrm4Rcxhj++mV/8RABdAzGcBTD2zN12R/58F4x TczA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709236013; x=1709840813; 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=oYtm8/IQpMJuYX6ShqWMa4f7nfeEcfn3XNXnCWrWuy0=; b=Z+khS0nfyy9ntmkvvNGAHjyC3JHxTqW7dxySLXTB/PqcIUsfK+Jqs1bKZBw2C+ch1e ZRfIxpxeAbA/t4GjB5XWMpsftLZQbT0yfdto/Gxbg3dCNGMZSkL3qJVckE+YuOx66BIP ROTckd4p2TShxEE89aQZbDODtuo4Jrsv1qTZEvnKUm97vEFfKXFGlJqR4qMH88GTOpSr l+hS1Wkzcquqk8Ca9OH0kejOacznVpZV3MWaFAUEMBde04npXmPcWgm29iQ66VqeC4Rh tPZkOMN1k9VCqxMsd06SDUIRkrh8mzKZqkYEI4awdaRxdx1sRqcGIx8kXoIa6tXlRSJo Ok0g== X-Gm-Message-State: AOJu0Yx0HJ+FZbwHiGocYPtvRePOWc7v6VwhLYoWSXSXVVid/hnDOCAO bl556YDUW34wTBVL+OeTadX7i4Mm0GspMjqdtfrm9La7kzjlXJq2wb+UDwZPLhg3PKR2RwcttK1 u X-Received: by 2002:a17:90a:1f8b:b0:29b:c31:1fe1 with SMTP id x11-20020a17090a1f8b00b0029b0c311fe1mr4162277pja.10.1709236013347; Thu, 29 Feb 2024 11:46:53 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:3a1a:a62d:15eb:5bb4:832d]) by smtp.gmail.com with ESMTPSA id cz13-20020a17090ad44d00b0029ad44cc063sm3957206pjb.35.2024.02.29.11.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 11:46:52 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Szabolcs Nagy , "H . J . Lu" Subject: [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64 Date: Thu, 29 Feb 2024 16:46:42 -0300 Message-Id: <20240229194642.3398122-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240229194642.3398122-1-adhemerval.zanella@linaro.org> References: <20240229194642.3398122-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 a different name than x86 and arm (trad instead os gnu2). Use it to check whether to enable the TLS descriptor tests. Also rename the internal machinery fron gnu2 to tls descriptors. Checked on aarch64-linux-gnu. --- 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 ab8a10ed92..034ac9017a 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 -Wl,--unresolved-symbols=ignore-all 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 4bb9aeef95..ddfb2876a3 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 a300cf2602..ebbe1bcf3f 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -999,13 +999,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 @@ -2972,11 +2972,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 \ @@ -3055,11 +3055,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..89edb0c9a2 100644 --- a/sysdeps/aarch64/preconfigure +++ b/sysdeps/aarch64/preconfigure @@ -2,5 +2,6 @@ case "$machine" in aarch64*) base_machine=aarch64 machine=aarch64 + mtls_descriptor=trad ;; 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