Skip to content

u-boot fails to cross compile #9

@Patagonicus

Description

@Patagonicus

I'm trying to build the SD card image, but g6wawlwkifjmg1hjmnpwjfplf5rm45dz-uboot-aarch64-none-elf.drv fails to build because it's trying to run an aarch64 binary on the amd64 host:

…
  COPY    u-boot.dtb
/nix/store/v1im623fdbjpn1fz1if1x6radm5h4jhg-aarch64-none-elf-binutils-2.35.1/bin/aarch64-none-elf-ld.bfd: warning: -z relro ignored
/nix/store/v1im623fdbjpn1fz1if1x6radm5h4jhg-aarch64-none-elf-binutils-2.35.1/bin/aarch64-none-elf-ld.bfd: warning: -z relro ignored
/nix/store/v1im623fdbjpn1fz1if1x6radm5h4jhg-aarch64-none-elf-binutils-2.35.1/bin/aarch64-none-elf-ld.bfd: warning: -z relro ignored
  LDS     u-boot-elf.lds
  LD      u-boot.elf
/nix/store/v1im623fdbjpn1fz1if1x6radm5h4jhg-aarch64-none-elf-binutils-2.35.1/bin/aarch64-none-elf-ld.bfd: warning: -z relro ignored
  CFGCHK  u-boot.cfg
installing
40+0 records in
40+0 records out
40 bytes copied, 4.9299e-05 s, 811 kB/s
3887+0 records in
3887+0 records out
3887 bytes (3.9 kB, 3.8 KiB) copied, 0.00318808 s, 1.2 MB/s
4864+0 records in
4864+0 records out
4864 bytes (4.9 kB, 4.8 KiB) copied, 0.00394049 s, 1.2 MB/s
2288+0 records in
2288+0 records out
2288 bytes (2.3 kB, 2.2 KiB) copied, 0.0018939 s, 1.2 MB/s
/nix/store/8ssvpvkpqyihxy420fr9imi35b5pq75v-stdenv-linux/setup: line 1333: /nix/store/jy2izih57pp76ljdg05zf73sbzilzhzk-meson64-tools-aarch64-unknown-linux-gnu/bin/bl30sig: cannot execute binary file: Exec format error

See also the full nix-build output.

file says:

/nix/store/jy2izih57pp76ljdg05zf73sbzilzhzk-meson64-tools-aarch64-unknown-linux-gnu/bin/bl30sig: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /nix/store/0s43vz64zh1iibpxn0s4wb8j6snz6bjc-glibc-aarch64-unknown-linux-gnu-2.32-48/lib/ld-linux-aarch64.so.1, for GNU/Linux 2.6.32, not stripped

Some more information:

  • The repo is at 5ab0230, no local modifications.
  • I'm running nix-build --keep-going.
  • The host system is NixOS 21.05 at 8b0b81dab17753ab344a44c04be90a61dc55badf. I have flakes enabled and I'm unsure if this affects things (I assume this is why older commits fail trying to use builtins.fetchGit, but to my understanding it shouldn't interfere with master, especially not with the error above). I'll probably set up a vanilla NixOS in a VM to try building the system there.

nix-info -m:

  • system: "x86_64-linux"
  • host os: Linux 5.10.62, NixOS, 21.05.20210910.8b0b81d (Okapi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.4pre20210802_47e96bb
  • channels(root): "nixos-21.05.3021.8b0b81dab17"
  • channels(philipp): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Any ideas what is going wrong or how to get the image to properly build? I also have trouble building it natively, but I'll open a separate issue since it's a different failure (and it's currently still building and I'm waiting for the full log output).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions