From patchwork Fri Jan 6 10:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YunQiang Su X-Patchwork-Id: 40081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp752852wrt; Fri, 6 Jan 2023 02:37:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXt8WuapD7G5jRxGRJNnAtk7REFsB8MfWPDB/LQJcZfME+V5GPy65qAYOLI5mtktO97nop7q X-Received: by 2002:a17:906:281b:b0:7c1:5863:f8c4 with SMTP id r27-20020a170906281b00b007c15863f8c4mr45917400ejc.21.1673001455594; Fri, 06 Jan 2023 02:37:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673001455; cv=pass; d=google.com; s=arc-20160816; b=nJgNfrJPTK78T81gZ10v8TQg5BKeDLlIwAsudj09gzMRZpsUUVPvyr4RqtXg0IGDIC f3rbSBvWSCmR/Xm/qBMMXag1t0bIaCLLwMiCyfu/JH90OotwycPL31N8fHCS0qabQcCd IbfD1BKklBFA/OLvRxYEPrfI9mJbympCZXNgOrQdGAykTN4/CrsSFEi4pqTNzpYlF06N MnIhmH+DSug9aO5yuwlELa+AtqqYKCAD5QIA9FKvCqP/Cu+Z0wR6JbsW3p0dGO2g2s5k RiE1Z/J6y9kE6g1KnOqMxJGc3+I1CQFL5CMeUcAb5pE5s7vWFX/wj+P6VvhTiOQ0BxK0 NSzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature:dmarc-filter:delivered-to; bh=vG9s07F1gatYuQ/e1o65yNAUdQuncSlykvJSQl4Jfa8=; b=a3UWxKM5b5H22x9Nn5GIaux9l/ZtftjN4HA5WeHwkaCi+g5fE++kIMclWo9+j/6NCN SKZu2giLDgj0kmtCh+pHl56jvvKlgh4eTdPoiVPWQlxmWGOYwhrzmuEryG+cc4bUytbb p5FRuQ2UuW93FwtREe8umFknkqeUJLCWy5t3x7nJzjbCJdD/iDBb4ISZot8VhkUHW7Mw bTClAqh4wWDHIo4IKE+YWAeImKebFSNScOcm8Rsi7c1VYqb9nOfu2I2OIgOU/P4ZyI6U Z5DOTc2P9r2yf/u9kVntK7PdRgNiWetJe6QLmJ3NRugqWV56tzvsAq0TOHFGmgZO6Gs6 yQHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=OJKolj5Y; 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 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id gb7-20020a170907960700b007c5182841dfsi959537ejc.4.2023.01.06.02.37.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 02:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@cipunited.onmicrosoft.com header.s=selector1-cipunited-onmicrosoft-com header.b=OJKolj5Y; 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 8.43.85.97 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 786693858280 for ; Fri, 6 Jan 2023 10:37:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2100.outbound.protection.outlook.com [40.107.215.100]) by sourceware.org (Postfix) with ESMTPS id 117AF3858D28 for ; Fri, 6 Jan 2023 10:37:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 117AF3858D28 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=HjhoSt7+dgOmx8OoBTS25O9SJf2UfR2A1JuYFAh3Cj0cFuSRpjwbX3ZH9bTNauTtESo7zyxH1x37Ifch4k5CFcTPxroB6kuOWNCwAzx1zfv/rpc3VL7P1FU39V6rCTv3d0wY0r+ws4f1sjB73pHG2mi+wAYj9VTzFTMavqXI3Ojs429b4V4MG81OTMB3yuW2dS5UHq6VLn6IIwBBdTWeZqDExRLkn//UQVVdIks7u1ixY3AbGOojMd8vbAZHrXS04Ht4JnK6bXKbRNopHDcbGXMIvYi6W9th8LvcZc9B87DIBRufUI6x1zOUqP/jjJz08PJyvoLnTG1Ex76dfoOllg== 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=vG9s07F1gatYuQ/e1o65yNAUdQuncSlykvJSQl4Jfa8=; b=PQxpS97HLU35xAsosBHYXgTZxFibraFYdrfuysSJyxuIRx523zSWX/MVdr7G5Ctarf+f0PbogmxpFVukRvxP9u7F6YhcSXFyTB/t9FLqqXMNfrOlxtF7J4GrUIm9QUe5bUz3/xz2vQGjHja0RZTbQKu4felu7TY4gXrpI1y2e2/9vG8NmwxKWJLckRFTK8w+PlMKMUXarLzaIxIza3BIKHwjnm3cxV6ZQGEZep+6MvkmFvOxtNcUgmIIreMKxD2Ys93HKKAsc+PdoAsVJT+z4oTunI+EItwognYJxek/F8mkM4TcczmNZ4fvo+3Ku+QFy7fFH8VmXSBWTy6UpNTL3w== 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=vG9s07F1gatYuQ/e1o65yNAUdQuncSlykvJSQl4Jfa8=; b=OJKolj5YX+u0LmzHnmaFNroIk7i3/ZR5aY2FiTrOZKdZlRRcsKGEUlxOVL+UPZl5e28OEBMDYl3Pp9kx3FoSj1hYffAccnHyE4wOL85EIICmbRk/D9R+hQabH0wrmUG9c6Yjd6rzkEtRfYcGi+rHj9C+B64r4u11IB33txbSuFs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cipunited.com; Received: from TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) by TYZPR04MB6571.apcprd04.prod.outlook.com (2603:1096:400:269::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.9; Fri, 6 Jan 2023 10:37:00 +0000 Received: from TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::cfd9:452b:141a:1794]) by TYZPR04MB6117.apcprd04.prod.outlook.com ([fe80::cfd9:452b:141a:1794%5]) with mapi id 15.20.5986.014; Fri, 6 Jan 2023 10:37:00 +0000 From: YunQiang Su To: gcc-patches@gcc.gnu.org Cc: aurelien@aurel32.net, adhemerval.zanella@linaro.org, jiaxun.yang@flygoat.com, macro@orcam.me.uk, syq@debian.org, jakub@redhat.com, dodji@redhat.com, kcc@google.com, dvyukov@google.com, YunQiang Su Subject: [PATCH] libsanitizer/mips: always build with largefile support Date: Fri, 6 Jan 2023 18:36:32 +0800 Message-Id: <20230106103632.3951217-1-yunqiang.su@cipunited.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: TYAPR01CA0184.jpnprd01.prod.outlook.com (2603:1096:404:ba::28) To TYZPR04MB6117.apcprd04.prod.outlook.com (2603:1096:400:25a::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR04MB6117:EE_|TYZPR04MB6571:EE_ X-MS-Office365-Filtering-Correlation-Id: 9263afdd-e5bb-452c-e817-08daefd1f105 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B8fmWJ4yqtgo7KyH0nmvsDQiAjKXr4iKWB+oqua1dErAS1g0yXdMm/o5+bjBbM5cSCZnGRyesv1dTw3vEp8slopziIPxHaYOymfQ6sOFi6Mznmyf3xYY3nPS+I9j0e3sXGTCIVolLZYNq4gGoVCG8cGUvz0Qsjiif52gn8211LK5qOTioJFmSC8xHtwJrRpk+htlHxUZZCUeGbk42eHWzHGydXlCHR6PctjqbLYgwoBVqmI4SiYltjL7jjyjjbRtxnUJg29iTOdBW7JDW598axOO0xf5wbL13D1z+EbH0GklgkpqtJrz0hOdFYTJLDn4bfaNDD+6O/0cjhm1uoMYQ8zXjljHyf9a5XPNLy2wF6CCXU6KC3IpbkJ2W0r/roH35mue2oOhZTnPUAE0cB1R0gDsldXMmh5eupLn6qIA8WqSPpSH34JgmmFuXT4IPiNNWgjM8hlWj/uwvT1XGhfQMq9u8zA7zUy5VwSf6WYB4HsI9MC+sEZZMq5Tk0MPaZi39lJpdSSg5VrRJf+Lt6bGbrvckSlzVa5coRCDgMrYQLT+5mc33I3sXe1MoDddM9Kvz9Vo3MpSjKmcuvTKyc0DIFHCPOPWuLorEg8EA5emE02C0EmO3MdoAFFflWHI6PcK4AsdbXQRSWe5lr3zlDleM0wxsmym7d0ooQF/e8c4T/zBxgv3cfaXGu7bC7E+dO5RFdKXU7Bu5+HVSqObwdYOpw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR04MB6117.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39830400003)(396003)(346002)(376002)(366004)(451199015)(38100700002)(6916009)(2906002)(38350700002)(86362001)(316002)(52116002)(4326008)(6486002)(41300700001)(7416002)(66946007)(66556008)(478600001)(1076003)(5660300002)(66476007)(8676002)(6666004)(26005)(83380400001)(2616005)(186003)(8936002)(6512007)(6506007)(107886003)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d9ZYF5mlZmznh6H3yrZMhqWPnfzA76XqF59PB2uCl+1s/+aPz6n5ic8bg++W4OsBPcroTNS5iK/U9bnjnnmT1mKSSXeuYAO3BFBLMvoaQez1ZfmtzrXqb6/ZjUQIfR/iL8SIB0SRN9vT6EhNwes0uL9pDMKDij3D0xEftjTWNJal/QD8teyaSwCEzs0mI1IyjeSCNVwMy7xcvZT8ndSW2D6Mpipz9iMBbXHSkB7WAM9MpC7wVokRuYkv2p1gl9v7S+6UGsiHxbcxArQx0xVp/dvQXWdIPEffv5W4f3lDzMQLhDGrbHG3t+U5uS6fEdQJpZftbcWwOG6eFdjYkjO38jSd8LSmfaMazlIJ1h4agzxkzgTTWaDtHKpcm8Yjau6lEVLgGEWXdVWhOxSjSvLJ/vdMmpkCMpCtghdPJe9ghgyh13Gu2iZOxBIso/FB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gXRwNi9JbNxLgqDnkSB7vkdyvfHBoH+KAiRV+0kUur1oSkp0Jf7UiCh+oCPGV0kJUCeuQCFXsRO3AELAj9xE2VLyxSw8KCHayoiqrhOtG3eiDMYMDDhYQJ1A== X-OriginatorOrg: cipunited.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9263afdd-e5bb-452c-e817-08daefd1f105 X-MS-Exchange-CrossTenant-AuthSource: TYZPR04MB6117.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2023 10:36:59.9601 (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: HcdsPfHS79lJYeD/vdzjIrIjn20jW6tXnD4k586zyrOWcLtXZ6Mc+a+z2AQhKTi78E0nWDmmALggpmeRcO1KGDqOw4sezHlYz8JPIlPZOO0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR04MB6571 X-Spam-Status: No, score=-13.0 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: , 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?1754269173900038605?= X-GMAIL-MSGID: =?utf-8?q?1754269173900038605?= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 is always used for mips when build libsanitizer in LLVM. Thus FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 176 : 160, 216); instead of FIRST_32_SECOND_64((_MIPS_SIM == _ABIN32) ? 160 : 144, 216); in sanitizer_platform_limits_posix.h. To keep sync with LLVM and to make the code simple, we use the largefile options always. libsanitizer/ * configure.ac: set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 always for mips*. * configure: Regenerate. --- libsanitizer/configure | 13 ++++++++++--- libsanitizer/configure.ac | 12 ++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/libsanitizer/configure b/libsanitizer/configure index d3de3dbba51..d4ee0fac3e7 100755 --- a/libsanitizer/configure +++ b/libsanitizer/configure @@ -17045,9 +17045,16 @@ else $as_echo "no" >&6; } fi -EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS" -EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS" -EXTRA_ASFLAGS=$CET_FLAGS +# Always set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to sync with LLVM, +# and keep struct *stat* have the same size. +case "${host}" in + mips*-*) FILE64_FLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ;; + *) FILE64_FLAGS="" ;; +esac + +EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS $FILE64_FLAGS" +EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS $FILE64_FLAGS" +EXTRA_ASFLAGS="$CET_FLAGS $FILE64_FLAGS" diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac index ad49f29db7e..04cd8910ed6 100644 --- a/libsanitizer/configure.ac +++ b/libsanitizer/configure.ac @@ -416,8 +416,16 @@ GCC_BASE_VER # Add CET specific flags if Intel CET is enabled. GCC_CET_FLAGS(CET_FLAGS) -EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS" -EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS" + +# Always set -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to sync with LLVM, +# and keep struct *stat* have the same size. +case "${host}" in + mips*-*) FILE64_FLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ;; + *) FILE64_FLAGS="" ;; +esac + +EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS $FILE64_FLAGS" +EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $CET_FLAGS $FILE64_FLAGS" EXTRA_ASFLAGS=$CET_FLAGS AC_SUBST(EXTRA_ASFLAGS) AC_SUBST(EXTRA_CFLAGS)