Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling CRC for Nerves with non host target #49

Open
taun opened this issue Dec 7, 2023 · 4 comments
Open

Error compiling CRC for Nerves with non host target #49

taun opened this issue Dec 7, 2023 · 4 comments

Comments

@taun
Copy link

taun commented Dec 7, 2023

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.

@TattdCodeMonkey
Copy link
Owner

@taun 🤔 this will likely require some Makefile tinkering to adhere to the right cross compiler when provided from Nerves.

I might be able to tinker with this after the holidays as I have some time off but no guarantees on that.

@TattdCodeMonkey
Copy link
Owner

side note this really makes me want to work on #37 and ditch the NIFs entirely but alas thats on my wish list for awhile without the time to devote to the refactor.

@Noarkhh
Copy link

Noarkhh commented May 22, 2024

Hi @TattdCodeMonkey, any updates on this?

@TattdCodeMonkey
Copy link
Owner

@Noarkhh not really, I haven't had the time to reproduce this then work on a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants