Bug 11681

Summary: .../buildroot/output/host/bin/x86_64-buildroot-linux-gnu-ld: arch/x86/kernel/head_64.o: unable to initialize decompress status for section .debug_line
Product: buildroot Reporter: Janusz Krzysztofik <janusz.krzysztofik>
Component: OtherAssignee: unassigned
Status: RESOLVED WORKSFORME    
Severity: normal CC: buildroot
Priority: P5    
Version: 2018.11.2   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Janusz Krzysztofik 2019-02-20 09:45:26 UTC
Hi,

Buildroot 2018.11.2 hosted on Fedora 29 here. The failure started appearing during kernel build surprisingly after elfutils RPMs had been upgraded from 0.174 to 0.176.

Two workarounds worked for me:
- downgrading elfutils RPMs back to 0.174,
- symlinking .../buildroot/output/host/bin/x86_64-buildroot-linux-gnu-ld to a fixed one provided by Fedora 29 RPM bintuils-2.31.1-18.fc19 (see Changelog on https://koji.fedoraproject.org/koji/buildinfo?buildID=1211905).

For more details, please see:
https://bugzilla.redhat.com/show_bug.cgi?id=1678204#c11
https://sourceware.org/bugzilla/show_bug.cgi?id=23919

My conclusion is, something under output/ (probably output/build/linux-xxx/tools/objtool/objtool) used for building the kernel is using host provided libelf.

$ ldd ./output/build/linux-custom/tools/objtool/objtool
        linux-vdso.so.1 (0x00007ffc5bed4000)
        libelf.so.1 => /lib64/libelf.so.1 (0x00007f1c23c78000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f1c23ab2000)
        libz.so.1 => /home/jkrzyszt/git/buildroot/output/host/lib/libz.so.1 (0x00007f1c23a98000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1c23cb7000)

I can see 2 possible ways of fixing the issue:
a) making objtool (or other executable which exposes the issue if that's not objtool) use libelf provided by buildroot (the preferred way, I believe),
or
b) applying the fix from https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=88739f776b733b0b84600b283417f862a010bb5d on binutils so it doesn't suffer from the issue whatever libelf version is installed on a host.

BTW, the bug also exists in 2019.02-rc1.

Thanks,
Janusz
Comment 1 Arnout Vandecappelle 2019-02-20 21:17:54 UTC
You need to set BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y.

Perhaps we should add a check in linux.mk that detects that the kernel build will use libelf, and error out before building if BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF is not set.

For now, however, I'm marking this as WORKSFORME.
Comment 2 Janusz Krzysztofik 2019-02-21 08:05:37 UTC
Thanks for the solution, now I see my request should really go to a user support list not to bugzilla, sorry for spamming your bug tracking system.

Thanks,
Janusz