public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Masahiro Yamada <masahiroy@kernel.org>
Cc: Adam Bratschi-Kaye <ark.email@gmail.com>,
	Alex Gaynor <alex.gaynor@gmail.com>,
	Antonio Terceiro <antonio.terceiro@linaro.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Boris-Chengbiao Zhou <bobo1239@web.de>, Daniel Xu <dxu@dxuuu.xyz>,
	Dariusz Sosnowski <dsosnowski@dsosnowski.pl>,
	Douglas Su <d0u9.su@outlook.com>,
	Elliot Berman <quic_eberman@quicinc.com>,
	Finn Behrens <me@kloenk.de>, Gary Guo <gary@garyguo.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Miguel Cano <macanroj@gmail.com>, Miguel Ojeda <ojeda@kernel.org>,
	Sven Van Asbroeck <thesven73@gmail.com>,
	Wedson Almeida Filho <wedsonaf@google.com>
Subject: linux-next: manual merge of the rust tree with the kbuild tree
Date: Thu, 17 Mar 2022 17:02:54 +1100	[thread overview]
Message-ID: <20220317170254.0f6e3bac@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4130 bytes --]

Hi all,

Today's linux-next merge of the rust tree got a conflict in:

  Makefile

between commit:

  f67695c9962e ("kbuild: Add environment variables for userprogs flags")

from the kbuild tree and commit:

  e2e7cf27b587 ("Kbuild: add Rust support")

from the rust tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc Makefile
index d2269ea42eac,67008a2d964c..000000000000
--- a/Makefile
+++ b/Makefile
@@@ -430,15 -437,32 +437,34 @@@ els
  HOSTCC	= gcc
  HOSTCXX	= g++
  endif
+ HOSTRUSTC = rustc
  
 -export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
 -			      -O2 -fomit-frame-pointer -std=gnu89
 -export KBUILD_USERLDFLAGS :=
 +KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
 +			 -O2 -fomit-frame-pointer -std=gnu11 \
 +			 -Wdeclaration-after-statement
 +KBUILD_USERCFLAGS  := $(KBUILD_USERHOSTCFLAGS) $(USERCFLAGS)
 +KBUILD_USERLDFLAGS := $(USERLDFLAGS)
  
+ # These flags apply to all Rust code in the tree, including the kernel and
+ # host programs.
+ export rust_common_flags := --edition=2021 \
+ 			    -Zbinary_dep_depinfo=y \
+ 			    -Dunsafe_op_in_unsafe_fn -Drust_2018_idioms \
+ 			    -Dunreachable_pub -Dnon_ascii_idents \
+ 			    -Wmissing_docs \
+ 			    -Drustdoc::missing_crate_level_docs \
+ 			    -Dclippy::correctness -Dclippy::style \
+ 			    -Dclippy::suspicious -Dclippy::complexity \
+ 			    -Dclippy::perf \
+ 			    -Dclippy::let_unit_value -Dclippy::mut_mut \
+ 			    -Dclippy::needless_bitwise_bool \
+ 			    -Dclippy::needless_continue \
+ 			    -Wclippy::dbg_macro
+ 
 -KBUILD_HOSTCFLAGS   := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
 +KBUILD_HOSTCFLAGS   := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
  KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
+ KBUILD_HOSTRUSTFLAGS := $(rust_common_flags) -O -Cstrip=debuginfo \
+ 			-Zallow-features= $(HOSTRUSTFLAGS)
  KBUILD_HOSTLDFLAGS  := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
  KBUILD_HOSTLDLIBS   := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
  
@@@ -517,12 -549,23 +551,23 @@@ KBUILD_CFLAGS   := -Wall -Wundef -Werro
  		   -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
  		   -Werror=implicit-function-declaration -Werror=implicit-int \
  		   -Werror=return-type -Wno-format-security \
 -		   -std=gnu89
 +		   -std=gnu11
  KBUILD_CPPFLAGS := -D__KERNEL__
+ KBUILD_RUSTFLAGS := $(rust_common_flags) \
+ 		    --target=$(objtree)/rust/target.json \
+ 		    -Cpanic=abort -Cembed-bitcode=n -Clto=n \
+ 		    -Cforce-unwind-tables=n -Ccodegen-units=1 \
+ 		    -Csymbol-mangling-version=v0 \
+ 		    -Crelocation-model=static \
+ 		    -Zfunction-sections=n \
+ 		    -Dclippy::float_arithmetic
+ 
  KBUILD_AFLAGS_KERNEL :=
  KBUILD_CFLAGS_KERNEL :=
+ KBUILD_RUSTFLAGS_KERNEL :=
  KBUILD_AFLAGS_MODULE  := -DMODULE
  KBUILD_CFLAGS_MODULE  := -DMODULE
+ KBUILD_RUSTFLAGS_MODULE := --cfg MODULE
  KBUILD_LDFLAGS_MODULE :=
  KBUILD_LDFLAGS :=
  CLANG_FLAGS :=
@@@ -783,9 -858,12 +861,12 @@@ KBUILD_CFLAGS += $(stackp-flags-y
  KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
  KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
  
+ KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings
+ KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y)
+ 
  ifdef CONFIG_CC_IS_CLANG
  KBUILD_CPPFLAGS += -Qunused-arguments
 -# The kernel builds with '-std=gnu89' so use of GNU extensions is acceptable.
 +# The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable.
  KBUILD_CFLAGS += -Wno-gnu
  # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
  # source of a reference will be _MergedGlobals and not on of the whitelisted names.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2022-03-17  6:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  6:02 Stephen Rothwell [this message]
2022-03-17  7:11 ` linux-next: manual merge of the rust tree with the kbuild tree Miguel Ojeda
  -- strict thread matches above, loose matches on Subject: below --
2025-03-17  9:38 Stephen Rothwell
2025-03-17 19:36 ` Miguel Ojeda
2025-03-31 23:58 ` Stephen Rothwell
2024-05-06  5:33 Stephen Rothwell
2024-05-06 10:19 ` Miguel Ojeda
2024-05-14  0:20 ` Stephen Rothwell
2022-09-27 18:16 broonie
2022-09-28 17:16 ` Miguel Ojeda
2022-10-04 22:23 ` Stephen Rothwell
2022-09-26 23:12 broonie
2022-09-27 12:47 ` Miguel Ojeda
2022-09-12  7:41 Stephen Rothwell
2022-08-02 23:38 broonie
2022-08-03  9:28 ` Miguel Ojeda
2022-08-14 23:08 ` Stephen Rothwell
2022-04-05  3:14 Stephen Rothwell
2022-04-05  8:33 ` Miguel Ojeda
2022-01-17 23:51 Stephen Rothwell
2021-12-07  5:13 Stephen Rothwell
2021-12-03  5:20 Stephen Rothwell
2021-12-03  9:05 ` Miguel Ojeda
2021-10-15  7:24 Stephen Rothwell
2021-10-15 12:24 ` Miguel Ojeda
2021-10-28  9:09 ` Stephen Rothwell
2021-10-28 11:06   ` Miguel Ojeda
2021-10-06  5:46 Stephen Rothwell
2021-08-11  7:26 Stephen Rothwell
2021-08-11 17:04 ` Nick Desaulniers
2021-08-12  6:34   ` Stephen Rothwell
2021-03-29  7:32 Stephen Rothwell
2021-03-18  4:37 Stephen Rothwell
2021-03-18  5:04 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220317170254.0f6e3bac@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=alex.gaynor@gmail.com \
    --cc=antonio.terceiro@linaro.org \
    --cc=ark.email@gmail.com \
    --cc=bobo1239@web.de \
    --cc=boqun.feng@gmail.com \
    --cc=d0u9.su@outlook.com \
    --cc=dsosnowski@dsosnowski.pl \
    --cc=dxu@dxuuu.xyz \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=macanroj@gmail.com \
    --cc=masahiroy@kernel.org \
    --cc=me@kloenk.de \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=ojeda@kernel.org \
    --cc=quic_eberman@quicinc.com \
    --cc=thesven73@gmail.com \
    --cc=wedsonaf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox