spesmilo / spesmilo/electrum

Running from source on Apple M1 AppleSilicon "wrong architecture"

Open
#6,948 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-mac
Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

Seems that only libsecp256k1 stops me from using a native electrum on AppleSilicon, as python is already available for the M1 CPU.

After building libsecp256k1 using

$ gcc -dumpmachine
arm64-apple-darwin20.2.0
$ GCC_TRIPLET_HOST="arm64-apple-darwin20.2.0" ./contrib/make_libsecp256k1.sh

My error message is:

name@Mac-mini Electrum-4.0.9 % ./run_electrum
E | ecc_fast | libsecp256k1 library failed to load. exceptions: [OSError('dlopen(/Users/name/Downloads/Electrum-4.0.9/electrum/libsecp256k1.0.dylib, 6): no suitable image found. Did find:\n\t/Users/name/Downloads/Electrum-4.0.9/electrum/libsecp256k1.0.dylib: mach-o, but wrong architecture\n\t/Users/name/Downloads/Electrum-4.0.9/electrum/libsecp256k1.0.dylib: mach-o, but wrong architecture'), OSError('dlopen(libsecp256k1.0.dylib, 6): image not found')]
Error: Failed to load libsecp256k1.

What went wrong here?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with contrib/make_libsecp256k1.sh and the libsecp256k1 loading path reached by run_electrum. Reproduce the Apple Silicon build and inspect the generated libsecp256k1.0.dylib architecture against the native Python process; done means the source build loads successfully on Apple Silicon or the incompatibility is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos, python
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.