Open cskiraly opened 1 year ago
I did run that myself on the M1 without any issue. I've been using Nim on the M1 now for months successfully.
I also had it running for long on M1 compiling Nim many times, then I've bumped into this just now. As I've said, I think it is clang version specific, so I wouldn't modify the code, just keep this issue around for people who bump into the same problem.
Build fails on Mac M1 with message "building for macOS-arm64 but attempting to link with file built for unknown-x86_64"
Also note that the error message is hidden during nim build in the nimbus-build system, if not using
make V=1
.Underlying issue
clang is compiling binaries to x86_64. Running the same command from command-line compiles to arm64.
Workaround found
To debug what happens I've added
-v
to CFLAGS, and the compilation magically changes to arm64. Really strange -v being verbose output. I suspect an underlying clang bug.Anyway the workaround is below. Note that
make clean
is required.