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

xmake fails to build on Apple Silicon (macOS ARM) #1190

Closed
fxcoudert opened this issue Jan 11, 2021 · 6 comments
Closed

xmake fails to build on Apple Silicon (macOS ARM) #1190

fxcoudert opened this issue Jan 11, 2021 · 6 comments
Milestone

Comments

@fxcoudert
Copy link

Describe the bug

xmake fails to build on Apple Silicon (macOS ARM) Homebrew/homebrew-core#68773
make build fails

Error output

compile:
    plat:		macosx
    arch:		x86_64
    host:		macosx

then

make[3]: *** [tbox/src/tbox/platform/file.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [DEP_PROS_tbox_all] Error 2
: note: 'stat' declared here
int     stat(const char *, struct stat *) __DARWIN_INODE64(stat);
        ^

Related Environment

Please provide compiling and running environment information:

  • xmake version: 2.3.9
  • os: macOS 11.1
  • target platform: Apple Silicon
@fxcoudert
Copy link
Author

Passing BUILD_ARCH=arm64 to make build leads to the same error in tbox/src/tbox/platform/file.o

@waruqi waruqi added this to the v2.5.1 milestone Jan 11, 2021
@waruqi
Copy link
Member

waruqi commented Jan 11, 2021

make[3]: *** [luajit/src/lib_base.o] Error 1
make[2]: *** [DEP_PROS_luajit_all] Error 2
In file included from luajit/src/lib_base.c:32:
luajit/src/lj_ff.h:14:10: fatal error: 'lj_ffdef.h' file not found
#include "lj_ffdef.h"
^~~~~~~~~~~~

https://github.com/Homebrew/homebrew-core/runs/1681778752?check_suite_focus=true

Lack of luajit autogen files for macos/arm64, I need to compile the luajit source code on apple m1, then extract its autogen files, such as lj_vm.S lj_libdef.h and other files, and put them in the xmake/core/src/luajit/autogen/macosx/jit/arm64 directory.

But I don’t have a macos/arm device and environment to extract these files.

@waruqi
Copy link
Member

waruqi commented Jan 11, 2021

An exception occurred within a child process:
Error: xmake: failed
BuildError: Failed executing: /opt/homebrew/Cellar/xmake/1_1/bin/xmake create test

I have solved all compile issues, but it can’t run, and no any errors.

@waruqi
Copy link
Member

waruqi commented Jan 12, 2021

I fixed link error on macOS arm, but next error

error: ...mebrew/Cellar/xmake/1_1/share/xmake/core/_xmake_main.lua:0: attempt to compare two table values

ohmm..

@waruqi
Copy link
Member

waruqi commented Jan 15, 2021

It seems that luajit is not yet able to support m1 well, as I have not apple silicon device, I cannot test it further.

I will consider switching to lua vm through optional configuration in 2.5.2

@waruqi waruqi modified the milestones: v2.5.1, v2.5.2 Jan 15, 2021
@waruqi
Copy link
Member

waruqi commented Jan 20, 2021

@fxcoudert I have supported apple m1, and it works for me.

you can switch url to https://github.com/xmake-io/xmake/releases/download/v2.3.9/xmake-v2.3.9.m1.tar.gz
and modify shasum to 25a8fc39c6859854d26cec918eca94e16427d76870a9f29f4b302f7d300674a2 and try it again.

@waruqi waruqi modified the milestones: v2.5.2, v2.5.1 Jan 20, 2021
@waruqi waruqi closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants