From patchwork Fri Jan 8 16:19:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 41680 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 63119398242D; Fri, 8 Jan 2021 16:20:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63119398242D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610122815; bh=MrNMtoQ+9Y/rhz+gdEdrPPKAx1z3RSmbi9/VYhOY99s=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iZTQb7Nz0bp8ejOCkO0OY0eC06au6nvILcyWk40OGZ9d/uU7ydX2hB4//CrIuZs8O 4Vlq7aX4EO1RtBCoA7kULft6DWtIOAJm/7RhAqkDBGQtgenMAfNDzAoejVq+xDM55T FMbJRgeD4+AySIbWVHq3XfhoL2uHXt9voBT8tB48= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130072.outbound.protection.outlook.com [40.107.13.72]) by sourceware.org (Postfix) with ESMTPS id 1EE3A3982403 for ; Fri, 8 Jan 2021 16:20:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1EE3A3982403 Received: from AM6P193CA0072.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::49) by VI1PR0801MB2045.eurprd08.prod.outlook.com (2603:10a6:800:89::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Fri, 8 Jan 2021 16:20:05 +0000 Received: from VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8e:cafe::5c) by AM6P193CA0072.outlook.office365.com (2603:10a6:209:8e::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Fri, 8 Jan 2021 16:20:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT005.mail.protection.outlook.com (10.152.18.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Fri, 8 Jan 2021 16:20:04 +0000 Received: ("Tessian outbound af289585f0f4:v71"); Fri, 08 Jan 2021 16:20:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f74799e98621a96d X-CR-MTA-TID: 64aa7808 Received: from 23c84cf0ca7c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A23DE1AC-8EB7-4E31-9D38-A598CDA69CE7.1; Fri, 08 Jan 2021 16:19:58 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 23c84cf0ca7c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 08 Jan 2021 16:19:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IuKOvuaDSStOExUgqGXv3ybRUL3l31FlFGf/H5oER3rx7/22tgdqiwe8Hfvf36nEmVWNHXgMxYt8joQHPBGm08YcgBJ1bEGJJs7k6rqlrNUt3r5M4CWOZBvREe8nh7LRkr+D12bwQe17r+0d7Yk04jTHX9GopztBY2p35DE7RfTOhzOfSjEfPpghqcPGBGrc2MyJ/MEW2yshkJJsgezuxvMW/Ri/z5Qti5C2H4txsLDu68oydkII8fOqav80U1W25aGPhTYvdrtZMs5jXOP1KMXdffWzrxR0vlD5txvldIZ17F4ePPqkrnGjTUih8skwMYqOKasjViQfx6ikw/5i/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MrNMtoQ+9Y/rhz+gdEdrPPKAx1z3RSmbi9/VYhOY99s=; b=aa5ueRUIU7y2CZhhgQrInrgbABrRC40t/CK7Y+2VibsgwSrCwbDo3bNrY6mHtB8OrSGkRFINR7iOu4JSUlaPbj26P/EER8Qjx17Okgu1zRbeMrkA0jYL+FvCdZECp9FsudnPvY9ozXqZ36XT2Dnz4AfHPspZ+94uT/uablQDu6tvaJYE6rEe8EzY7ITu5D1qjL7X0iTKZxlEA8IYoS0M4YtmJvdVj85rJK3Ux8m6vYz/l+0gd20FIg6tjawswHKBlsHaPoiIBhGXm8jZ3+yvsh8bDNwhwTrdysOotr2s9V6rlVdeaIABz/YNBTFjWSan/lWbWHDgoh+4DvIjtfXLkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PR3PR08MB5578.eurprd08.prod.outlook.com (2603:10a6:102:83::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Fri, 8 Jan 2021 16:19:58 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::700f:ddbe:a347:ee4f]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::700f:ddbe:a347:ee4f%6]) with mapi id 15.20.3742.006; Fri, 8 Jan 2021 16:19:58 +0000 To: libc-alpha@sourceware.org Subject: [PATCH v2 1/4] configure: Require PI_STATIC_AND_HIDDEN for static pie Date: Fri, 8 Jan 2021 16:19:51 +0000 Message-Id: <0025e4350c3001b6721552aa8d5bc64711d028b9.1610121077.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Originating-IP: [217.140.106.51] X-ClientProxiedBy: LO4P123CA0022.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::9) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (217.140.106.51) by LO4P123CA0022.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Fri, 8 Jan 2021 16:19:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6f9c2a9e-e3e1-4a29-4cc2-08d8b3f14218 X-MS-TrafficTypeDiagnostic: PR3PR08MB5578:|VI1PR0801MB2045: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GPeWg9nNg0uzPXrO05hIYgo/QzjhLb4INpp6p+z5t+N3JXjiEZgpv1KyY62sUKB2lLO9dnSKuat7wYEn7fcR5IfNXY9q4r+SggtXMK7ixBxwv8+h1q6x3fa61yOLFBqjgLDLtgehldt5qtQm6zi0gXM8XbNma8KZ4G99ObyQjC2Cu8u3qiTu1FLb6oPgN/+myDPveRCQ7F3yjlYHkdsUuezaQMMRm7nXeuc1iox+u17SZBCQQDZJSn3B68UQxl4Yc+2nDLN10XNkcxXklVUSzCGMqE0uvg9gcv3V/G5+6QnS3T7gb22Y9nOK9btwz8knjn71ULKk7340gOE03b+Y+KtFPI3dlglDFEDohyW/yvgnwdp8axIJQTuLTtkASZRMjGoiXCFw8c8KnJbj9kJZ0QW9XQdfD5ygrgW12f25zDBttCl1pwjIuO0+dMqA2ATAc0d1AGJRYi+F2+JuKQ8PBw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(136003)(396003)(39850400004)(366004)(36756003)(8936002)(52116002)(86362001)(69590400011)(16526019)(6506007)(26005)(6916009)(83380400001)(186003)(5660300002)(6512007)(6666004)(66946007)(66476007)(8676002)(316002)(66556008)(6486002)(44832011)(956004)(2616005)(2906002)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: uP/9k1egYHGS+DaQ/+JVbqwUXmUTOZEp+nwMv68tJgHRL+NUjFtB84ajug1H1BZuSCSrOJUO7CTX4+bOZ2h1VpCEXhpNULqLfRoJSsOV3Q6HonDeyEHw/RQFEcDGP0SbaWjuugZKqkqLRM9BcjmFp1GcPA4A8YdYPQCJlsUNUz1LHKzjiz3cmiej8PixfJKHfSgITYPl89UHPiNIBhf5B5JxLW3Q3yVf4+TIHG4F0lA7CApq/QLfgI5bqjA1FiBpp87mdYREUk0c6FG0VaIoYZGOpfJStnbmfF8IaK4F/RV8odHmAMPdqllSKUSvI2kUeXiiU/47rrEgVddVVsG2lnF83TmGPTDrxQaCQBjqLIIeHiCCK1kd16fnbMbn+2Xs/FXZjbx2qbIIQdSKWqF7e99G1Bm21IWX9ji8HvhFb69nAP9+FVcH6IFIS6IJEo0W4mlpz3JBBtKXvtRR9uq8iR4fjPeZfB3EQYSG8AoOt5kldfIxpCp8H00WtP34mtBzHmkuGT+zzIVwKBuYkb/PIh7FVXjYwodotK3QhSi6swha/3lw/yu0K1kb8WT4igohQzQZQNXjqh51+dV1LJF26Hkvq6hQ6904NeHOmfhuy7/9tadnKckrB3HI+OS4RaFMFCbDGc7QF7XOD8Hz3LSN/jFknJYMf3TpyruMkBDVVWXYCX5kpJGeZ/ElpKGTMVUyZDSS8D2/wXEoCofzegC7wCSfayLAG7QUZWYFWKT5edbNeC8do8VDlB2AyayEpeZCDjHX2Z3AA3Alqiwr3d5Fa+96x27YmuNK5/tiG1C3hkdVGKS0pZ624Zi+6mhWqONCh1daGP6EVbUWAR7qgJddKIe9Vz0/YnrUjiRcligFY0t0j2oUXAG0AIETL4by6vbt/62VgcoMBebgVD9SReVUyd7OwHwSEId8zAxA13uyy6lnEqdG5bZUKgG5BHXdSLWeMJqVJia1jz3Ul+36Nkst/waGcgjNKrd+ABuyxSUd9jSVl13vyJvLpPZ1DC1J4bns X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5578 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 28456fd8-5621-4197-b9d5-08d8b3f13de7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fYTDsq4KhvveagmfBbTW4kwI8Jhq1qhuCpDOCwVKcdr0e0YdssA+0aOf6oDHk81I5YLARf6rZuVzNW31QUgk+ErffApCfuHLiFaMAy0fx9LiExLkIRELW4E1eghx9fWQArEjlfsxZoFe4FszJ68lWc1IPN2an/GztbFu+XPGrD7CpmKcHTLjC5KGkIZp1B/BKdimRBsUfqGnzzNtzcrp0Ad7Kqn03p8PJuwj9Xeywqcoq225f7yEDtw6wS2H/kwubDGS2dO+hlvN/3szZhBu41l+g/OaEO7W8HGZKER4xq6v6IIJGY6MrwVBgkGnnOiuGsSAfSGD9fsthEqYIUUf2MNJSUQN8MF0m+gfrNUFyw4PUa8hOYqMcXuuNN+w72Kkj3bt8ZFMHLtvsAIb2yCLn3YUBGNjm54/pBXfRjt7OdHqDyNas9HktwxQVxJ9xRYyND2dA0PvxsbBOP3o6gL3jiSZOzWjyqD0tX0uIPrwX0PWlRpFIbDIyA3dKz7vRPbxe+jwQKQPzKdmbDTmhcB2vw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39850400004)(396003)(346002)(376002)(136003)(46966006)(82310400003)(16526019)(34020700004)(186003)(83380400001)(70586007)(6916009)(86362001)(6506007)(478600001)(26005)(6512007)(8676002)(6666004)(6486002)(316002)(956004)(356005)(8936002)(81166007)(5660300002)(2906002)(2616005)(70206006)(47076005)(82740400003)(36756003)(336012)(44832011)(69590400011); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2021 16:20:04.9024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f9c2a9e-e3e1-4a29-4cc2-08d8b3f14218 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2045 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Szabolcs Nagy via Libc-alpha From: Szabolcs Nagy Reply-To: Szabolcs Nagy Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The glibc static pie self relocation code relies on that local symbols can be accessed without dynamic relocations in position independent code. --- configure | 14 ++++++++++++++ configure.ac | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/configure b/configure index 6a35553805..e9d88f007c 100755 --- a/configure +++ b/configure @@ -6837,6 +6837,20 @@ if test "$static_pie" = yes; then if test "$libc_cv_no_dynamic_linker" != yes; then as_fn_error $? "linker support for --no-dynamic-linker needed" "$LINENO" 5 fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef PI_STATIC_AND_HIDDEN +# error static pie depends on PI_STATIC_AND_HIDDEN +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + as_fn_error $? "the target does not support static pie" "$LINENO" 5 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # Default to PIE. libc_cv_pie_default=yes $as_echo "#define ENABLE_STATIC_PIE 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 43cfac9d48..aead4c44d7 100644 --- a/configure.ac +++ b/configure.ac @@ -1846,6 +1846,11 @@ if test "$static_pie" = yes; then if test "$libc_cv_no_dynamic_linker" != yes; then AC_MSG_ERROR([linker support for --no-dynamic-linker needed]) fi + + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#ifndef PI_STATIC_AND_HIDDEN +# error static pie depends on PI_STATIC_AND_HIDDEN +#endif]])], , AC_MSG_ERROR([the target does not support static pie])) + # Default to PIE. libc_cv_pie_default=yes AC_DEFINE(ENABLE_STATIC_PIE)