[cfe-dev] error: use of undeclared identifier '__builtin_ia32_addss' while building clang using clang

Marcin Mirosław marcin at mejor.pl
Sun Feb 27 01:33:57 PST 2011


W dniu 2011-02-27 02:31, Charles Davis pisze:
> You say you're trying to build Clang with Clang? How come it's using
> GCC's SSE headers instead of Clang's headers?

When i try to use "vanilla" sources i got:
In file included from
/var/tmp/portage/sys-devel/clang-9999/work/llvm/include/llvm/Support/SwapByteOrder.h:18:
/var/tmp/portage/sys-devel/clang-9999/work/llvm/include/llvm/Support/DataTypes.h:35:10:
fatal error: 'cmath' file not found
#include <cmath>

To solve this error i added this section:
+    // Gentoo x86 gcc 4.4.5
+    AddGnuCPlusPlusIncludePaths(
+      "/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/g++-v4",
+      "i686-pc-linux-gnu", "", "", triple);

to InitHeaderSearch.cpp .
Next i've got error:
In file included from Signals.cpp:30:
/var/tmp/portage/sys-devel/clang-9999/work/llvm/lib/Support/Unix/Signals.inc:31:10:
fatal error: 'cxxabi.h' file not found
#include <cxxabi.h>

I found file cxxabi.h in dir:
/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/ so... i added:
AddGnuCPlusPlusIncludePaths(
      "/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/",
      "i686-pc-linux-gnu", "", "", triple);

Probably this solved one problem and created another one.

> Are you sure you installed
> Clang properly? (There should be a <prefix>/lib/clang/2.9/include
> directory containing the SSE headers.)
Yes, i've got this headers in directory: /usr/lib/clang/2.9/include/
(files *mmintrin.h exists there)

> And no, Clang can't use GCC's headers. A bunch of GCC built-ins were
> purposefully omitted, because Clang doesn't need them (they're all
> internal implementation details of GCC's SSE headers).

I'm guessing that proper solution is to make clang searching headers
first in own dir ( /usr/lib/clang/2.9/include/ ) and next in gcc path.
Do i think correctly? Or maybe there is much easiest way how to fix
problem with cxxabi.h file?
Thanks for reply.



More information about the cfe-dev mailing list