https://llvm.org/bugs/show_bug.cgi?id=25510
Bug ID: 25510 Summary: __builtin_cpu_supports("sse3") compiles, but fails when linking. Product: lld Version: unspecified Hardware: Macintosh OS: MacOS X Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedb...@nondot.org Reporter: p...@shifteleven.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified I am compiling on OSX 10.11 with clang-3.7 from macports. Here's some sample code to demonstrate the problem: #include <stdio.h> #include <stdlib.h> int main() { #if(__has_builtin(__builtin_cpu_supports)) && defined(__x86_64__) printf("__builtin_cpu_supports: %d\n", __builtin_cpu_supports("sse3")); #else printf("__builtin_cpu_cupports not available\n"); #endif return EXIT_SUCCESS; } If I compile with clang-3.7 or clang-3.8 (both which claim to have the builtin cpu supports), everything works. However, during linking, I get the following: Undefined symbols for architecture x86_64: "___cpu_model", referenced from: _dt_init in darktable.c.o ld: symbol(s) not found for architecture x86_64 With earlier versions of clang, I see the else clause. I have also seen this in the wild where this problem exists for FreeBSD as well. https://github.com/darktable-org/darktable/commit/081bc5823870918160fdd93d0157d56263add7d5. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs