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

Error in Build Instructions for WSL2-Linux-Kernel #7667

Open
1 of 2 tasks
Terminator-J opened this issue Nov 11, 2021 · 4 comments
Open
1 of 2 tasks

Error in Build Instructions for WSL2-Linux-Kernel #7667

Terminator-J opened this issue Nov 11, 2021 · 4 comments
Labels
documentation request for documentation improvement

Comments

@Terminator-J
Copy link

Version

Microsoft Windows Version 21H1 (OS Build 19043.1348)

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.74.3-microsoft-standard-WSL2+

Distro Version

Ubuntu Server 21.04 (hirsute)

Other Software

The issue isn't with WSL, the issue is with compiling the WSL2 kernel source (but of course we can't open issues/PRs against that repository, and are directed here instead).

Attempting to follow the Build Instructions as written results in an error due to the missing pahole binary, since the build-essentials metapackage no longer includes the dwarves package in recent versions of Ubuntu. Manually adding the dwarves package works successfully.

Please consider merging the following commit to correct your issue: Terminator-J/WSL2-Linux-Kernel@70376ec

Repro Steps

$ git clone https://github.com/microsoft/WSL2-Linux-Kernel -b linux-msft-wsl-5.10.74.3
$ cd WSL2-Linux-Kernel
$ sudo apt install build-essential flex bison libssl-dev libelf-dev
$ make KCONFIG_CONFIG=Microsoft/config-wsl

Expected Behavior

terminator-j@host:~/WSL2-Linux-Kernel$ make KCONFIG_CONFIG=Microsoft/config-wsl
  SYNC    include/config/auto.conf.cmd
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  DESCEND  bpf/resolve_btfids
  CHK     include/generated/compile.h
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.btf
  BTF     .btf.vmlinux.bin.o
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  BTFIDS  vmlinux
  SORTTAB vmlinux
  SYSMAP  System.map
  CC      arch/x86/boot/a20.o
  AS      arch/x86/boot/bioscall.o
  CC      arch/x86/boot/cmdline.o
  AS      arch/x86/boot/copy.o
  HOSTCC  arch/x86/boot/mkcpustr
  CPUSTR  arch/x86/boot/cpustr.h
  CC      arch/x86/boot/cpu.o
  CC      arch/x86/boot/cpuflags.o
  CC      arch/x86/boot/cpucheck.o
  CC      arch/x86/boot/early_serial_console.o
  CC      arch/x86/boot/edd.o
  LDS     arch/x86/boot/compressed/vmlinux.lds
  AS      arch/x86/boot/compressed/kernel_info.o
  AS      arch/x86/boot/compressed/head_64.o
  VOFFSET arch/x86/boot/compressed/../voffset.h
  CC      arch/x86/boot/compressed/misc.o
  CC      arch/x86/boot/compressed/string.o
  CC      arch/x86/boot/compressed/cmdline.o
  CC      arch/x86/boot/compressed/error.o
  OBJCOPY arch/x86/boot/compressed/vmlinux.bin
  RELOCS  arch/x86/boot/compressed/vmlinux.relocs
  GZIP    arch/x86/boot/compressed/vmlinux.bin.gz
  HOSTCC  arch/x86/boot/compressed/mkpiggy
  MKPIGGY arch/x86/boot/compressed/piggy.S
  AS      arch/x86/boot/compressed/piggy.o
  CC      arch/x86/boot/compressed/cpuflags.o
  CC      arch/x86/boot/compressed/early_serial_console.o
  CC      arch/x86/boot/compressed/kaslr.o
  CC      arch/x86/boot/compressed/ident_map_64.o
  CC      arch/x86/boot/compressed/idt_64.o
  AS      arch/x86/boot/compressed/idt_handlers_64.o
  AS      arch/x86/boot/compressed/mem_encrypt.o
  CC      arch/x86/boot/compressed/pgtable_64.o
  CC      arch/x86/boot/compressed/acpi.o
  AS      arch/x86/boot/compressed/efi_thunk_64.o
  LD      arch/x86/boot/compressed/vmlinux
  ZOFFSET arch/x86/boot/zoffset.h
  AS      arch/x86/boot/header.o
  CC      arch/x86/boot/main.o
  CC      arch/x86/boot/memory.o
  CC      arch/x86/boot/pm.o
  AS      arch/x86/boot/pmjump.o
  CC      arch/x86/boot/printf.o
  CC      arch/x86/boot/regs.o
  CC      arch/x86/boot/string.o
  CC      arch/x86/boot/tty.o
  CC      arch/x86/boot/video.o
  CC      arch/x86/boot/video-mode.o
  CC      arch/x86/boot/version.o
  CC      arch/x86/boot/video-vga.o
  CC      arch/x86/boot/video-vesa.o
  CC      arch/x86/boot/video-bios.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  OBJCOPY arch/x86/boot/vmlinux.bin
  HOSTCC  arch/x86/boot/tools/build
  BUILD   arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready  (#4)
  LDS     scripts/module.lds
  MODPOST modules-only.symvers
  GEN     Module.symvers
terminator-j@host:~/WSL2-Linux-Kernel$

Actual Behavior

terminator-j@host:~/WSL2-Linux-Kernel$ make KCONFIG_CONFIG=Microsoft/config-wsl
  SYNC    include/config/auto.conf.cmd
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  DESCEND  bpf/resolve_btfids
  CHK     include/generated/compile.h
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1179: vmlinux] Error 1
terminator-j@host:~/WSL2-Linux-Kernel$

Diagnostic Logs

Please see Terminator-J/WSL2-Linux-Kernel@70376ec for resolution, since we are unable to submit PRs directly to the correct repo.

@ghost ghost added the documentation request for documentation improvement label Nov 16, 2021
@quintenvandamme
Copy link

sudo apt install dwarves

@cheneytianx
Copy link

After rebuilding the kernel successfully, /sys/kernel/btf/directory does not exist yet.

@mwoodpatrick
Copy link

mwoodpatrick commented Dec 25, 2023

I hit the same issue building the 6.1 kernel, same fix appears to work

@razamatan
Copy link

if you're building this in gentoo, s/dwarves/pahole/

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

No branches or pull requests

5 participants