-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
os-macosupstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.zig ccZig as a drop-in C compiler featureZig as a drop-in C compiler feature
Milestone
Description
Thanks a lot for adding zig cc
and zig c++
functionality. It is really useful.
I tried to use zig c++
instead of the standard LLVM toolchain for one of my projects. I build it on MacOS. In general, it mostly works, but I've discovered the following issues:
- There is a number of flags passed to the linker using
-Wl,my_linker_option
. They are important for proper linking of the project. But some of them are not supported yet.
warning: unsupported linker arg: -search_paths_first
warning: unsupported linker arg: -headerpad_max_install_names
warning: unsupported linker arg: -force_load
warning: unsupported linker arg: -force_load
- If I configure my CMake-based project to use make and then run make, it seems to work fine as long as make is using just a single thread. But if I use e.g.
make -j 2
I start seeing some issues:
zig -c test.cpp -std=c++14 -ffast-math -fno-finite-math-only -g -I/path/to/include -emit-llvm -O0 -o test.o
Invalid argument: -c
It seems as if there is a race condition somewhere. As you can seen in zig's command line it misses c++
after zig somehow.
- If I configure my CMake-based project to use
ninja
and then runninja
, I see issues with dependency tracking supported by clang. Specifically, there seems to be an issue with handling of-MF
flags (see below). Same project can be build just fine if I use the vanilla LLVM toolchain.
zig: error: no such file or directory: 'test.cpp.o.d'
The following command failed when running ninja:
zig clang -c -MD -MV -MF zig-cache/tmp/eamNMvLXEZYC-test.o.d -MD -MT -MF test.cpp.o.d -o zig-cache/tmp/eamNMvLXEZYC-test.o test.cpp
It would be nice if these issues could be resolved.
Please let me know if I can provide any additional information that would allow to fix these issues.
Metadata
Metadata
Assignees
Labels
os-macosupstreamAn issue with a third party project that Zig uses.An issue with a third party project that Zig uses.zig ccZig as a drop-in C compiler featureZig as a drop-in C compiler feature