Open lacc97 opened 11 months ago
These symbols are defined in compiler-rt in LLVM: https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/cpu_model.c
Also, maybe related to https://github.com/ziglang/zig/issues/4591.
These symbols are defined in compiler-rt in LLVM: https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/cpu_model.c
only for those targets:
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || \
defined(_M_X64)) && \
(defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER))
aarch64 and other platforms use different symbols/strategies.
Exporting the symbols should be rather straightforward, since the x86 and x86_64 feature detection is already implemented. See https://github.com/ziglang/zig/issues/4591#issuecomment-1837271967.
@lacc97 Do you want to take a shot at it?
Sure I'll give it a shot.
@matu3ba PR here :) https://github.com/ziglang/zig/pull/18193
Zig Version
0.12.0-dev.1685+994e19164
Steps to Reproduce and Observed Behavior
Trying to compile a C file where a function has
target_clone
attribute fails. e.g. fortargets.c
:Running
fails with
Expected Behavior
This should compile successfully.