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

Invalid host arch error on M1 Mac #21

Closed
jerboy opened this issue Sep 15, 2023 · 4 comments
Closed

Invalid host arch error on M1 Mac #21

jerboy opened this issue Sep 15, 2023 · 4 comments

Comments

@jerboy
Copy link

jerboy commented Sep 15, 2023

When I try to run the "make" command on my M1 Mac, I get the following error message: "Invalid host arch: Your host arch must be amd64 or arm64". My computer is running on an M1 chip, which is arm64-based. It seems like the Makefile is not recognizing the arm64 architecture.

I would appreciate it if you could provide support for M1 Macs in your Makefile. As more and more people switch to M1 Macs, it is becoming increasingly important to have cross-architecture support.

Thank you for your attention to this matter.

@birros
Copy link
Member

birros commented Sep 15, 2023

I'm still on an Intel MacBook, so I'm trying to keep this compatibility without having access to a Silicon MacBook.

The lines concerned are:

ifeq ($(shell uname -m), x86_64)
HOST_ARCH = amd64
else ifeq ($(shell uname -m), aarch64)
HOST_ARCH = arm64
else
$(error "Invalid host arch: Your host arch must be amd64 or arm64")
endif

aarch64 is probably invalid, can you tell me which arch returns uname -m?

@23doors
Copy link
Contributor

23doors commented Sep 15, 2023

On arm macbooks it's arm64.

Changing line 33:

else ifeq ($(shell uname -m), aarch64)

to

else ifeq ($(shell uname -m), arm64)

seems to fix it and everything else seems to work fine afterwards

@jerboy
Copy link
Author

jerboy commented Sep 15, 2023

checking whether we are cross compiling... checking for x86_64-darwin-darwin-strip... no
checking for strip... strip
checking for a race-free mkdir -p... /Users/xxxx/Source/mpv/libmpv-darwin-build/build/tmp/libressl_iossimulator-amd64/src/libressl/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for x86_64-darwin-darwin-cc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling...

It still blocking here

@birros
Copy link
Member

birros commented Sep 15, 2023

If it freezes, reboot your machine. I think that after a long period of uptime, macOS has problems accessing the sdk.

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