NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.37k stars 14.32k forks source link

Build failure: pkgsLLVM.linux #321667

Open RossComputerGuy opened 5 months ago

RossComputerGuy commented 5 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build pkgsLLVM.linux

Build log

Note: error message is not present and could not be found even with scrolling for several hundred lines.

linux>   BTF [M] net/vmw_vsock/vmw_vsock_virtio_transport.ko
linux>   LD [M]  net/vmw_vsock/vsock_loopback.ko
linux>   BTF [M] net/vmw_vsock/vmw_vsock_virtio_transport_common.ko
linux>   BTF [M] net/vmw_vsock/hv_sock.ko
linux>   LD [M]  net/nsh/nsh.ko
linux>   LD [M]  net/hsr/hsr.ko
linux>   BTF [M] net/vmw_vsock/vsock_loopback.ko
linux>   LD [M]  net/qrtr/qrtr.ko
linux>   LD [M]  net/qrtr/qrtr-smd.ko
linux>   LD [M]  net/qrtr/qrtr-tun.ko
linux>   LD [M]  net/qrtr/qrtr-mhi.ko
linux>   BTF [M] net/nsh/nsh.ko
linux>   LD [M]  virt/lib/irqbypass.ko
linux>   BTF [M] net/hsr/hsr.ko
linux>   BTF [M] net/qrtr/qrtr.ko
linux>   BTF [M] net/qrtr/qrtr-smd.ko
linux>   BTF [M] net/qrtr/qrtr-tun.ko
linux>   BTF [M] net/qrtr/qrtr-mhi.ko
linux>   BTF [M] virt/lib/irqbypass.ko
linux> make: *** [../Makefile:234: __sub-make] Error 2

Additional context

Builds on aarch6-linux, x86_64-linux fails.

Notify maintainers

@TredwellGit @Ma27 @NeQuissimus @alyssais @thoughtpolice

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.31, NixOS, 24.05 (Uakari), 24.05pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"expidus, nixos-22.11"`
 - channels(ross): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

Titaniumtown commented 5 months ago

@RossComputerGuy An error must be present, please post full logs to a pastebin service.

RossComputerGuy commented 5 months ago

@Titaniumtown I looked through and no error besides that one make mentions. Garnix run confirms that too https://garnix.io/build/jgN5KqQ9 on the nixpkgs LLVM workspace project.

Titaniumtown commented 5 months ago

@RossComputerGuy Found your error here with the logs you provided:

  CC [M]  drivers/acpi/acpi_extlog.mod.o
  LD      arch/x86/boot/setup.elf
x86_64-unknown-linux-gnu-ld: error: ../arch/x86/boot/setup.ld:15: unable to move location counter backward for: .bstext
x86_64-unknown-linux-gnu-ld: error: ../arch/x86/boot/setup.ld:15: unable to move location counter backward for: .bstext
x86_64-unknown-linux-gnu-ld: error: ../arch/x86/boot/setup.ld:15: unable to move location counter backward for: .bstext
make[2]: *** [../arch/x86/boot/Makefile:107: arch/x86/boot/setup.elf] Error 1
make[1]: *** [../arch/x86/Makefile:283: bzImage] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC [M]  drivers/acpi/acpi_configfs.mod.o
  CC [M]  drivers/clk/xilinx/xlnx_vcu.mod.o
  CC [M]  drivers/clk/clk-cdce706.mod.o
  CC [M]  drivers/clk/clk-cs2000-cp.mod.o
  CC [M]  drivers/clk/clk-lmk04832.mod.o
  CC [M]  drivers/clk/clk-max9485.mod.o
RossComputerGuy commented 5 months ago

How far into the build was that? I had a hard time finding it when I was building locally.

Titaniumtown commented 5 months ago

Near the end; I would recommend checking logs and grepping for error for future reference.

RossComputerGuy commented 4 months ago

Found this thread which seems to be related: https://www.linuxquestions.org/questions/slackware-14/error-building-kernel-6-1-44-on-current-with-clang-4175727865/

Looks like we'll have to get this patch in: https://lore.kernel.org/lkml/20230809-gds-v1-1-eaac90b0cbcc@google.com/

blitz commented 1 month ago

One possible option to fix this is also to add some -static to relevant places in the Linux kernel. The way the ld wrapper the dynamic linking magic is turned off when there is an explicit -static on the command line.

E.g. here: https://github.com/torvalds/linux/blob/master/arch/x86/boot/Makefile#L91

Other architectures in the Linux kernel actually do that. :thinking:

RossComputerGuy commented 1 month ago

There's already a kernel patch which does implement some flags. However, it doesn't look like it's going to be accepted so I wonder if a patch which adds static would get accepted. The current idea right now is to get ld wrapper to remove the dynamic linker flag when not needed and/or get LLVM lld to have similar behavior to GNU ld.