Skip to content

ld.lld: error: .btf.vmlinux.bin.o: unknown file type #1995

New issue

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

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

Already on GitHub? # to your account

Closed
nathanchance opened this issue Feb 14, 2024 · 2 comments
Closed

ld.lld: error: .btf.vmlinux.bin.o: unknown file type #1995

nathanchance opened this issue Feb 14, 2024 · 2 comments
Assignees
Labels
[BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 6.8 This bug was fixed in Linux 6.8 [TOOL] lld The issue is relevant to LLD linker

Comments

@nathanchance
Copy link
Member

When attempting to build ARCH=s390 defconfig plus CONFIG_DEBUG_INFO_BTF=y with ld.lld (available after llvm/llvm-project@fe3406e) after applying the patches for #1991, #1992, #1993, and #1994, there is an error when linking the BTF object into vmlinux:

# Enable CONFIG_DEBUG_INFO_BTF in menuconfig
$ make -skj"$(nproc)" ARCH=s390 LLVM=1 OBJCOPY=s390x-linux-gnu-objcopy OBJDUMP=s390x-linux-gnu-objdump mrproper defconfig menuconfig all
...
ld.lld: error: .btf.vmlinux.bin.o: unknown file type

This is not actually s390 specific, it is just that we have not tested a big endian arch with CONFIG_DEBUG_INFO_BTF=y and LD=ld.lld until now.

Patch submitted: https://lore.kernel.org/20240212-fix-elf-type-btf-vmlinux-bin-o-big-endian-v2-1-22c0a6352069@kernel.org/

Masahiro has accepted it but I don't see in linux-kbuild/fixes yet, so I'll leave this as "Submitted" for now.

https://lore.kernel.org/CAK7LNATZAh9fa8rd6jLwdEGUBHkAs9e4hZh=WvKeNLkGs2=8Aw@mail.gmail.com/
https://git.kernel.org/masahiroy/linux-kbuild/l/fixes

@nathanchance nathanchance added [BUG] linux A bug that should be fixed in the mainline kernel. [TOOL] lld The issue is relevant to LLD linker [PATCH] Submitted A patch has been submitted for review labels Feb 14, 2024
@nathanchance nathanchance self-assigned this Feb 14, 2024
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [PATCH] Accepted A submitted patch has been accepted upstream and removed [PATCH] Submitted A patch has been submitted for review labels Feb 15, 2024
@nathanchance
Copy link
Member Author

Merged into mainline: https://git.kernel.org/linus/e3a9ee963ad8ba677ca925149812c5932b49af69

This will go back to stable automatically.

@nathanchance nathanchance added [FIXED][LINUX] 6.8 This bug was fixed in Linux 6.8 and removed [PATCH] Accepted A submitted patch has been accepted upstream labels Feb 18, 2024
nathanchance added a commit to nathanchance/continuous-integration2 that referenced this issue Feb 21, 2024
…ee LLVM

With LLVM main, which has the necessary changes to ld.lld and
llvm-objcopy to support s390, and linux-next, which has the necessary
changes to the kernel to support these tools, ARCH=s390 builds cleanly
with LLVM=1. Cut builds that satisfy these conditions over to LLVM=1 so
that regressions with this working setup do not occur.

Link: llvm/llvm-project@fe3406e
Link: llvm/llvm-project@3c02cb7
Link: ClangBuiltLinux/linux#859
Link: ClangBuiltLinux/linux#1991
Link: ClangBuiltLinux/linux#1992
Link: ClangBuiltLinux/linux#1993
Link: ClangBuiltLinux/linux#1994
Link: ClangBuiltLinux/linux#1995
Link: ClangBuiltLinux/linux#1996
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
[BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 6.8 This bug was fixed in Linux 6.8 [TOOL] lld The issue is relevant to LLD linker
Projects
None yet
Development

No branches or pull requests

1 participant