pololu / nixcrpkgs

Tools for cross-compiling standalone applications using Nix.
Other
202 stars 17 forks source link

Failure building rpi.hello on macOS #5

Open joprice opened 4 years ago

joprice commented 4 years ago

I'm trying to build for arm7, but started from the existing arm6 to validate that I can build it at all using:

nix-build -A rpi.hello

This fails with many linker errors starting with

ld: warning: ignoring file ../libiberty/libiberty.a, file was built for archive which is not the architecture being linked (x86_64): ../libiberty/libiberty.a
ld: warning: ignoring file ./../intl/libintl.a, file was built for archive which is not the architecture being linked (x86_64): ./../intl/libintl.a
Undefined symbols for architecture x86_64:
  "__hex_value", referenced from:
      _integer_constant in expr.o
      _hex_float in read.o
  "__obstack_begin", referenced from:
      _hash_new_sized in hash.o
      _read_begin in read.o
      _subseg_set_rest in subsegs.o
      _subsegs_begin in subsegs.o
DavidEGrayson commented 4 years ago

Those linker messages look like they are from the macOS linker. What kind of system are you running the nix-build -A rpi.hello command on?

joprice commented 4 years ago

It is osx. Is that unsupported? I had issues with the built in cross compilation as documented here https://nixos.wiki/wiki/Cross_Compiling, so I was trying this out.

DavidEGrayson commented 4 years ago

Yeah, I have not tried to use nixcrpkgs on macOS, so there are probably some errors. That's why I mention twice in the README file that you need Linux. Since your error message mentions libiberty.a, I would guess you are having trouble building the GCC cross-compiler for the Raspberry Pi. If you want to dig into it and fix those errors, that would probably be useful. Or you could install a Linux virtual machine. We can leave this issue open as a reminder/confirmation that things do not work on macOS.