Skip to content

Error compiling CRC for Nerves with non host target #49

Description

@taun

It seems the CRC makefile may not be using the correct compiler when CROSSCOMPILE is set by Nerves.

Comments added to crc_src/makefile

$(info "**** CRC PLATFORM set to [$(PLATFORM)] ****")
$(info "**** CRC CROSSCOMPILE set to [$(CROSSCOMPILE)] ****")

Error when compiling crc ...

>MIX_TARGET=bbb mix deps.compile crc
==> nerves
==> atmos

Nerves environment
  MIX_TARGET:   bbb
  MIX_ENV:      dev

==> crc
"**** CRC PLATFORM set to [darwin] ****"
"**** CRC CROSSCOMPILE set to [/Users/taun/.nerves/artifacts/nerves_toolchain_armv7_nerves_linux_gnueabihf-darwin_arm-1.8.0/bin/armv7-nerves-linux-gnueabihf] ****"
 C      checksum_xor.c
armv7-nerves-linux-gnueabihf-gcc: error: unrecognized command-line option '-arch'; did you mean '-march='?
make: *** [/Users/taun/Development/Elixir/atmos/_build/bbb_dev/lib/crc/obj/checksum_xor.o] Error 1
could not compile dependency :crc, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile crc --force", update it with "mix deps.update crc" or clean it with "mix deps.clean crc"
==> atmos
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.

It seems the above is indicating, the platform is darwin which is correct but the crc source should be compiled using the cross compiler armv7-nerves-linux-gnueabihf-gcc and not compiled using darwin's cc which is what the makefile attempts.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions