ARM Mac Support #73
Comments
Yes... arm mac... 😅 So abseil, one of its dependencies, is failing to build. You can see in the |
hm so it seems abseil builds fine
the problem is this invocation
notably I tried With this hacky diff diff --git a/ld/zld.xcodeproj/project.pbxproj b/ld/zld.xcodeproj/project.pbxproj
index 40f5dc1..e4b3a8d 100644
--- a/ld/zld.xcodeproj/project.pbxproj
+++ b/ld/zld.xcodeproj/project.pbxproj
@@ -1308,6 +1308,7 @@
SECTORDER_FLAGS = "";
STRIP_INSTALLED_PRODUCT = NO;
TOOLCHAINS = osx;
+ VALID_ARCHS = arm64;
VERSIONING_SYSTEM = "apple-generic";
WARNING_CFLAGS = "-Wall";
};
@@ -1401,7 +1402,7 @@
STRIP_INSTALLED_PRODUCT = NO;
STRIP_STYLE = debugging;
TOOLCHAINS = osx;
- VALID_ARCHS = "x86_64 i386 ppc";
+ VALID_ARCHS = arm64;
VERSIONING_SYSTEM = "apple-generic";
WARNING_CFLAGS = "-Wall";
};
@@ -1755,7 +1756,7 @@
STRIP_INSTALLED_PRODUCT = NO;
STRIP_STYLE = debugging;
TOOLCHAINS = osx;
- VALID_ARCHS = "x86_64 i386 ppc";
+ VALID_ARCHS = arm64;
VERSIONING_SYSTEM = "apple-generic";
WARNING_CFLAGS = "-Wall";
};
@@ -1776,7 +1777,7 @@
PRODUCT_NAME = rebase;
STRIP_INSTALLED_PRODUCT = YES;
STRIP_STYLE = debugging;
- VALID_ARCHS = "i386 ppc x86_64";
+ VALID_ARCHS = arm64;
};
name = "Release-assert";
};
@@ -2128,6 +2129,7 @@
INSTALL_PATH = "$(DT_VARIANT)/$(TOOLCHAIN_INSTALL_DIR)/usr/bin";
PREBINDING = NO;
PRODUCT_NAME = rebase;
+ VALID_ARCHS = arm64;
};
name = Debug;
};
@@ -2146,7 +2148,7 @@
PRODUCT_NAME = rebase;
STRIP_INSTALLED_PRODUCT = YES;
STRIP_STYLE = debugging;
- VALID_ARCHS = "i386 ppc x86_64";
+ VALID_ARCHS = arm64;
};
name = Release;
}; I run into |
In that case, it's not abseil, but tbb, another dependency you can see in the Makefile |
ah they (libmimalloc.a and libtbb.a) were just build for x86 and committed in #18 and not build from source |
@michaeleisel How did you build libmimalloc.a? Do you mind if I build and submit those arm binaries? |
mimalloc? why do you need to build mimalloc? (i played with it at one point but i can't see any trace of it left in master). and i'd be happy to merge any prs to support arm |
ah, it's not being used, nevermind |
it would be best to integrate whats done https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tbb.rb into the makefile or was there a specific reason why thats not possible? Of course its tedious work :/ There is also at least one issue/ pr open at tdd about issues on arm so it would probably need to be updated again if it even works at all already (maybe the parts are not used here)
Its still in ld/libmimalloc.a |
tbb can be build with the homebrew formula but there are are a bunch of x86 simd intrinsics issues as well, pstl seems to be more of an intel thing so this just wont work I guess 😄 |
there may be larger issues too. for example, i was told that the arm linker signs while linking, which the x86 one doesn't do. but i may make a version without these dependencies and we can see how it goes |
The signing isn't that bad, several projects like zig and go already solved that and I think it's just computing a relatively basic hash. |
Reopening this issue to serve as a catch-all for ARM stuff, since it has the most context in its comments |
By the way, how are things with Rosetta code? I'll start putting up releases with pre-compiled executables for now in case it helps: https://github.com/michaeleisel/zld/releases/download/1.2.1/zld.tar.xz |
As for tbb, currently we download a pre-compiled version of it, and that version doesn't have arm (nor does their most recent version for mac). @benmkw can you try building it from scratch on your arm mac? I was able to cross-compile it for arm for iOS ( |
I'm getting the following:
with make
As a side note: |
Try with |
Tried but it ended up setting the flag to early and was thus unused so I did that: diff --git a/cmake/compilers/AppleClang.cmake b/cmake/compilers/AppleClang.cmake
index af964e66..9d2edfc6 100644
--- a/cmake/compilers/AppleClang.cmake
+++ b/cmake/compilers/AppleClang.cmake
@@ -14,7 +14,6 @@
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
-set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror>)
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
set(TBB_WARNING_SUPPRESS -Wno-parentheses -Wno-non-virtual-dtor -Wno-dangling-else)
# For correct ucontext.h structures layout and it worked (without
|
It looks like you built the latest version of tbb? zld is using the version of tbb at |
Submitted #75 that builds |
I'm not sure if I'm doing something wrong, but it still doesn't build for me
|
It's not released yet. |
Currently building rust programs that use build.rs (so basically any program which has a few dependencies) does not work as well as things like
If someone wants to work on this, one implementation of how to compute the signature is here (MIT License) https://github.com/kubkon/zld/blob/main/src/CodeSignature.zig |
I get the following when building on m1 arm mac:
It seems the issue is basically just that the target is set to x86 instead of arm so the fix could maybe be simple. Unfortunately I don't really know much about Xcode or how you set up the build yet. If you have a diff/ branch/ something I could/ should try I'm happy to do that and give feedback/ give more information.
The text was updated successfully, but these errors were encountered: