Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp159356rdh; Sat, 23 Sep 2023 05:42:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyCABnMDPa7ldf0CW1AoV4Y7LvYFBhO7LBtzj91B/B3XYQ6EM9MwIRtroEPk4HEq6gnt9m X-Received: by 2002:a17:903:191:b0:1c3:9544:cf63 with SMTP id z17-20020a170903019100b001c39544cf63mr2214398plg.23.1695472922635; Sat, 23 Sep 2023 05:42:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695472922; cv=pass; d=google.com; s=arc-20160816; b=sq2XXRAL9LDmhYUybOPNyhaC5n3Ff0Sf01rmjO7EO44oIkZN0nkuBVMML/MR0ZZyMJ lF2BO466L48tY7+F/zqKkMkUgiXtEgcnA0Ns0H3fcA0if0SNvLo4/k0xM9cN54NV6DKE +alRTg/DbH/H0x/75GZVEQZZYB+p2+SNeSDn7MsrUYLmjxPupCcTZVFyScn9y/Q95xxI 98rfuRvlZ0AfGrL5zG5W9MvTdNAzfOQ15RYby2KukNfm+0m36EIKYklL5n+VchcFsefr IZorfLrf2De+be9MNo4wVA5x9wWFrqDvmr8iCVuVBlNKjKvj5Z/eF66E5FisKj9sQDJU KtHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=esP9VJu+yggbsgs4J5u9gvpAQrz11NA5jL5d5zmBa7c=; fh=W4sfvSbOk4n8bAQLUGSVaXRQ8ZvHVNbWyFM4AEjP6FA=; b=Nwf6BmNHL3iNxFceu98+ClaWdVtC4AFC5u/0GyhhGSueVWdWYeYhZmP9EEfEIpa4b7 914m+BFiopNbdV7o0W/a+zY2rX3bDqA/5L7zelb1m6cmXzS5PRDhUetQ/7u5tZt4brNC vS171gZzqpnBpeMWxMrTT1h7mcDuz/TIPuVUJKk9y2gD2RbJlKCXSE403IOM4Z4u9xFv oxJxyALxjWV8tcYtAnGgXT76PsDJcnMOWobA8xN7oEcs0XpQOK2LItLjBPGakiW9cxtp SS3IHyuBldUjsbEPhsEVOeB4XRJ691XAVRgvoyrbapcB2gIzEmVmezcgVbV9rvwKcov7 X5+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@garyguo.net header.s=selector1 header.b=uJWbAnb8; arc=pass (i=1 spf=pass spfdomain=garyguo.net dkim=pass dkdomain=garyguo.net dmarc=pass fromdomain=garyguo.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id o7-20020a170902d4c700b001c3411c9b83si5917304plg.454.2023.09.23.05.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 05:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@garyguo.net header.s=selector1 header.b=uJWbAnb8; arc=pass (i=1 spf=pass spfdomain=garyguo.net dkim=pass dkdomain=garyguo.net dmarc=pass fromdomain=garyguo.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id ECA8782D32E6; Fri, 22 Sep 2023 20:44:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbjIWDoZ (ORCPT + 99 others); Fri, 22 Sep 2023 23:44:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjIWDoY (ORCPT ); Fri, 22 Sep 2023 23:44:24 -0400 Received: from GBR01-LO2-obe.outbound.protection.outlook.com (mail-lo2gbr01on2128.outbound.protection.outlook.com [40.107.10.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05D771A5; Fri, 22 Sep 2023 20:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aNXZ9CkFkn6rbZ/i8+t4MUAy4HR81uz3u87ufb9TEPyCsT9gQsT9LkXMRl8UwLYkGSv/Zz1mtOGWKhqVjNLNJXlcTDGlf2YjsePOIvYvWbWW276Fo40T4r0ke5td2gRrcleH1OyMa+LgsrGMvL6tKffzkqjrkGddP/UdX2+9kAvZEenlpZnYYpXLTfte7Up7/xJS8HVV1wBiEIonwJVckOtGoRNdMse2WX/zKx6icksfuvEHA+UoEXrcpvdZzlTO2gwlD0wt+kkrIOTmRUPlxw1Ol96P/TCMC5Is9+8eh8lvWIJJG9gm7nADkmlR0PrPaARsxBQCdNgL5ptGugeATA== 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=esP9VJu+yggbsgs4J5u9gvpAQrz11NA5jL5d5zmBa7c=; b=iiw5XmNVFtqzzqCukaf3JRvIbJMIUxIwlH81VeXvuhw/621d1hKQWeqEJbdarhHAXNkHotbg+EBNr/aN7WtGyXTWTS4jtwYmIDATAjJfZM3PCP6Zkyeh9Yio7ucKBM7EeyC01z+sUpXpkIuQ0Hj8wOxESClb+AzlSXnc5VX1xP8i03J453V8VvBztJvTs0GIJnFbYObYpXLw18n7mGNnf8pq08FhwgEM8MmI4PV8e86XIT6oRyjXcowYyZdVdBdLibd8qvLeSQ95HLfgY7vVJrJWYdV87aE5J5/OnWxFnYh9CxR72SiZKQ3GuUoZYYHCzGEygwjxjlnN06N1Kgm9aQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=garyguo.net; dmarc=pass action=none header.from=garyguo.net; dkim=pass header.d=garyguo.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=garyguo.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=esP9VJu+yggbsgs4J5u9gvpAQrz11NA5jL5d5zmBa7c=; b=uJWbAnb8aGhDF2C3qknTaue/CuvgjCfJDReGt4Oj91NfbHZJ3ymOFmpO0HMH+Q5npqMacR7u/dSvwWyL3BL0iwz/I9odZ+EDTlF2yTLax+1qPV7uK9NRUEF+GN42Q7eODaqqtK2ubLOvwQNfvzZ5Dk6s6Ljoh1GwFgiowuB7BAA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=garyguo.net; Received: from LO2P265MB5183.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:253::10) by CWLP265MB6248.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:180::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.25; Sat, 23 Sep 2023 03:44:14 +0000 Received: from LO2P265MB5183.GBRP265.PROD.OUTLOOK.COM ([fe80::7965:8756:9ad5:df1d]) by LO2P265MB5183.GBRP265.PROD.OUTLOOK.COM ([fe80::7965:8756:9ad5:df1d%6]) with mapi id 15.20.6813.017; Sat, 23 Sep 2023 03:44:14 +0000 Date: Sat, 23 Sep 2023 11:43:56 +0800 From: Gary Guo To: Andrea Righi Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , =?UTF-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , "Gustavo A . R . Silva" , Kees Cook , Masahiro Yamada , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rust: fix bindgen build error with fstrict-flex-arrays Message-ID: <20230923114356.537aa84a@gary-lowrisc-laptop> In-Reply-To: <20230815065346.131387-1-andrea.righi@canonical.com> References: <20230815065346.131387-1-andrea.righi@canonical.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-ClientProxiedBy: TYCPR01CA0102.jpnprd01.prod.outlook.com (2603:1096:405:4::18) To LO2P265MB5183.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:253::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2P265MB5183:EE_|CWLP265MB6248:EE_ X-MS-Office365-Filtering-Correlation-Id: 74678a4b-c026-453e-f065-08dbbbe75b1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V2zZHDmJ5hQcRP4AJtoYimVpRjhFl42FZikQyYlChx9AEd7mzAO15d7SVbyT8l6kWLejMw5x36lRq32QZ54grNRTqbkEeEY6BSiR061d/7EfXK8g6t0aCbnncVuwPUOZjq4zyQ9M4I4qV8taFeK862gMMeLktpfhfPQmM71XBJY4QyCNmUQZgO0OYixhipmgr36TyS21NyKQzUmPc5PhjWsJCtsI6uG36A0IbNWhNbffLd6wBZJh+QmVXHtNucr+oXka78vpKvjZbfh1G8M+VeQKAiTsL8cKelMrI2V2YbJqVV3YXACiN9MT7TmaOxtc+fapmhKMbT4puNcPHyyx5hQXsDzavKBFEVdVz/wlMn89Qy7V1teFqgkD24SjAmC8apbONLH3G+UW+xJGczz2a741ByOfVNDurdnPBcIu+iSj+lQ/NxHa3g0E+jZe3c2DMNzGaWKkgzXQ8p/3zKdnPeUf+kY4YChRZPz5Zola3fuVCny00hu9IIak84qqf3QXZIaH73tykOnoMRjHJyhfoS7zPCtSFawd78RfwSghhOjR6FiTsQpU6JDqDQIwSHII X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LO2P265MB5183.GBRP265.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(7916004)(396003)(376002)(136003)(39830400003)(346002)(366004)(230922051799003)(186009)(451199024)(1800799009)(2906002)(7416002)(5660300002)(54906003)(8936002)(66946007)(66476007)(66556008)(33716001)(478600001)(6666004)(6486002)(6506007)(9686003)(38100700002)(6512007)(26005)(1076003)(86362001)(6916009)(41300700001)(4326008)(316002)(8676002)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?s+2Sy8GRYsk2eb41cRTxWBiq3uWamcFl4V+By96XkvS8u7igeGgLlGDkqQ7w?= =?us-ascii?Q?MOvFTGYoutoh3LcutepuUTFreqkgiufKM3AJhssqJKM5HVLh0rIG9CZERMZF?= =?us-ascii?Q?YWreoqCPntYoUC6KiLAeoASQmjFhDeZyBvvcT2Knt0e0ymEdtDUWx+8sfnCg?= =?us-ascii?Q?ZrNKc6RSNnei6+dsW9eom2UeelLAkwjHxkwQ+6Rvdk/C2+PIr8wKSc6elUBt?= =?us-ascii?Q?MvcHIhOHSO3EOdvVV2ONMrWeXBlsJPNC/OHuq4+ziVsW6jty3gUmgk1/VqYB?= =?us-ascii?Q?GZZAHvdMtOJs0kSmBqPWEJlhMlLPPTg+e6s9AUM4RglF+oIguT5PmQgawCgv?= =?us-ascii?Q?FuDM6qF72zGOICHUyWeGgvAFq/KV78Mmuz17xAKn36ZFBTxnKBM9jYCY/nJW?= =?us-ascii?Q?/Sb2gxTZ37oENw/q8mk1JnloU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?= =?us-ascii?Q?/pmMjowiPjk6q27k7fu9UgbKKVsxL7jp2ga6tArkk3bwh0GwsFNtqD8W6q+3?= =?us-ascii?Q?smmOtsNGTe3CqGl8R/KpavJD14pbjOeBqwUNOES5kBqai5+IPRnVWtW++H6w?= =?us-ascii?Q?aEOa0xXGiFgQmkTsuaRl8VXh8FGzgCUx9Ajn2hGnGdYFMt52YMvdNZcOpOed?= =?us-ascii?Q?3nSRcw3ss8obaW2pN/HJhyM1mxJL1BJFxENsohrg+bq69Z4F4Q6NUmbif1+O?= =?us-ascii?Q?C+bwc4t0jFSLow0nETLHN8NziF6LvIqBl86CJPdG?= X-OriginatorOrg: garyguo.net X-MS-Exchange-CrossTenant-Network-Message-Id: 74678a4b-c026-453e-f065-08dbbbe75b1b X-MS-Exchange-CrossTenant-AuthSource: LO2P265MB5183.GBRP265.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2023 03:44:14.4443 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bbc898ad-b10f-4e10-8552-d9377b823d45 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VUvcuLVnmUqs436H7I4fXH58COL72a1wwBZryeuyxK8a2TE+A+5Mc3m0XbHU1CZhFFOhJwT8YnLM/uBcURypNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB6248 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 20:44:28 -0700 (PDT) X-Spam-Level: ** On Tue, 15 Aug 2023 08:53:46 +0200 Andrea Righi wrote: > Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") enabled > '-fstrict-flex-arrays=3' globally, but bindgen does not recognized this > compiler option, triggering the following build error: > > error: unknown argument: '-fstrict-flex-arrays=3', err: true > > Add '-fstrict-flex-arrays' to the list of cflags that should be ignored > by bindgen. > > Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") > Signed-off-by: Andrea Righi Tested-by: Gary Guo > --- > rust/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/rust/Makefile b/rust/Makefile > index 4124bfa01798..ae2f5421da25 100644 > --- a/rust/Makefile > +++ b/rust/Makefile > @@ -258,6 +258,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \ > -fno-reorder-blocks -fno-allow-store-data-races -fasan-shadow-offset=% \ > -fzero-call-used-regs=% -fno-stack-clash-protection \ > -fno-inline-functions-called-once -fsanitize=bounds-strict \ > + -fstrict-flex-arrays=% \ > --param=% --param asan-% > > # Derived from `scripts/Makefile.clang`.