From patchwork Fri Sep 16 12:23:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 1252 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp727331wrt; Fri, 16 Sep 2022 05:24:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ms1XGUdN6SR+MKnDYZZQAuyALpNLvCYUsG035lEPPj4gTXoIRp1DSwT7Blzr8bBTsNdJt X-Received: by 2002:a05:6402:5106:b0:451:787c:9fcc with SMTP id m6-20020a056402510600b00451787c9fccmr3705573edd.164.1663331089226; Fri, 16 Sep 2022 05:24:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663331089; cv=pass; d=google.com; s=arc-20160816; b=JywKKO3n6Y/oqudBUMilDKtfofFVqHQxTV7QzlQugIg3yY5fRG6SIuNLK1DJR4AWKj 7tS8uI/UogK1mvZe6cH1z8//+t+PX/S5sZIkkNwemgPh3lvE/1WHC6IDMK30VSc8Kugd l1sEIoJiCr7HWGdzNOLdlR6jL642LSM8eFB/WYsphtnGhOCLQuABLFbQpNfnU2Q5VCsR 0evJRxUqBc4wNU72LnGoSaZ6XQDVVXE5bdAcGf7zDF3p7qVH/eGp5HbYQeGJPR9Ci/Ys jdBZQpExNsyhgiDmPorx8ndW3zgARiUPiGQWF+FJT63q8elP0olBxfATgn4IDR6rrx0Y CSUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:dmarc-filter:delivered-to; bh=NfW0BNRdAgF4Rn/vO+Y67N9FgDAoqcI6Q/ym8MTmSTg=; b=DHRHMsIfGZcexYe1GfM8rpE3V1+dw6K1qmGxNEqGVhlh9KgVOPs4H7ni/yt8fHSgdD YIuJtcbwZoXJGlfP1XYyQVKZ0ENBGAj8oH/xtXDW68PgQPF0iGo+utXIR7sY7Oq6QOym 79F7GH2Vh9gOhOzcbcPjELpCLN/LucqdtPMzKarr8zkRXuKd0OubbuDwibt/O1IcKhHZ vek5Aia0ocQdgSg6Z5j4i6GK9frQxISkmI9iQCHNqk2Bu8eC5pZjXaATijQcR+oGjHJ6 OXF/UHMSNw+4FYx5+WwEitmkJfZJTf4SM02mtp0bOLAIyDL6N4B4IHjPE19ianshf4sX QB/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=ON12n2Y6; arc=pass (i=1 spf=pass spfdomain=cipunited.com dkim=pass dkdomain=cipunited.com dmarc=pass fromdomain=cipunited.com); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k20-20020aa7c394000000b0044e6a188fb8si2026004edq.77.2022.09.16.05.24.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Sep 2022 05:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.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=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=ON12n2Y6; arc=pass (i=1 spf=pass spfdomain=cipunited.com dkim=pass dkdomain=cipunited.com dmarc=pass fromdomain=cipunited.com); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33B0A39960CB for ; Fri, 16 Sep 2022 12:24:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2125.outbound.protection.outlook.com [40.107.117.125]) by sourceware.org (Postfix) with ESMTPS id 4C55E384D168 for ; Fri, 16 Sep 2022 12:23:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C55E384D168 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cipunited.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cipunited.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cmnaagABHZ5xa1WX6eBN9O8XI339pCbiLLORuF2NdnHcainWzSJWEvcSTL/PmArjVz930ZbJrDrebM/x7FtlqVYXNKMyQAES2PDK4rX/JPINqyIW/9OXhb25l6OqJ0xFe8l21R+RYaZM9OAl3YReWTc+GHwzMtYJ/oauBbdNrfSPGChriFxSW4y2Ey9ovEj8D0XOT6rFwJ5xIB6iB/ZUvq0gms2RzpFV2wnlmBpwVYn6T5Pdw8XN2wspR3bUy70U6Su6C1pESbDDwl4siRpsrD1+sjOR6Fiiz6Jh8CGQrS4qarGjtHvLjcsNnTiAZv6aFFtnsHlg5QKrxFsolEkcmw== 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=NfW0BNRdAgF4Rn/vO+Y67N9FgDAoqcI6Q/ym8MTmSTg=; b=UdZzVIaB7FXwX1suaoz5eI8K5cYiQuRDB04fyRPjTZ9EPXGlhISklcP5Kj26fyDGhFLiERhcIr54ENJ2XcjlnuR2fHFH6s90x/w9LQ6Wwc8JT+R5ISmpa/sDBLwNuG2A+HOHO2PZPP4Agz4emq+VDSHFIcY3UwpSrQuZ51ahn1NjBpp6vlx0J9EZAqHzzwlkuDCHTU+ij0djeTGBKrpW140gndRxvStQlh1wK1A6o6OkDYOgGjsl698QBxz3dDCBNOMBu3fHWGYzx8nzFlr8GP279TlHgG9AGYYvub7GgcCD6As15P1f5T4NVg7adwxNzfHpYDvSBHjfP2c5t3aobg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cipunited.com; dmarc=pass action=none header.from=cipunited.com; dkim=pass header.d=cipunited.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cipunited.onmicrosoft.com; s=selector1-cipunited-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NfW0BNRdAgF4Rn/vO+Y67N9FgDAoqcI6Q/ym8MTmSTg=; b=ON12n2Y6DAcNgIBv22hzoAVMZ1LVDipZtbV+MbKvGlJ990K6JE4NBEkPDMaInrnRa3ZrAU+B1s+Ebd4ZuZGUUKNTVvLsjHqqdgsOpwuwAAq1C+xSgUXuirrM4rJLlqHymsbuLE7cw1JRGacw4AjidbpaDh3/ewUYNCiONTQexrA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cipunited.com; Received: from HKAPR04MB3956.apcprd04.prod.outlook.com (2603:1096:203:d5::13) by KL1PR0401MB4115.apcprd04.prod.outlook.com (2603:1096:820:27::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.17; Fri, 16 Sep 2022 12:23:48 +0000 Received: from HKAPR04MB3956.apcprd04.prod.outlook.com ([fe80::b49a:e8b:f907:610]) by HKAPR04MB3956.apcprd04.prod.outlook.com ([fe80::b49a:e8b:f907:610%9]) with mapi id 15.20.5632.016; Fri, 16 Sep 2022 12:23:48 +0000 From: YunQiang Su To: gcc-patches@gcc.gnu.org Subject: [PATCH v2] MIPS: improve -march=native arch detection Date: Fri, 16 Sep 2022 12:23:14 +0000 Message-Id: <20220916122314.3826744-1-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220802111009.35536-1-yunqiang.su@cipunited.com> References: <20220802111009.35536-1-yunqiang.su@cipunited.com> X-ClientProxiedBy: TYWP286CA0001.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::12) To HKAPR04MB3956.apcprd04.prod.outlook.com (2603:1096:203:d5::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HKAPR04MB3956:EE_|KL1PR0401MB4115:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c11bd70-9644-46a4-24eb-08da97de4e2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cc368XrvUwAwuiZjFz1ezvr6dknPazx25I6hwGlvIhECpmvxlUHonwF5TS6M0oGQxcYxRgDTou150ePCP6Vkc0T3KMTB7EYDEFrbdnaFHEcDLARKK42b15E5WSoVvywnWTWyweg4flKVP29xwbFbJyFgyAWS8TF+4RXnGpQoYvw+kGoOH+7dySgBJq4IRX1P3OBKhdeifGZBQGoQSA5dVzo4z28OuY+CIzbp0Nw0W537Wdsy8+iXRPKbSRXbeYYT0e+FiCMexnzNIgZsfCflwUF2+xE5tStWnsUsrjlqHO0EUh7mgxg2m1Uvg9YKJUMa9MGN/yrfcSqxbxdC5jEpGChB06eJ5Z/uvy3/h6fei0HRULDwrJSv0lCdI1D97zU3Q8DAkXjciO8B9S2BM3R3j37juXFkk1cWvH4BnLm8n1yg8158NVF7p0wNTBiIZUkD6qO8BaQ7sHmcVC2lEoJ0cbnelegdIAUS9F+k/EhNw3du6tZk2/7xVsSgq9pwsw2d9KD69W1ky9rK2WKARPAYulD806Kxnx0VetSs3aUid34/DhcdByhpHZLUHMbCB5YLpKqO/8GrfNRsyKi/8dreVL32U8m4l5sseEx/ERXc+SYhc43UWtRT9c/d9+w3CQyVHHLVd9dPmt1GPYWsf7VY/cRIKKpgpr4DFZv7yMmwDO5dWKZLxP9jmCIT6ZiNYhPf6IpZM6qXHTTV2n8lHzXvMbeAWNmo9EI/s+0ak22JwEgDc5r4MC1PcqGl+WrgLhHViIBCAmq8IARJX/QF2Izu+g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HKAPR04MB3956.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(396003)(376002)(39830400003)(346002)(451199015)(52116002)(6486002)(6506007)(478600001)(107886003)(6666004)(41300700001)(83380400001)(6512007)(26005)(1076003)(186003)(2616005)(5660300002)(2906002)(316002)(8676002)(6916009)(4326008)(8936002)(66556008)(66476007)(66946007)(38350700002)(38100700002)(36756003)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dO17dsvrrudNkbw4WPuxXVt1TxUo0HD/CFbmZtSO3/Om3+wE9LfY77IV/9xGzkM7cN9J+f/k9fI+a+PGWA2yHSMiWm0KsADbA/hCTUgwsnojO543xtN8N+Hrn8szeYkCV5V6ss0RvcRHfuPr9gOqZ4RgKueve9qW7EPV9Q5UYopvNcDjtsDOtKFY1Zf99cvtuFwnU0kXpJ9AjdwQbLCkXrwVhAC88dmw5tqs6eZmSI+61VqJ8K5rhZCegaoOf7bxrPITZCqiNvF6pfXN9AhE5AWaZ08ibzjo1MjEW0U7qTkpDeDDBx+3OFomoKuXV9i/Y7TSRhNc+0tq+/McEnH8lFTqYFH/Nda5LtAdw+bZRKOmFAPcItslLpB67SbATSLIeJF3kzLfIpnnbTJdWI/HqLRsXiVQ3CDJoR4K004YjI6zw4vXP6A6hSW414ShWShNhL41jku/oKhFHVTZ9KlOxi+RnnbakkOEFu5cwYq+8LEtO70yXj5oVwZR187dmKVjaN0j2igstYemQXbHIde0A0mPgQ3IGl8CBr8cEYXsW0njXElyg2wKjN7GueMPSkIH5T42xg+4SWSpIq4ejMusfatGULkkH1jUFPWTmJqenr88OwqAsmxnSpPtHoNY9QOZEdz3KSG/zJptbvPuH7IpnHF8JgE1PoHLf4h2g+RBXjZOZcFc2mOXp6zjIAbf+ol7zTt1TX+i4rhuG9qnjBdcuVCAcEZ5bBwtf6El3JPq1dlh0WyaiEOrhEB9YIDY8wk4yEA6jICgP1+c3yBnGan8ebR2r2YAIzlqohr1SldtkKt++fFcjO2rc0zcfgr6BWLPl7kNHkVwAkYZJQnPVkqnCnslAFqFHXMoL4f7xs17hvUUkTz924oMaB1tQBpJ1G6QFkdhOYN8B5B6x0ILgcjdZu4ATRDoIBkZENIja9C19oMEaQRR6onFwIhAVRMXYh3GS6dxjT6VrF0dZsGmzDtunnt07ZkVjC1OrU8Fn6A1sgA6y921t4gae+wdgkGrqBxlE4UN0gwyzmiF5XxrQbL/CKJGC3Aioo05WXslkeGO1AgYY7cx1os6+AyOWJuGXB/0OfdxVFEL5rn4BXJpPQXwEZ5V0cf78ejv7nil28VgaOSdVpqUCSg5oJF81RwOe0fd20f9QwlUy8tug9q3NMf9CMO8FhlAWW5uCyVEJ1JpdqldWBJC8h5KY3YU4nABmyCN8XUqRqrfDirxgeoHJ7dlel+PXfYstGFTJUgaYd4pgqYSNXHtUe1AXNFgok//gWw7kq2P0J0QDGV0WHBWHRPa3rEkvkdIJuTMzXWVGiR8+Rb6jT3y3xgft8e7Qf5dlzP9bA6sGSws6kSPzYUwuUlec+TJBFBT7AVIp6ovonuEKNsULurzoSqm+MBJRvczupyjS6W250aoQ1XRjCauW3VIxW9yBlpO5UnySJB2WrK7zqK0Tfg15sYTG2+IMVj/6Hxqo3rMsbH0K3tzhhO5wucs7r4B27lR1I1Ga4w9mxh5JYDNcq3kzjPUauZhXd0lXUTgCHuPdq04ms/aDd/QI3nqSdnu/DtaugBLFzH+A/K7Vf2sqjY+hvr1E8JSEAlVZE44XYACgwFfXxTFKuB9+M3Tiw== X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c11bd70-9644-46a4-24eb-08da97de4e2a X-MS-Exchange-CrossTenant-AuthSource: HKAPR04MB3956.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2022 12:23:47.9389 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e31cf5b5-ee69-4d5f-9c69-edeeda2458c0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oUYZz+PvzfUvpm+ngjoK0q6s4+DZgqEVm/0Kh3M8LfpRFMphnWDCwE29Tsr7GamhPzOivqB5R2sTtLNwbW73xC0Xm9XiDQFiQglnm07Bdlc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0401MB4115 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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: 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: , Cc: YunQiang Su , macro@orcam.me.uk Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1740047576977500699?= X-GMAIL-MSGID: =?utf-8?q?1744129060003172118?= If we cannot get info from options and cpuinfo, we try to get from: 1. getauxval(AT_BASE_PLATFORM), introduced since Linux 5.7 2. _MIPS_ARCH from host compiler. mnan=2008 option is also used if __mips_nan2008__ is used. This can fix the wrong loader usage on r5/r6 platform with -march=native. gcc/ChangeLog: * config.gcc: set with_arch to default_mips_arch if no defined. * config/mips/driver-native.cc (host_detect_local_cpu): try getauxval(AT_BASE_PLATFORM) and _MIPS_ARCH, too. pass -mnan=2008 if __mips_nan2008__ is defined. * config.in: define HAVE_SYS_AUXV_H and HAVE_GETAUXVAL. * configure.ac: detect sys/auxv.h and getauxval. * configure: regenerated. --- gcc/config.gcc | 2 ++ gcc/config.in | 10 ++++++++++ gcc/config/mips/driver-native.cc | 25 ++++++++++++++++++++++--- gcc/configure | 4 ++-- gcc/configure.ac | 4 ++-- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index f4e757bd853..181a062825d 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -5590,6 +5590,8 @@ case ${target} in esac if test x$with_arch != x; then default_mips_arch=$with_arch + else + with_arch=$default_mips_arch fi if test x$with_abi != x; then default_mips_abi=$with_abi diff --git a/gcc/config.in b/gcc/config.in index 6ac17be189e..cc217b94e0c 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1939,6 +1939,12 @@ #endif +/* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET +#undef HAVE_SYS_AUXV_H +#endif + + /* Define to 1 if you have the header file. */ #ifndef USED_FOR_TARGET #undef HAVE_SYS_FILE_H @@ -2672,3 +2678,7 @@ #undef vfork #endif +/* Define to 1 if you have the `getauxval' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GETAUXVAL +#endif diff --git a/gcc/config/mips/driver-native.cc b/gcc/config/mips/driver-native.cc index 47627f85ce1..327ad255c3e 100644 --- a/gcc/config/mips/driver-native.cc +++ b/gcc/config/mips/driver-native.cc @@ -23,6 +23,9 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "tm.h" +#ifdef HAVE_SYS_AUXV_H +#include +#endif /* This will be called by the spec parser in gcc.cc when it sees a %:local_cpu_detect(args) construct. Currently it will be called @@ -41,6 +44,7 @@ const char * host_detect_local_cpu (int argc, const char **argv) { const char *cpu = NULL; + char *ret = NULL; char buf[128]; FILE *f; bool arch; @@ -54,7 +58,7 @@ host_detect_local_cpu (int argc, const char **argv) f = fopen ("/proc/cpuinfo", "r"); if (f == NULL) - return NULL; + goto fallback_cpu; while (fgets (buf, sizeof (buf), f) != NULL) if (startswith (buf, "cpu model")) @@ -84,8 +88,23 @@ host_detect_local_cpu (int argc, const char **argv) fclose (f); +fallback_cpu: +#if defined (__mips_nan2008) + ret = reconcat (ret, " -mnan=2008 ", NULL); +#endif + +#ifdef HAVE_GETAUXVAL if (cpu == NULL) - return NULL; + cpu = (const char *) getauxval (AT_BASE_PLATFORM); +#endif + +#if defined (_MIPS_ARCH) + if (cpu == NULL) + cpu = _MIPS_ARCH; +#endif + + if (cpu) + ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL); - return concat ("-m", argv[0], "=", cpu, NULL); + return ret; } diff --git a/gcc/configure b/gcc/configure index 817d765568e..a419ac66576 100755 --- a/gcc/configure +++ b/gcc/configure @@ -9327,7 +9327,7 @@ $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h fi for ac_header in limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \ - fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \ + fcntl.h ftw.h unistd.h sys/auxv.h sys/file.h sys/time.h sys/mman.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h sys/locking.h \ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h do : @@ -10622,7 +10622,7 @@ fi for ac_func in times clock kill getrlimit setrlimit atoq \ popen sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \ - clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2 fstatat + clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2 fstatat getauxval do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/gcc/configure.ac b/gcc/configure.ac index 59f205a1781..b9cc0dda571 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1307,7 +1307,7 @@ ACX_HEADER_STRING AC_HEADER_SYS_WAIT AC_HEADER_TIOCGWINSZ AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h iconv.h \ - fcntl.h ftw.h unistd.h sys/file.h sys/time.h sys/mman.h \ + fcntl.h ftw.h unistd.h sys/auxv.h sys/file.h sys/time.h sys/mman.h \ sys/resource.h sys/param.h sys/times.h sys/stat.h sys/locking.h \ direct.h malloc.h langinfo.h ldfcn.h locale.h wchar.h) @@ -1525,7 +1525,7 @@ define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoq \ popen sysconf strsignal getrusage nl_langinfo \ gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \ - gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2 fstatat) + gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2 fstatat getauxval) if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,