We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
export fn foo() void {}
zig build-lib foo.zig
void foo(void); int main() {foo(); return 0;}
cc -o test test.c foo.a ld: warning: ignoring file foo.a, file was built for archive which is not the architecture being linked (x86_64): foo.a
The error message is bogus; the file is of course the correct architecture.
Suggestion here is to use libtool -static -o libio.a io.o rather than ar.: https://stackoverflow.com/questions/30948807/static-library-link-issue-with-mac-os-x-symbols-not-found-for-architecture-x8
libtool -static -o libio.a io.o
ar
We will have to figure out how to do that using LLVM API.
A workaround for this bug is to use build-obj instead of build-lib. Indeed that's the workaround here:
build-obj
build-lib
zig/src/link.cpp
Lines 35 to 42 in 74a335c
Related issue regarding a new linker: #1535 Related issue regarding dynamic libraries: #1982
The text was updated successfully, but these errors were encountered:
// The Mach-O LLD code is not well maintained, and trips an assertion // when we link compiler_rt and builtin as libraries rather than objects.
Is the assertion you get the same as #2421?
Sorry, something went wrong.
I believe I was tripping
zig/deps/lld/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp
Line 442 in 1c73c08
Successfully merging a pull request may close this issue.
The error message is bogus; the file is of course the correct architecture.
Suggestion here is to use
libtool -static -o libio.a io.o
rather thanar
.:https://stackoverflow.com/questions/30948807/static-library-link-issue-with-mac-os-x-symbols-not-found-for-architecture-x8
We will have to figure out how to do that using LLVM API.
A workaround for this bug is to use
build-obj
instead ofbuild-lib
. Indeed that's the workaround here:zig/src/link.cpp
Lines 35 to 42 in 74a335c
Related issue regarding a new linker: #1535
Related issue regarding dynamic libraries: #1982
The text was updated successfully, but these errors were encountered: