From patchwork Fri Nov 19 08:46:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 47923 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 D82AD3857C6F for ; Fri, 19 Nov 2021 08:47:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D82AD3857C6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637311649; bh=aUiusdTIQx0i73e4NBV7pBXBBuI9J1sISB8KGUbg1iU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=aIEh8TnCy66bF+6eqzwdAz4wrRmhrOk72cwsZ36UZPeqqgWBMO8L+E9Azfb2Krd8O q4d9mpUqBNWzVuZTTkDldKOlp8RXb7ylSwhMriPUGAHugb50dfZbpBZNCwfk9OLhzJ /2K4eRLfclzSs1FkpJsL/qGUfTl68T0vFFWtchcU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130057.outbound.protection.outlook.com [40.107.13.57]) by sourceware.org (Postfix) with ESMTPS id C39CC385AC12 for ; Fri, 19 Nov 2021 08:46:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C39CC385AC12 Received: from AS9PR06CA0364.eurprd06.prod.outlook.com (2603:10a6:20b:460::20) by AM5PR0801MB2098.eurprd08.prod.outlook.com (2603:10a6:203:4a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.26; Fri, 19 Nov 2021 08:46:29 +0000 Received: from AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:460:cafe::a5) by AS9PR06CA0364.outlook.office365.com (2603:10a6:20b:460::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22 via Frontend Transport; Fri, 19 Nov 2021 08:46:29 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT050.mail.protection.outlook.com (10.152.17.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Fri, 19 Nov 2021 08:46:28 +0000 Received: ("Tessian outbound dbb52aec1fa6:v110"); Fri, 19 Nov 2021 08:46:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5b1dcec37875b150 X-CR-MTA-TID: 64aa7808 Received: from 0604a0613b11.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D7F6450A-4E01-47C4-A2AF-FE446E6557BA.1; Fri, 19 Nov 2021 08:46:21 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0604a0613b11.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 Nov 2021 08:46:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRYRrOTNevebQelAld/0wSQahy45L7/SIna0hlMSQOFJFgmowUEYsi7lJ5mWDGbvLvmYbHSkcZlJjjiKCTMMhvqeFHTSOjJrMnFfoilYpd8cg9z0jayg8Dnxp6LicesNV/nOIYGmyq+uqOhqfY+5y8LevQb7EDBtFJ0h16zFWwW0b3B4ajwYSiAAb3ds6TeUM/aStHDR3gYDdkZq+VRdwWYd3Ek+d2U9Ay66vbGaKohOXkzReYSYOlyXqlfc3yWGqotZVoSyDYn6n+aikt+3fuzfKijBj2uSe8huscpVtJW/KxyFKxiu+0GpuSZ8vuxe+BtBUrsNzqX5lfCbfNMAyw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aUiusdTIQx0i73e4NBV7pBXBBuI9J1sISB8KGUbg1iU=; b=gQHU/fCFypbDq1984KpqAF+TvsE+MmSyAGP10tTrX799q34p1QoSnBfFG866Gr/RodoF95harvuZI+FDvAxVdPbbzD1x3VfGSBR4TZ0UBzMDesy9jD0n51LSAaRjEB4WFwej2Stdt8DCe36VNlO+UOHrQy9RZB4fV6cggvr4MIHA+ZA2c/7a6q+p14Vj4C79HGfyUDmP3gAAybvb3iBUgjctQ+VAedmudkcKQN3kzf0AWif07178OtkkU23MiVT3zBI2OaiESQtRm2OBv/Q5JXHZHbmrejZLw7RUd9NzVlZDcXiEtDpYTJ17YPVerosXdCmKWaygXGFiWEB4+yZEig== 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM0PR08MB5316.eurprd08.prod.outlook.com (2603:10a6:208:185::14) by AM8PR08MB5619.eurprd08.prod.outlook.com (2603:10a6:20b:1d8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.20; Fri, 19 Nov 2021 08:46:19 +0000 Received: from AM0PR08MB5316.eurprd08.prod.outlook.com ([fe80::1096:1244:d709:fbee]) by AM0PR08MB5316.eurprd08.prod.outlook.com ([fe80::1096:1244:d709:fbee%3]) with mapi id 15.20.4713.022; Fri, 19 Nov 2021 08:46:19 +0000 Date: Fri, 19 Nov 2021 08:46:15 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH][committed][libstdc++] Fix ctype changed after newlib update. Message-ID: Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO4P123CA0488.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::7) To AM0PR08MB5316.eurprd08.prod.outlook.com (2603:10a6:208:185::14) MIME-Version: 1.0 Received: from arm.com (217.140.106.55) by LO4P123CA0488.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Fri, 19 Nov 2021 08:46:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8a15ef8a-3ddc-48fd-1b65-08d9ab3913a5 X-MS-TrafficTypeDiagnostic: AM8PR08MB5619:|AM5PR0801MB2098: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1169;OLM:1169; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: oYcZzAWRYOKFFWp4WVHLFmOai+Mo7xYUAcZoinUlIOfDdx+KmsWOS2xK4vo87nADeRYYXpGV43+Yz8W4x6u7d5M2UElTfgMwtCJSolQk2DEx0F9bT85cZONzjrRMpfrzVqOahrpXKUU7ZiOudu55G3PKj6YAiUv8CdSiYVzUSb5pU/d45WsJbtUwdXMHKHZuScG+jDpcPa7bas5WJIDO2+p78G3+pWfcPOMgYPx2ERAdY8brL5Ku2Jw2LeiNI02pC09Oo1sDrMOdmdxDLfZUMN9UcO5BKlF/XbH14+fcpr237bcido+r13R3U6W9UUFzasvyQygkvBAO/9O7VmYzLEojWBodR7Sr5YlxdrxngsZ7zjjfewhMM+Fr5nCnzYNtoxSto7f1Q3XP7EWMOIEJshnbxAx6VI2g/Q0bz8nexy32NaIVAJ3LvOHEAxV/fH4vMCVxR0H5VwT54fU6FSOejn7pxEsV6LqbAeJAFJIvkfPaj1neH5LT7dSppfBKF+fZfO6yhLLgDC7FSt7bUBb00ugE7UPBTAMfuN2Ops7P2/a6BWZpupYZtsrStCd54vR307F471T1MUvTqNASddP5esVFHZc/kiKBVcNgrt4+zWDLwLXNGduyJsXvMAaU/DLR/EE0xOZYrf4P2kiYAfLCE5FS/kIsn7Tf2Gjps43qpFdvL8PQUO1TE8fKCK0cy1E0OKIyCgLeusU2ug75uQck82bKCFFX6/CDQsfaVfr6wrttS4MRkxnCER2HzxJhP5E4XYvPy7kk/9j2KbbzIyiph5qqb6B7YgdQMRvsDj0YDJoeDzhPh98ExXr5ovPyob44iMO5qrByuZRZc2JyyqvHYg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB5316.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(86362001)(6916009)(8886007)(956004)(26005)(38100700002)(44144004)(33964004)(186003)(8936002)(2906002)(66476007)(66556008)(966005)(83380400001)(8676002)(66946007)(52116002)(7696005)(235185007)(2616005)(36756003)(508600001)(55016002)(44832011)(5660300002)(316002)(38350700002)(6666004)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5619 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 10a827f8-afac-463b-e0fd-08d9ab390e46 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GUvTSAT+n2Kcgzrz9Vk5bobVhF6S4eeKJP9xafxsMNCwguFyHulHS3xWUTxciY0CdBxMKUb7LmUunaDGLDx1l/puBUW9DDKbq7wkNQIBpOtGM0B4jALINODjxu4OA1ghbEXwrrojgFFSN/HAizBlAx/TIdCqEuzkP2dPRb+/nTsEtA0g4XMWYQU7N0GCezfnZ5B9GyICJqoKivciEfXmEgTuXwFpF5+Y58J+7uibMqMv2AETB2Y10buNHAbr2X2PSgzjc4Tmy8Tc7a8m8QFMSJps06F9Sw6Ygy0fKAKEzy0zAB1O3qyQBX5RZRmgsMF3bUpQKfpj1RhjZq0lSVT936qgg4Jymi2d6gjCAtbHI8BFIUGAwC8TWS1sUg3pcEe19vHllBCRPrrrbF8eL0Qx6Pklknytxo6B+c4RFuwn4J2B2QXMGB2fc/zivr+KUfs8nRoxGduXBd0mqMJ9gpZBEixhkQgmyg5OZ0ADeIXjrvY8s9tqr1Xn5Shw/v6OM1Mtx4Itb42EIyHnC6PuHorN6GBI4Ig3thMzKzeD9o3ScpN4hF+04BxuX9Yl10jTVx05rDy4vBUdnDZ6mmPPqUivactoc5EAuvHsVU9ijXC6FaC4YX7jw0ot5vmIlpvkwJWMvH0+kulVVJQ5yfMezzDCuZo98Wn2KfjORhM/g8XoigdDP7yS8pyQ7bqpA6ixlpEzNcjpCZvvAgIPmh1dOj3rOYNKNtIkrIH91bRmHOzPPVGgOweMIDb3Q8g/FVtJwOQ84VdOL7y/cAEBjMIHQOS/ITv+L1eM9Bt9Dh5ALZ3wT+fYtcYW2Z3D+PtTZMo99Ow+H/TJHwLlfe4iJmn/yPqLEg== 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)(46966006)(36840700001)(356005)(36860700001)(83380400001)(82310400003)(44832011)(186003)(36756003)(33964004)(508600001)(107886003)(7696005)(86362001)(44144004)(8676002)(6916009)(70586007)(2906002)(4326008)(235185007)(70206006)(6666004)(336012)(63350400001)(81166007)(63370400001)(966005)(956004)(2616005)(47076005)(8886007)(55016002)(316002)(5660300002)(8936002)(26005)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 08:46:28.0080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a15ef8a-3ddc-48fd-1b65-08d9ab3913a5 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: AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2098 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tamar Christina via Gcc-patches From: Tamar Christina Reply-To: Tamar Christina Cc: drepper@gmail.com, bkoz@gnu.org, nd@arm.com, paolo.carlini@oracle.com, jwakely@redhat.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi All, Newlib changed ctype.h recently[1] by moving the short labels from ctype.h intro the private namespace in ctype_.h. This broke embedded builds due to them no longer being found. Instead they now expose the long names to match glibc. This patch now uses the short or long names depending on is the short ones are defined or not. [1] https://github.com/bminor/newlib/commit/3ba1bd0d9dbc015c14a0aaafcef042f706d1249a Regtested on aarch64-none-elf and no issues. Patch was pre-approve by Jonathan. Thanks, Tamar libstdc++-v3/ChangeLog: PR libstdc++/103305 * config/os/newlib/ctype_base.h (upper, lower, alpha, digit, xdigit, space, print, graph, cntrl, punct, alnum, blank): Use short or long names depending on if short ones are defined. --- inline copy of patch -- diff --git a/libstdc++-v3/config/os/newlib/ctype_base.h b/libstdc++-v3/config/os/newlib/ctype_base.h index 33654d7794a0cff3ba4ebe78e28882d78866dd94..3a7477afdcc76e5a5bc6b0a86d2264c5bc8ab7f8 100644 diff --git a/libstdc++-v3/config/os/newlib/ctype_base.h b/libstdc++-v3/config/os/newlib/ctype_base.h index 33654d7794a0cff3ba4ebe78e28882d78866dd94..3a7477afdcc76e5a5bc6b0a86d2264c5bc8ab7f8 100644 --- a/libstdc++-v3/config/os/newlib/ctype_base.h +++ b/libstdc++-v3/config/os/newlib/ctype_base.h @@ -41,6 +41,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // NB: Offsets into ctype::_M_table force a particular size // on the mask type. Because of this, we don't use an enum. typedef char mask; +#if defined _U && defined _L && defined _N && defined _S static const mask upper = _U; static const mask lower = _L; static const mask alpha = _U | _L; @@ -52,8 +53,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static const mask cntrl = _C; static const mask punct = _P; static const mask alnum = _U | _L | _N; -#if __cplusplus >= 201103L +# if __cplusplus >= 201103L static const mask blank = space; +# endif +#else + static const mask upper = _ISupper; + static const mask lower = _ISlower; + static const mask alpha = _ISupper | _ISlower; + static const mask digit = _ISdigit; + static const mask xdigit = _ISxdigit | _ISdigit; + static const mask space = _ISspace; + static const mask print = _ISpunct | _ISupper | _ISlower | _ISdigit | _ISblank; + static const mask graph = _ISpunct | _ISupper | _ISlower | _ISdigit; + static const mask cntrl = _IScntrl; + static const mask punct = _ISpunct; + static const mask alnum = _ISupper | _ISlower | _ISdigit; +# if __cplusplus >= 201103L + static const mask blank = _ISspace | _ISblank; +# endif #endif };