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

Fails to build on M1 Mac Mini #413

Closed
jakubgs opened this issue Nov 29, 2021 · 5 comments
Closed

Fails to build on M1 Mac Mini #413

jakubgs opened this issue Nov 29, 2021 · 5 comments

Comments

@jakubgs
Copy link

jakubgs commented Nov 29, 2021

Description

Currently building of this library fails if architecture is detected as arm64, but works for arm. This appears to be due to this line:

| arm | arm[lb]e | arme[lb] | armv* \

As far as I can tell just adding arm64 to this list in one form or another makes it work and build.

Expected Behavior

 > ./configure | grep 'build system' 
checking build system type... arm64-apple-darwin20.6.0

Actual Behavior

 > ./configure | grep 'build system'
Invalid configuration `arm64-apple-darwin20.6.0': machine `arm64-apple' not recognized
configure: error: /nix/store/ppzr8yab3s3883skd0da5i4ylzpksk9l-bash-5.1-p8/bin/bash ./config.sub arm64-apple-darwin20.6.0 failed

Steps to Reproduce

Hardware: Mac Mini G5E (M1)
Software: Darwin 20.6.0
SQLCipher version: 3.4.2 and 4.5.0

@jakubgs
Copy link
Author

jakubgs commented Nov 29, 2021

I've narrowed down the issue to uname -p - which is used by config.guess - which outputs different things in different contexts:

Env uname -p uname -m
/bin/zsh arm arm64
/opt/homebrew/bin/zsh arm arm64
Nix Shell arm64 arm64

Which causes config.guess to output arm64-apple-darwin20.6.0 under Nix shell and arm-apple-darwin20.6.0 outside.

@jakubgs
Copy link
Author

jakubgs commented Nov 29, 2021

I've tested the current config.guess from the official repo and it appears to fix the issue:

 > bash ./config.guess
aarch64-apple-darwin20.6.0

Because it includes this fix: https://git.savannah.gnu.org/gitweb/?p=config.git;a=commit;h=2593751ef

jakubgs added a commit to status-im/sqlcipher that referenced this issue Nov 29, 2021
This fixes build issues on new 5th generation Macs with `arm64` M1 CPUs.

Specifically it changes to detected system from `arm64-apple-darwin*`
or `arm64-apple-darwin*` to correct `aarch64-apple-darwin*`.

Resolves: sqlcipher#413

Signed-off-by: Jakub Sokołowski <jakub@status.im>
@jakubgs
Copy link
Author

jakubgs commented Nov 29, 2021

I've updated config.guess and config.sub to the most recent version from official repo: #414

My stab at trying to solve this issue.

@sjlombardo
Copy link
Member

Closing related ticket per #414, ticket open with Nix team to resolve in shell.

@jakubgs
Copy link
Author

jakubgs commented Dec 6, 2021

Update: This issue appears to be related to GNU Coreutils and its uname utility:

 > /opt/homebrew//Cellar/coreutils/9.0/bin/guname -m
arm64
 > /opt/homebrew//Cellar/coreutils/9.0/bin/guname -p
arm64

And it's not Nix specific. So the options are either fix GNU Coreutils (will take ages) or update config.guess in SQLite (will take ages as well).

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

Successfully merging a pull request may close this issue.

2 participants