Message ID | 20230815065346.131387-1-andrea.righi@canonical.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1948908vqi; Sat, 19 Aug 2023 03:35:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7ojdBmGLK/K6GrL7iV+1qlFC8dQSYMcaJW1dh6AJVx4n4bs7ccq/92/wYz8fEKCKcbxGU X-Received: by 2002:a17:902:db0c:b0:1bc:61ce:c1b with SMTP id m12-20020a170902db0c00b001bc61ce0c1bmr2170170plx.43.1692441307605; Sat, 19 Aug 2023 03:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692441307; cv=none; d=google.com; s=arc-20160816; b=fA3CE8ULxXWNWhxwHaopd0ataTixxIyneCgnOwgK50LYLVREAm30bqfzbwx03TxKLw Yr6jGPMCXRrrMJJHRlCUUsdtfKzOBKl9w+lUcjHxSRltboL3Rf5YPn1UZF/XNbUUklNO hxPqFm/nHyyvYD2wbaXkzMd1nD7RvHChhs+iImCbV5fFDZDzio6uBdNVCT9d9pu3bnez IeAWZLQfNESErPUUkNBAR5MIKMr2CYmZpAjyC/qtFoYq//qUjO3ppIDvd7VSQ0J5x5L1 7M+XnLgRTGx01gaHOAztpkUXs1FuEAZSO+sSKvfqy9t+GpXlFmr5d66yOCClPqY0mMnN FsVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RB9ghWRFzrC2S/go43Pr90Xm2atl6VsbU7few10mp7c=; fh=D+vSDY2etNnun8frDGKb247lJ5rSlOfJ/L6dSxxUKZE=; b=Pamq42AxR8gczzSQIpBpbIXWveNA/KvdHbi5OkijPqpB9zBlK4vfMo5Qxp7zq6kNHm otJ5TqazXFDTQmpsChS5QkRMf6/5b7KS9S7rpuDrtM5hY8fVfXYBgTnjT5Rd1YqIUVGl ggWnKgyZz/2hnHSLiSS22tpq45Isk2DLfarMw3ew/qWtMj2IIww7M9G8Xq0CpDHVfDNM TNhPBA1+yeAGJiSMBhx2UD44KxlVg28SpkYd3DUrub7/N7SLVWITRMUzaf1CjYsA0ali FA9pYbSr9yVxLG5CfS1t46Io3GilFrVVAzCaP6AoznHPX/oZTa5u30zFoo1MXaWMVqbB aUZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=pRKGziI3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k12-20020a170902c40c00b001bbc6846a21si3457049plk.429.2023.08.19.03.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 03:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=pRKGziI3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A48204E44A; Sat, 19 Aug 2023 01:31:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235268AbjHOGyM (ORCPT <rfc822;shaohuahua6@gmail.com> + 99 others); Tue, 15 Aug 2023 02:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235271AbjHOGx5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 15 Aug 2023 02:53:57 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8C010C6 for <linux-kernel@vger.kernel.org>; Mon, 14 Aug 2023 23:53:55 -0700 (PDT) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 9F2913FA98 for <linux-kernel@vger.kernel.org>; Tue, 15 Aug 2023 06:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1692082434; bh=RB9ghWRFzrC2S/go43Pr90Xm2atl6VsbU7few10mp7c=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pRKGziI3BXeqc6LXVXyXw7DflbYrs5OyS7hZXSZNAahzjDQzl6rfonTDf8cYjtVWv gsBFi2RhXfatlmDBOy9005q14kOChgH9Y9LWrqwmWxqhm/uBOH1hghqcS2PA45HHGt dJwkp81Tbsq9ig4cnZWPhc9Qdr/+wavJkeS3q0PBvJx07rkDIncNlM+sBerznmkWrn yPSDjXcp4WSQGPKKxxm7HRx/0zLC+nOnDJGlU+xqBC/yQOf5V3IlhrnCQB0nPQftzk YCLxyXEA3CKZV2gSy38v0THWxUPRY1kDz+PizX6ALsaJnrEBWqJb/CDfZFdowtNnE2 7uy5XYahnuVHQ== Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-51a5296eb8eso3392889a12.2 for <linux-kernel@vger.kernel.org>; Mon, 14 Aug 2023 23:53:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692082434; x=1692687234; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RB9ghWRFzrC2S/go43Pr90Xm2atl6VsbU7few10mp7c=; b=jVr6yBMZ2R2Oci/xTdis8Dbfbc51i4fVYQ/aS9dfmZMqQGP8n8v+YI6r8Ht/QgiINW itiMEI4z9Tos8S2LAWMSYTNRHyagSTTvqbE9yktUUt3aDsJX5o1FhGPx7p0wjFLI9T9Y 3rF4SY3pni/g5ufushTVy/BasjHywSKpblPBZZF3KgxlkUZDKEp/VWWLUAeBP3W/ZKMo 0/8PkmCEzkS8Oghy2u5Iu9LEZaBREc+sRiH2FrZeS+JT9jc1hsq+3/h2YSpZrgndGxUq Y7E8xMvy+TpYo7dVwWg1iWvzEelF9QOJJfSe2qE7w/N6005NCgNRmEDdEH39f8EskxoO 6XgQ== X-Gm-Message-State: AOJu0YzUfLUaaRSmaKXbMYzXqfWrulytKJ4Bm1PQyF5kC5MtrPR5bcVQ XhEMJ9E7nn6uL9UlEUThNr8fJ0Q6D5gXpgBJtlAZvrYNKiNm/aXVMer5F0EHdj3TpFCBBPyjgsJ pJog2qHpcxAaMNOGnGdWY126fCOfqSWLa8DBQhJqzLg== X-Received: by 2002:aa7:d50e:0:b0:523:d363:1627 with SMTP id y14-20020aa7d50e000000b00523d3631627mr8036445edq.33.1692082434190; Mon, 14 Aug 2023 23:53:54 -0700 (PDT) X-Received: by 2002:aa7:d50e:0:b0:523:d363:1627 with SMTP id y14-20020aa7d50e000000b00523d3631627mr8036436edq.33.1692082433774; Mon, 14 Aug 2023 23:53:53 -0700 (PDT) Received: from localhost.localdomain (host-79-33-195-131.retail.telecomitalia.it. [79.33.195.131]) by smtp.gmail.com with ESMTPSA id n5-20020aa7c785000000b0052338f5b2a4sm6544040eds.86.2023.08.14.23.53.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 23:53:53 -0700 (PDT) From: Andrea Righi <andrea.righi@canonical.com> To: Miguel Ojeda <ojeda@kernel.org>, Alex Gaynor <alex.gaynor@gmail.com>, Wedson Almeida Filho <wedsonaf@gmail.com> Cc: Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>, =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= <bjorn3_gh@protonmail.com>, Benno Lossin <benno.lossin@proton.me>, "Gustavo A . R . Silva" <gustavoars@kernel.org>, Kees Cook <keescook@chromium.org>, Masahiro Yamada <masahiroy@kernel.org>, rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rust: fix bindgen build error with fstrict-flex-arrays Date: Tue, 15 Aug 2023 08:53:46 +0200 Message-Id: <20230815065346.131387-1-andrea.righi@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774649925994932893 X-GMAIL-MSGID: 1774653336191088394 |
Series |
rust: fix bindgen build error with fstrict-flex-arrays
|
|
Commit Message
Andrea Righi
Aug. 15, 2023, 6:53 a.m. UTC
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 <andrea.righi@canonical.com>
---
rust/Makefile | 1 +
1 file changed, 1 insertion(+)
Comments
On Tue, 15 Aug 2023 08:53:46 +0200 Andrea Righi <andrea.righi@canonical.com> 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 <andrea.righi@canonical.com> Tested-by: Gary Guo <gary@garyguo.net> > --- > 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`.
On Tue, Aug 15, 2023 at 8:54 AM Andrea Righi <andrea.righi@canonical.com> 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 <andrea.righi@canonical.com> Applied to `rust-fixes` (with an extra summary of the discussion in the list), thanks everyone! Cheers, Miguel
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`.