Skip to contentSkip to conversation

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

PATCH Stephen Rothwell 2 participants 4 messages Oct 15, 2021 – Oct 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

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

Makefile

between commit:

09708df61f2b ("kbuild: split DEBUG_CFLAGS out to scripts/Makefile.debug")

from the kbuild tree and commit:

dc08d49444e9 ("Kbuild: add Rust support")

from the rust tree.

I fixed it up (I used the Makefile conflicting part from the former and applied the patch 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.

Miguel, it might be worth do a back merge of v5.14 (or maybe even v5.15-rc1) to fix up the old conflicts ... If you do that, though, please don't use github's GUI to do it, do it in your own git tree, include a good commit message in the merge commit (saying why you did the merge), and push it up to git hub.

From: Stephen Rothwell <[email protected]>
Date: Fri, 15 Oct 2021 18:16:09 +1100
Subject: [PATCH] Kbuild: fix for "kbuild: split DEBUG_CFLAGS out to scripts/Makefile.debug"

---
 scripts/Makefile.debug | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/Makefile.debug +9 -0
index 9f39b0130551..ad9308a08240 100644
@@ -1,4 +1,5 @@
 DEBUG_CFLAGS	:=
+DEBUG_RUSTFLAGS :=
 
 ifdef CONFIG_DEBUG_INFO_SPLIT
 DEBUG_CFLAGS	+= -gsplit-dwarf
@@ -8,6 +9,11 @@ endif
 
 ifndef CONFIG_AS_IS_LLVM
 KBUILD_AFLAGS	+= -Wa,-gdwarf-2
+ifdef CONFIG_DEBUG_INFO_REDUCED
+DEBUG_RUSTFLAGS += -Cdebuginfo=1
+else
+DEBUG_RUSTFLAGS += -Cdebuginfo=2
+endif
 endif
 
 ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
@@ -31,3 +37,6 @@ endif
 
 KBUILD_CFLAGS += $(DEBUG_CFLAGS)
 export DEBUG_CFLAGS
+
+KBUILD_RUSTFLAGS += $(DEBUG_RUSTFLAGS)
+export DEBUG_RUSTFLAGS
Signature · 5 lines
2.33.0

-- 
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 6 lines · Stephen Rothwell

Miguel, it might be worth do a back merge of v5.14 (or maybe even v5.15-rc1) to fix up the old conflicts ... If you do that, though, please don't use github's GUI to do it, do it in your own git tree, include a good commit message in the merge commit (saying why you did the merge), and push it up to git hub.

Yeah, the last release has been rough on conflicts. I will move the new code to rust-next for your Monday run (based onto -rc5) -- there has been some changes since last time and I already have it in sync in our internal branch. Thanks for keeping up with all the conflicts!

As for GitHub, thanks for the warning! We only use the GUI for internal development only; for the -next branch I prepare it manually. I will also rearrange things to follow a normal kernel process when we hit mainline.

Cheers,
Miguel

#2 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 15 lines · On Fri, 15 Oct 2021 18:24:04 +1100 Stephen Rothwell <[email protected]>…

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

Makefile

between commit:

09708df61f2b ("kbuild: split DEBUG_CFLAGS out to scripts/Makefile.debug")

from the kbuild tree and commit:

dc08d49444e9 ("Kbuild: add Rust support")

from the rust tree.

Quoted 7 lines

I fixed it up (I used the Makefile conflicting part from the former and applied the patch 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.

The fixup patch now looks like this:

From: Stephen Rothwell <[email protected]>
Date: Fri, 15 Oct 2021 18:16:09 +1100
Subject: [PATCH] Kbuild: fix for "kbuild: split DEBUG_CFLAGS out to
scripts/Makefile.debug"

---
 scripts/Makefile.debug | 10 ++++++++++
 1 file changed, 10 insertions(+)
scripts/Makefile.debug +10 -0
index 9f39b0130551..c664af3ccc6b 100644
@@ -1,4 +1,5 @@
 DEBUG_CFLAGS	:=
+DEBUG_RUSTFLAGS :=
 
 ifdef CONFIG_DEBUG_INFO_SPLIT
 DEBUG_CFLAGS	+= -gsplit-dwarf
@@ -10,6 +11,12 @@ ifndef CONFIG_AS_IS_LLVM
 KBUILD_AFLAGS	+= -Wa,-gdwarf-2
 endif
 
+ifdef CONFIG_DEBUG_INFO_REDUCED
+DEBUG_RUSTFLAGS += -Cdebuginfo=1
+else
+DEBUG_RUSTFLAGS += -Cdebuginfo=2
+endif
+
 ifndef CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF4) := 4
 dwarf-version-$(CONFIG_DEBUG_INFO_DWARF5) := 5
@@ -31,3 +38,6 @@ endif
 
 KBUILD_CFLAGS += $(DEBUG_CFLAGS)
 export DEBUG_CFLAGS
+
+KBUILD_RUSTFLAGS += $(DEBUG_RUSTFLAGS)
+export DEBUG_RUSTFLAGS
Signature · 5 lines
2.33.0

-- 
Cheers,
Stephen Rothwell
#3 lore raw

Hi Stephen,

Quoted 2 lines · Stephen Rothwell

The fixup patch now looks like this:

Looks correct, thanks!

(This was triggered due to my rebase tonight which contained a fix for an endif in the vicinity)

Cheers,
Miguel