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

Unable to compile on an Apple M2 chip ( found architecture 'x86_64', required architecture 'arm64' ) #56

Closed
Bastes opened this issue Jul 29, 2024 · 3 comments

Comments

@Bastes
Copy link

Bastes commented Jul 29, 2024

Hello everyone, I can't seem to get a lead on this. My company's working with procket and having just been assigned a new apple computer, it fails to compile with:

❯ mix deps.compile procket
/Library/Developer/CommandLineTools/usr/bin/make -f /path_to/deps/procket/c_src/Makefile.ancillary
make[1]: Nothing to be done for `all'.
cc -m64  -g -Wall -o /path_to/deps/procket/priv/procket -L/path_to/deps/procket/c_src procket_cmd.c -lancillary
ld: warning: ignoring file '/path_to/deps/procket/c_src/libancillary.a[3](fd_recv.o)': found architecture 'x86_64', required architecture 'arm64'
ld: warning: ignoring file '/path_to/deps/procket/c_src/libancillary.a[2](fd_send.o)': found architecture 'x86_64', required architecture 'arm64'
Undefined symbols for architecture arm64:
  "_ancil_send_fd", referenced from:
      _procket_pipe in procket_cmd-3c70fe.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [cmd] Error 1
===> Hook for compile failed!

** (Mix) Could not compile dependency :procket, "/user/.asdf/installs/elixir/1.11.4-otp-23/.mix/rebar3 bare compile --paths="/path_to/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile procket", update it with "mix deps.update procket" or clean it with "mix deps.clean procket"

The environment:

MacOS X Sonoma 14.5
chip: Apple M2
running Elixir/Erlang on asdf:
❯ asdf current
elixir          1.11.4-otp-23   /path_to/.tool-versions
erlang          23.3.4.4        /path_to/.tool-versions

Elixir and Erlang don't seem to have any trouble running, so I guess the problem is with a pre-compiled dependency not working on the Apple M2 chip or something? I couldn't find any lead googling and the only one I found in the previous or ongoing issues on this repository seems not to be related.

Any ideas? Has anyone managed to compile this on a M2 chip?

Thanks in advance.

@Bastes
Copy link
Author

Bastes commented Jul 29, 2024

(tried with versions 19c6b4e91fdff586b71e98199f37290628144c43and 2bc3696ad5027da99bc813c884b3a58bb9e71f5a so far, same result)

@msantos
Copy link
Owner

msantos commented Jul 29, 2024

@Bastes thanks for opening an issue!

This may be the same issue as msantos/gen_icmp#21.

To check, remove any copies of libancillary.a and recompile:

find . -name libancillary.a

If you're installing procket from hex, update the dep:

mix deps.update procket

@Bastes
Copy link
Author

Bastes commented Jul 29, 2024

Well, i'm going to just close it because it might have had something to do with some wonky dependency state. I tried to mix deps.clean procket and mix deps.get + mix deps.compile procket and it works like a treat now.

Thank you for you quick reply :) sorry for the noise.

@Bastes Bastes closed this as completed Jul 29, 2024
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

2 participants