Skip to contentSkip to conversation

linux-next: manual merge of the rust tree with the kbuild tree

PATCH [email protected] 3 participants 3 messages Aug 2, 2022 – Aug 14, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Hi all,

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

Makefile

between commit:

a6036a41bffba ("kbuild: drop support for CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3")

from the kbuild tree and commit:

fe24902ba8765 ("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.

Makefile +0 -0
diff --cc Makefile
index 60a7e3e8b4787,cd1d545f316bc..0000000000000
@@@ -758,10 -819,20 +822,17 @@@ KBUILD_CFLAGS	+= $(call cc-disable-warn
  
  ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
  KBUILD_CFLAGS += -O2
+ KBUILD_RUSTFLAGS += -Copt-level=2
 -else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
 -KBUILD_CFLAGS += -O3
 -KBUILD_RUSTFLAGS += -Copt-level=3
  else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
  KBUILD_CFLAGS += -Os
+ KBUILD_RUSTFLAGS += -Copt-level=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)
+ 
  # Tell gcc to never replace conditional load with a non-conditional one
  ifdef CONFIG_CC_IS_GCC
  # gcc-10 renamed --param=allow-store-data-races=0 to
@@@ -1098,7 -1178,7 +1178,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) \
#1 lore raw
Quoted 7 lines · On Wed, Aug 3, 2022 at 1:38 AM <[email protected]> wrote:

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.

Looks good to me! Thanks!

Cheers,
Miguel

#2 lore raw
In reply to [email protected]

Hi all,

Quoted 48 lines · On Wed, 3 Aug 2022 00:38:44 +0100 [email protected] wrote:

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

Makefile

between commit:

a6036a41bffba ("kbuild: drop support for CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3")

from the kbuild tree and commit:

fe24902ba8765 ("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.

Makefile +7 -0
diff --cc Makefile
index 60a7e3e8b4787,cd1d545f316bc..0000000000000
@@@ -758,10 -819,20 +822,17 @@@ KBUILD_CFLAGS	+= $(call cc-disable-warn
 
  ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
  KBUILD_CFLAGS += -O2
+ KBUILD_RUSTFLAGS += -Copt-level=2
 -else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
 -KBUILD_CFLAGS += -O3
 -KBUILD_RUSTFLAGS += -Copt-level=3
  else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
  KBUILD_CFLAGS += -Os
+ KBUILD_RUSTFLAGS += -Copt-level=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)
+ 
  # Tell gcc to never replace conditional load with a non-conditional one
  ifdef CONFIG_CC_IS_GCC
  # gcc-10 renamed --param=allow-store-data-races=0 to

Makefile

Quoted 8 lines
Makefile +1 -0
@@@ -1098,7 -1178,7 +1178,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) \

This is now a conflict between the rust tree and Linus' tree.

Signature · 2 lines
Cheers,
Stephen Rothwell