[cfe-dev] error: use of undeclared identifier '__builtin_ia32_addss' while building clang using clang
Charles Davis
cdavis at mymail.mines.edu
Sat Feb 26 17:31:28 PST 2011
On 2/26/11 6:15 PM, Marcin Mirosław wrote:
> Hello!
> I tried to build clang using clang and i got errors. I'm using gentoo,
> gcc-4.4.5, i686. Llvm and clang are from trunk (clang r126559) with
> patch witch add path to gcc-4.4.5 headers.
> How could i fix this problem?
> Thanks!
>
> Error message:
> In file included from Lexer.cpp:1520:
> In file included from
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/emmintrin.h:36:
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:102:19: error:
> use of undeclared identifier '__builtin_ia32_addss'
> return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:108:19: error:
> use of undeclared identifier '__builtin_ia32_subss'
> return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:114:19: error:
> use of undeclared identifier '__builtin_ia32_mulss'
> return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:120:19: error:
> use of undeclared identifier '__builtin_ia32_divss'; did you mean
> '__builtin_ia32_minss'?
> return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B);
> ^~~~~~~~~~~~~~~~~~~~
> __builtin_ia32_minss
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:114:19: note:
> '__builtin_ia32_minss' declared here
> return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:158:19: error:
> use of undeclared identifier '__builtin_ia32_addps'; did you mean
> '__builtin_ia32_haddps'?
> return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B);
> ^~~~~~~~~~~~~~~~~~~~
> __builtin_ia32_haddps
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:102:19: note:
> '__builtin_ia32_haddps' declared here
> return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:164:19: error:
> use of undeclared identifier '__builtin_ia32_subps'; did you mean
> '__builtin_ia32_hsubps'?
> return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B);
> ^~~~~~~~~~~~~~~~~~~~
> __builtin_ia32_hsubps
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:108:19: note:
> '__builtin_ia32_hsubps' declared here
> return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:170:19: error:
> use of undeclared identifier '__builtin_ia32_mulps'
> return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:176:19: error:
> use of undeclared identifier '__builtin_ia32_divps'
> return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:214:10: error:
> use of undeclared identifier '__builtin_ia32_andps'
> return __builtin_ia32_andps (__A, __B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:220:10: error:
> use of undeclared identifier '__builtin_ia32_andnps'
> return __builtin_ia32_andnps (__A, __B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:226:10: error:
> use of undeclared identifier '__builtin_ia32_orps'; did you mean
> '__builtin_ia32_dpps'?
> return __builtin_ia32_orps (__A, __B);
> ^~~~~~~~~~~~~~~~~~~
> __builtin_ia32_dpps
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:226:10: note:
> '__builtin_ia32_dpps' declared here
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:226:39: error:
> too few arguments to function call, expected 3, have 2
> return __builtin_ia32_orps (__A, __B);
> ~~~~~~~~~~~~~~~~~~~ ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:232:10: error:
> use of undeclared identifier '__builtin_ia32_xorps'
> return __builtin_ia32_xorps (__A, __B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:242:19: error:
> use of undeclared identifier '__builtin_ia32_cmpeqss'; did you mean
> '__builtin_ia32_cmpss'?
> return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B);
> ^~~~~~~~~~~~~~~~~~~~~~
> __builtin_ia32_cmpss
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:242:19: note:
> '__builtin_ia32_cmpss' declared here
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:242:67: error:
> too few arguments to function call, expected 3, have 2
> return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B);
> ~~~~~~~~~~~~~~~~~~~~~~ ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:248:19: error:
> use of undeclared identifier '__builtin_ia32_cmpltss'; did you mean
> '__builtin_ia32_cmpss'?
> return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B);
> ^~~~~~~~~~~~~~~~~~~~~~
> __builtin_ia32_cmpss
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:242:19: note:
> '__builtin_ia32_cmpss' declared here
> return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:248:67: error:
> too few arguments to function call, expected 3, have 2
> return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B);
> ~~~~~~~~~~~~~~~~~~~~~~ ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:254:19: error:
> use of undeclared identifier '__builtin_ia32_cmpless'
> return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B);
> ^
> /usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/xmmintrin.h:262:6: error:
> use of undeclared identifier '__builtin_ia32_cmpltss'; did you mean
> '__builtin_ia32_cmpss'?
> __builtin_ia32_cmpltss ((__v4sf)
> __B,
> ^~~~~~~~~~~~~~~~~~~~~~
> __builtin_ia32_cmpss
> fatal error: too many errors emitted, stopping now [-ferror-limit=]
> 20 errors generated.
You say you're trying to build Clang with Clang? How come it's using
GCC's SSE headers instead of Clang's headers? Are you sure you installed
Clang properly? (There should be a <prefix>/lib/clang/2.9/include
directory containing the SSE headers.)
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).
Chip
More information about the cfe-dev
mailing list