From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Jens Axboe <axboe@kernel.dk>,
Masahiro Yamada <masahiroy@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
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>,
David Gow <davidgow@google.com>, Douglas Su <d0u9.su@outlook.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 block and kbuild trees
Date: Tue, 12 Jul 2022 17:39:56 +1000 [thread overview]
Message-ID: <20220712173956.540d3baa@canb.auug.org.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 4811 bytes --]
Hi all,
Today's linux-next merge of the rust tree got a conflict in:
Makefile
between commit:
239b2db7c7ca ("io_uring: move to separate directory")
from the block tree, commit:
b63a0c3e51a4 ("kbuild: drop support for CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3")
from the kbuild tree and commit:
0ea4b9a1bece ("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 ffc170d3d0ce,ce17ec71f89b..000000000000
--- a/Makefile
+++ b/Makefile
@@@ -436,7 -445,7 +445,8 @@@ els
HOSTCC = gcc
HOSTCXX = g++
endif
+HOSTPKG_CONFIG = pkg-config
+ HOSTRUSTC = rustc
KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
-O2 -fomit-frame-pointer -std=gnu11 \
@@@ -534,7 -580,23 +581,23 @@@ KBUILD_LDFLAGS_MODULE :
KBUILD_LDFLAGS :=
CLANG_FLAGS :=
+ ifeq ($(KBUILD_CLIPPY),1)
+ RUSTC_OR_CLIPPY_QUIET := CLIPPY
+ RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER)
+ else
+ RUSTC_OR_CLIPPY_QUIET := RUSTC
+ RUSTC_OR_CLIPPY = $(RUSTC)
+ endif
+
+ ifdef RUST_LIB_SRC
+ export RUST_LIB_SRC
+ endif
+
+ export RUSTC_BOOTSTRAP := 1
+
-export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
+export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
+ export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET RUSTC_OR_CLIPPY BINDGEN CARGO
+ export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
@@@ -755,9 -818,27 +819,24 @@@ KBUILD_CFLAGS += $(call cc-disable-warn
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
KBUILD_CFLAGS += -O2
+ KBUILD_RUSTFLAGS_OPT_LEVEL_MAP := 2
-else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
-KBUILD_CFLAGS += -O3
-KBUILD_RUSTFLAGS_OPT_LEVEL_MAP := 3
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
- endif
+ KBUILD_RUSTFLAGS_OPT_LEVEL_MAP := s
+ endif
+
+ # Always set `debug-assertions` and `overflow-checks` because their default
+ # depends on `opt-level` and `debug-assertions`, respectively.
+ KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n)
+ KBUILD_RUSTFLAGS += -Coverflow-checks=$(if $(CONFIG_RUST_OVERFLOW_CHECKS),y,n)
+ KBUILD_RUSTFLAGS += -Copt-level=$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C),$(KBUILD_RUSTFLAGS_OPT_LEVEL_MAP))$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_0),0)$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_1),1)$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_2),2)$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_3),3)$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_S),s)$\
+ $(if $(CONFIG_RUST_OPT_LEVEL_Z),z)
# Tell gcc to never replace conditional load with a non-conditional one
ifdef CONFIG_CC_IS_GCC
@@@ -786,9 -867,11 +865,12 @@@ stackp-flags-$(CONFIG_STACKPROTECTOR_ST
KBUILD_CFLAGS += $(stackp-flags-y)
KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
+KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
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=gnu11' so use of GNU extensions is acceptable.
@@@ -804,11 -887,9 +886,12 @@@ endi
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
+# These result in bogus false positives
+KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
+
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
+ KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
else
# Some targets (ARM with Thumb2, for example), can't be built with frame
# pointers. For those, we don't have FUNCTION_TRACER automatically
@@@ -1095,7 -1180,7 +1183,8 @@@ export MODULES_NSDEPS := $(extmod_prefi
ifeq ($(KBUILD_EXTMOD),)
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/
core-$(CONFIG_BLOCK) += block/
+core-$(CONFIG_IO_URING) += io_uring/
+ core-$(CONFIG_RUST) += rust/
vmlinux-dirs := $(patsubst %/,%,$(filter %/, \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2022-07-12 7:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 7:39 Stephen Rothwell [this message]
2022-07-12 10:05 ` linux-next: manual merge of the rust tree with the block and kbuild trees 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=20220712173956.540d3baa@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=axboe@kernel.dk \
--cc=bobo1239@web.de \
--cc=boqun.feng@gmail.com \
--cc=d0u9.su@outlook.com \
--cc=davidgow@google.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=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).