From patchwork Mon Feb 19 15:49:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 85995 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 575DB3858C74 for ; Mon, 19 Feb 2024 15:50:07 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 9D80F3858D20 for ; Mon, 19 Feb 2024 15:49:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D80F3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9D80F3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708357784; cv=none; b=fM0XiJ19NsD1+HRLHwDL9tKdkK4yvtAUshICJz+YfW+CHRx3U1cyKwF1ixVzNvUkffftf5asQ4cIjZe1nPBvn1fdZayhHwErH7KEfBnDnaxZNhzr+WCRu5GiGhabpAPjgYXKXOPfk+DVg1cb7/Ai2R93HZYUQfwg0MXYOkWrgFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708357784; c=relaxed/simple; bh=8lc4PaP6sxtF6zfyb6MPp+SLZWMkvdFT2oke50fTEcM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vgXXSo0B9o83Xy3oF0nv9hvAcxl3NNpJrueed8GA9cAPzwfYS+pnO+XEl0/JeD5AoR7gjDDdDdE2TdmYSodc1ixFSrjSQEQHy+92UI5kZmRcklVc4un0WE9fgRrYDy5W80ATOwRzAcdoLbUJRMmkhOyN+juNSh5H1CwwK6w0dqI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41JFZaFJ016518 for ; Mon, 19 Feb 2024 15:49:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=zOe4PdoDOxLsvFXbgnZD4d/1hrgAbJSxBXV0oLyXcDw=; b=IsTlzKyuyVv44lXyEdz15yKTPl4kVAMB9xnGm5rivSyR1O6TEy2cvPh8lKGqFja6RX2a EZKPEscKGNzCfEGGSvNc4eLT2fNQpWH8NNr549q3jVWorOqgazvFUdEbcjS4o2VqjJEP U8fpRnUi5eJeBbXVIGHBmhk/3sMhPwjz7sgzRmaUzMIRdMQGTznRf+qCQPhR9Iss14Mf L0KfYWq3JEh6o8nkMYcn4CwnQB5UoJfX7SmCrLNKfUDu0gjilJ8WRRTh2NIPHBEqXPli +IN//eGF/bY/qc5InrKElTnTRlSykBD+a/taM4IPglxDUs96DmYQmrbNl+smUHYeUHHt Aw== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wc7tt4e9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Feb 2024 15:49:41 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41JFSCuI031138 for ; Mon, 19 Feb 2024 15:49:41 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wb9bkhpsa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Feb 2024 15:49:41 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41JFnZpH24838898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 15:49:37 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C2112004B; Mon, 19 Feb 2024 15:49:35 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E8B720040; Mon, 19 Feb 2024 15:49:35 +0000 (GMT) Received: from t3560005.lnxne.boe (unknown [9.152.108.100]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Feb 2024 15:49:35 +0000 (GMT) From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH] S390: Always enable static PIE if build with lld. Date: Mon, 19 Feb 2024 16:49:31 +0100 Message-ID: <20240219154931.653686-1-stli@linux.ibm.com> X-Mailer: git-send-email 2.43.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 88M2QoA2HhdK7OxFNErac_D7jbQhXfcQ X-Proofpoint-ORIG-GUID: 88M2QoA2HhdK7OxFNErac_D7jbQhXfcQ X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-19_11,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=732 spamscore=0 priorityscore=1501 adultscore=0 phishscore=0 impostorscore=0 mlxscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190117 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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+patchwork=sourceware.org@sourceware.org LLVM ld.lld now also supports s390x and avoids unnecessary TPOFF relocations for position independent executables. Both recent commits were also cherry-picked to LLVM 18. This patch just enables static PIE if build with lld. --- sysdeps/s390/s390-64/configure | 10 ++++++++-- sysdeps/s390/s390-64/configure.ac | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sysdeps/s390/s390-64/configure b/sysdeps/s390/s390-64/configure index 824ae9c129..c26785f32f 100644 --- a/sysdeps/s390/s390-64/configure +++ b/sysdeps/s390/s390-64/configure @@ -12,8 +12,14 @@ case $($LD --version) in libc_cv_s390x_staticpie_req_version=no ;; "LLD"*) - # As of 2023-08-07, there is no lld which supports s390x. - libc_cv_s390x_staticpie_req_version=no + # The required lld patches are available with LLVM 18: + # - [lld] Add target support for SystemZ (s390x) #75643 + # https://github.com/llvm/llvm-project/pull/75643 + # 2024-02-13: https://github.com/llvm/llvm-project/commit/fe3406e349884e4ef61480dd0607f1e237102c74 + # - [lld/ELF] Avoid unnecessary TPOFF relocations in GOT for -pie #81739 + # https://github.com/llvm/llvm-project/pull/81739 + # 2024-02-14: https://github.com/llvm/llvm-project/commit/6f907733e65d24edad65f763fb14402464bd578b + libc_cv_s390x_staticpie_req_version=yes ;; *) # The required binutils patches are available with bintuils 2.39 diff --git a/sysdeps/s390/s390-64/configure.ac b/sysdeps/s390/s390-64/configure.ac index 4657de0d37..2b5bffc107 100644 --- a/sysdeps/s390/s390-64/configure.ac +++ b/sysdeps/s390/s390-64/configure.ac @@ -12,8 +12,14 @@ case $($LD --version) in libc_cv_s390x_staticpie_req_version=no ;; "LLD"*) - # As of 2023-08-07, there is no lld which supports s390x. - libc_cv_s390x_staticpie_req_version=no + # The required lld patches are available with LLVM 18: + # - [lld] Add target support for SystemZ (s390x) #75643 + # https://github.com/llvm/llvm-project/pull/75643 + # 2024-02-13: https://github.com/llvm/llvm-project/commit/fe3406e349884e4ef61480dd0607f1e237102c74 + # - [lld/ELF] Avoid unnecessary TPOFF relocations in GOT for -pie #81739 + # https://github.com/llvm/llvm-project/pull/81739 + # 2024-02-14: https://github.com/llvm/llvm-project/commit/6f907733e65d24edad65f763fb14402464bd578b + libc_cv_s390x_staticpie_req_version=yes ;; *) # The required binutils patches are available with bintuils 2.39