Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mainline 6.8 build issues due to changes in multiple requirement. #47

Open
samveen opened this issue Mar 19, 2024 · 4 comments
Open

Mainline 6.8 build issues due to changes in multiple requirement. #47

samveen opened this issue Mar 19, 2024 · 4 comments

Comments

@samveen
Copy link

samveen commented Mar 19, 2024

The 6.8 kernel series adds the following kconfig logic for pahole versioning:

root@x220:/build/linux-6.8# grep -A1 'config PAHOLE_HAS_LANG_EXCLUDE' lib/Kconfig.debug
config PAHOLE_HAS_LANG_EXCLUDE
	def_bool PAHOLE_VERSION >= 124

20.04 (focal) is at pahole version 1.21 from the dwarves(https://packages.ubuntu.com/focal-updates/dwarves) (thank you for that too, or we'd be stuck with 5.15 🤦 ), and this triggers the impossible config situation disabling rust as mentioned by you at https://bugs.launchpad.net/ubuntu/+source/rustc-1.62/+bug/1993183/comments/16 :

root@x220:/build/linux-6.8# grep "config RUST$" init/Kconfig -A7
config RUST
	bool "Rust support"
	depends on HAVE_RUST
	depends on RUST_IS_AVAILABLE
	depends on !GCC_PLUGINS
	depends on !RANDSTRUCT
	depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
	select CONSTRUCTORS

This triggers invalidating the debian control changes implemented at

sed -i -re 's/dwarves \[/dwarves (>=1.21) \[/g' debian.master/control.stub.in

I have not had the chance to see when this change was introduced into the kernel, unfortunately.

Would you have the bandwidth to see if back-porting dwarves or pahole from mantic Jammy (version 1.25) to focal is possible?

EDIT:
The list of versions of packages for Linux-6.8 keeps getting larger:

  • pahole >=1.24 (jammy packaged source builds successfully on focal with only debian/changelog mod).
  • ld (i.e. binutils(binutils-x86-64-linux-gnu)) >= 2.40 (for zstd compressed debug sections).
@samveen samveen changed the title Mainline 6.8 build issues due to dwarves (`pahole minimum version) Mainline 6.8 build issues due to dwarves (pahole minimum version) Mar 19, 2024
@samveen samveen changed the title Mainline 6.8 build issues due to dwarves (pahole minimum version) Mainline 6.8 build issues due to requirement of minimum version 1.24 of pahole Mar 19, 2024
@samveen samveen changed the title Mainline 6.8 build issues due to requirement of minimum version 1.24 of pahole Mainline 6.8 build issues due to requirement of version 1.24 of pahole for rust support Mar 19, 2024
@samveen
Copy link
Author

samveen commented Mar 20, 2024

I am unsure of how to proceed now, given that the build fails due to regressions and failures in the testing:

Test results, compared with installed binutils:
W: [ld-elf/elf.exp] REGRESSION (UNSUPPORTED -> UNTESTED): Run mbind2b
W: [ld-elf/elf.exp] REGRESSION (UNSUPPORTED -> UNTESTED): static preinit array
W: [ld-elf/elf.exp] REGRESSION (UNSUPPORTED -> UNTESTED): static init array
W: [ld-elf/elf.exp] REGRESSION (UNSUPPORTED -> UNTESTED): static fini array
W: [ld-elf/elf.exp] REGRESSION (UNSUPPORTED -> UNTESTED): static init array mixed
W: [ld-elf/shared.exp] REGRESSION (PASS -> UNTESTED): Build pr22393-2 (static)
W: [ld-elf/shared.exp] REGRESSION (UNSUPPORTED -> UNTESTED): Run pr22393-2 (static)
I: [ld-elf/tls.exp] progression (FAIL -> PASS): Build pr22263-1
W: [ld-ifunc/ifunc.exp] REGRESSION (UNSUPPORTED -> UNTESTED): Common symbol override ifunc test 1a
W: [ld-ifunc/ifunc.exp] REGRESSION (UNSUPPORTED -> UNTESTED): Common symbol override ifunc test 1b
I: [ld-ifunc/ifunc.exp] progression (FAIL -> PASS): Build pr23169c
I: [ld-ifunc/ifunc.exp] progression (FAIL -> PASS): Build pr23169f
W: [ld-plugin/lto.exp] REGRESSION (PASS -> UNTESTED): LTO 2
W: [ld-srec/srec.exp] REGRESSION (PASS -> FAIL): S-records
1 REGRESSIONS (0.04%).
3 progressions (0.13%).
10 changes (0.45%).
2227 tests: 1805 pass (81.05%), 5 fail (0.22%), 5 xfail (0.22%) 12 untested (0.54%).
make: *** [debian/rules:839: stamps/build.s390x] Error 1
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

@samveen
Copy link
Author

samveen commented Mar 20, 2024

I managed to get binutils 2.40 from lunar compiled on focal. However as binutils is an essential part of the compile system, I will need to rebuild the complete toolchain against the new binutils, which is a kind of chicken and egg problem I will need to solve.

As I see it, this is no longer worth my effort to build the 6.8 series for focal.

The root cause of the issue turned out to be between the chair and the keyboard. In sleep-deprived mode, I forgot to add the base binutils package to the apt install. Linux 6.8 build in progress.

However, I am still trying to figure out how to enable zstd debug compression support during the binutils 2.40 build.

I got binutils-2.40 to build on focal with the folllowing patch to debian/rules:

$ diff -U3 debian.orig/rules rules 
--- old/debian.orig/rules	2023-04-14 02:08:40.000000000 +0530
+++ new/debian.orig/rules	2024-03-22 07:20:18.116781700 +0530
@@ -416,7 +416,8 @@
 	--prefix=/$(PF) \
 	--sysconfdir=/etc \
 	--enable-deterministic-archives \
-	--disable-compressed-debug-sections \
+	--enable-compressed-debug-sections=all \
+	--with-zstd \
 	--enable-new-dtags \
 	--disable-x86-used-note \
 	--with-gold-ldflags=-static-libstdc++ \

Kernel build now in progress without any annotations with 1 modification to gcc-plugins Kconfig and the associated annotations in ebian.master/config/annotations:

root@samveen-x220:~/build# diff -r -U2 linux-6.8-patch-focal linux-6.8-patch-clean/
diff -r -U2 linux-6.8-patch-focal/debian.master/config/annotations linux-6.8-patch-clean/debian.master/config/annotations
--- linux-6.8/debian.master/config/annotations	2024-03-19 14:03:01.948396100 +0000
+++ linux-6.8-patch-clean/debian.master/config/annotations	2024-03-19 04:36:36.222677400 +0000
@@ -5648,5 +5648,5 @@
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER               policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>
 CONFIG_HAVE_FUNCTION_TRACER                     policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': '-', 's390x': 'y'}>
-CONFIG_HAVE_GCC_PLUGINS                         policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 'riscv64': 'n', 's390x': 'n'}>
+CONFIG_HAVE_GCC_PLUGINS                         policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>
 CONFIG_HAVE_GENERIC_VDSO                        policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>
 CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH            policy<{'ppc64el': 'y'}>
diff -r -U2 linux-6.8-patch-focal/scripts/gcc-plugins/Kconfig linux-6.8-patch-clean/scripts/gcc-plugins/Kconfig
--- linux-6.8-patch-focal/scripts/gcc-plugins/Kconfig	2024-03-19 14:30:55.542667600 +0000
+++ linux-6.8-patch-clean/scripts/gcc-plugins/Kconfig	2024-03-10 20:38:09.000000000 +0000
@@ -8,8 +8,8 @@
 menuconfig GCC_PLUGINS
 	bool "GCC plugins"
-	#depends on HAVE_GCC_PLUGINS
-	#depends on CC_IS_GCC
-	#depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h)
-	default n
+	depends on HAVE_GCC_PLUGINS
+	depends on CC_IS_GCC
+	depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h)
+	default y
 	help
 	  GCC plugins are loadable modules that provide extra features to the

@samveen samveen changed the title Mainline 6.8 build issues due to requirement of version 1.24 of pahole for rust support Mainline 6.8 build issues due to changes in multiple requirement. Mar 21, 2024
@samveen
Copy link
Author

samveen commented Mar 25, 2024

There seems to be an issue with my build of binutils, where the search path used by ld does not correctly include the gcc/g++ library directory /usr/lib/gcc/x86_64-linux-gnu/13/ (for g++-13), leading to failures where -lstdc++ is used. I've worked around it by adding the equivalent link into /usr/lib/x86_64-linux-gnu directly, and restarted the sbuild

@samveen
Copy link
Author

samveen commented Mar 26, 2024

Kernel 6.8 builds successfully on focal with the following workarounds:

  • Backports of the following (beyond the GCC-13, clang-17, Rust backports):
    • `debugedit-5.0 for pahole/binutils
    • pahole-1.25 (dwarves-1.25)
    • binutils_2.40 with zstd debug section support enabled.
  • manual installation of bindgen-0.65.1 with cargo install bindgen-cli
  • Debian control changes as below:
diff -r -U2 linux-6.8-patch-clean/debian/changelog linux-6.8-patch-focal/debian/changelog
--- linux-6.8-patch-clean/debian/changelog	2024-03-22 12:31:52.046703500 +0000
+++ linux-6.8-patch-focal/debian/changelog	2024-03-19 03:41:38.341932800 +0000
@@ -1,3 +1,3 @@
-linux (6.8.0-19.19) noble; urgency=medium
+linux (6.8.0-19.19) focal; urgency=medium
 
   * noble/linux: 6.8.0-19.19 -proposed tracker (LP: #2057910)
diff -r -U2 linux-6.8-patch-clean/debian/control linux-6.8-patch-focal/debian/control
--- linux-6.8-patch-clean/debian/control	2024-03-22 12:31:52.058792900 +0000
+++ linux-6.8-patch-focal/debian/control	2024-03-19 03:41:38.352235500 +0000
@@ -47,5 +47,4 @@
  rust-src [amd64 arm64 armhf ppc64el riscv64 s390x],
  rustfmt [amd64 arm64 armhf ppc64el riscv64 s390x],
- bindgen-0.65 [amd64 arm64 armhf ppc64el riscv64 s390x],
  libstdc++-dev,
 Build-Depends-Indep:
diff -r -U2 linux-6.8-patch-clean/debian.master/changelog linux-6.8-patch-focal/debian.master/changelog
--- linux-6.8-patch-clean/debian.master/changelog	2024-03-22 12:31:51.790840100 +0000
+++ linux-6.8-patch-focal/debian.master/changelog	2024-03-19 03:41:38.099551800 +0000
@@ -1,3 +1,3 @@
-linux (6.8.0-19.19) noble; urgency=medium
+linux (6.8.0-19.19) focal; urgency=medium
 
   * noble/linux: 6.8.0-19.19 -proposed tracker (LP: #2057910)
diff -r -U2 linux-6.8-patch-clean/debian.master/config/annotations linux-6.8-patch-focal/debian.master/config/annotations
--- linux-6.8-patch-clean/debian.master/config/annotations	2024-03-22 12:31:51.929930900 +0000
+++ linux-6.8-patch-focal/debian.master/config/annotations	2024-03-19 14:03:01.948396100 +0000
@@ -5648,5 +5648,5 @@
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER               policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>
 CONFIG_HAVE_FUNCTION_TRACER                     policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': '-', 's390x': 'y'}>
-CONFIG_HAVE_GCC_PLUGINS                         policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>
+CONFIG_HAVE_GCC_PLUGINS                         policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 'riscv64': 'n', 's390x': 'n'}>
 CONFIG_HAVE_GENERIC_VDSO                        policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>
 CONFIG_HAVE_HARDLOCKUP_DETECTOR_ARCH            policy<{'ppc64el': 'y'}>
diff -r -U2 linux-6.8-patch-clean/debian.master/variants linux-6.8-patch-focal/debian.master/variants
--- linux-6.8-patch-clean/debian.master/variants	2024-03-22 12:31:51.967488500 +0000
+++ linux-6.8-patch-focal/debian.master/variants	2024-03-19 03:41:38.251891000 +0000
@@ -1,4 +1,4 @@
 --
--hwe-22.04
--hwe-22.04-edge
--oem-24.04
+-hwe-20.04
+-hwe-20.04-edge
+-oem-20.04

I'm running the 6.8 kernel built as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant