NSS中的freebl库无法正确构建(作为Firefox的一部分),因为来自Clang 3.7的emmintrin.h标头抛出我认为是由于缺少-msse2标志而导致的错误。即使使用此标志,调用此标头的源文件也会失败。
14:08.94 d:/gecko-dev-release/security/nss/lib/freebl/intel-gcm-wrap.c(123,78) :
error(clang): passing 'int' to parameter of incompatible type '__m128i' (vecto
r of 2 'long long' values)
14:08.94 _mm_storeu_si128((__m128i*)gcm->CTR, _mm_shuffle_epi8(_mm_add_epi32
(ONE, _mm_shuffle_epi8(_mm_loadu_si128((__m128i*)gcm->CTR), BSWAP_MASK)), BSWAP_
MASK));
14:08.94
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:08.94 c:\Program Files\LLVM\bin\..\lib\clang\3.7.0\include\emmintrin.h(630,36
) : note(clang): passing argument to parameter '__b' here
14:08.94 _mm_add_epi32(__m128i __a, __m128i __b)
14:08.94 ^
14:08.94 1 error generated.
14:08.96 intel-gcm-wrap.c
14:08.99 d:/gecko-dev-release/security/nss/lib/freebl/intel-gcm-wrap.c(123) : er
ror C2164: '_mm_shuffle_epi8' : intrinsic function not declared
14:08.99 d:/gecko-dev-release/security/nss/lib/freebl/intel-gcm-wrap.c(123) : er
ror C2284: '_mm_shuffle_epi8': illegal argument to intrinsic function, parameter
1
14:08.99 d:/gecko-dev-release/security/nss/lib/freebl/intel-gcm-wrap.c(123) : er
ror C2284: '_mm_shuffle_epi8': illegal argument to intrinsic function, parameter
2
14:08.99 d:/gecko-dev-release/security/nss/lib/freebl/intel-gcm-wrap.c(123) : er
ror C2440: 'function' : cannot convert from '' to '__m128i'
14:08.99 clang-cl.exe: error: clang frontend command failed with exit code 2 (us
e -v to see invocation)
14:09.00 ../../coreconf/rules.mk:384: recipe for target 'd:/gecko-dev-release/ob
jdir/security/nss/lib/freebl/intel-gcm-wrap.obj' failed
14:09.00 mozmake.EXE[7]: *** [d:/gecko-dev-release/objdir/security/nss/lib/freeb
l/intel-gcm-wrap.obj] Error 2
14:09.00 Makefile:568: recipe for target 'libs' failed
14:09.00 mozmake.EXE[6]: *** [libs] Error 2
14:09.00 Makefile:468: recipe for target 'libs-nss/lib/freebl' failed
14:09.00 mozmake.EXE[5]: *** [libs-nss/lib/freebl] Error 2
14:09.00 mozmake.EXE[5]: *** Waiting for unfinished jobs....
14:11.30 d:/gecko-dev-release/config/recurse.mk:74: recipe for target 'config/ex
ternal/nss/target' failed
14:11.30 mozmake.EXE[4]: *** [config/external/nss/target] Error 2
14:11.30 d:/gecko-dev-release/config/recurse.mk:36: recipe for target 'compile'
failed
14:11.30 mozmake.EXE[3]: *** [compile] Error 2
14:11.30 d:/gecko-dev-release/config/rules.mk:541: recipe for target 'default' f
ailed
14:11.30 mozmake.EXE[2]: *** [default] Error 2
14:11.30 d:/gecko-dev-release/client.mk:400: recipe for target 'realbuild' faile
d
14:11.30 mozmake.EXE[1]: *** [realbuild] Error 2
14:11.31 client.mk:171: recipe for target 'build' failed
14:11.31 mozmake.EXE: *** [build] Error 2
14:11.36 0 compiler warnings present.
您可以浏览源目录here。
答案 0 :(得分:0)
__extension__
:此扩展的表达式形式导致任何可评估的子表达式被接受为整数常量表达式。
如果我们看一下the current definition that clang has for _mm_suffle_epi32
,很明显上面将其描述为"整数常量表达式" s。
查看类似函数的宏的历史记录,似乎已将其修改为使用__extension__
关键字以便"Fix vector macros to correctly check argument types",然后随着时间的推移,该更改几乎会回滚,因为您可以从目前的定义看。
总之,看起来这是一个Clang库错误。 _mm_shuffle_epi32
并不是地球上记录最多的功能,但我发现的研究暗示它应该会产生__mm128i
。也许,如果他们希望正确检查参数类型,他们应该将其声明为[inlined?]函数,而不是宏?
当我试图在各种IRC频道上讨论这个问题时,没有人回答,所以...我想我只是把这个作为你的问题的答案,因为它'评论过于冗长。