0

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.

您可以在此处浏览源目录。

4

1 回答 1

0

根据clang 内部手册

__extension__:此扩展的表达式形式导致任何可评估的子表达式都被接受为整数常量表达式。

如果我们看一下clang 的当前定义,_mm_suffle_epi32很明显这在上面被描述为“整数常量表达式”。

查看该类函数宏的历史记录,它似乎被修改为使用__extension__关键字以“修复向量宏以正确检查参数类型”,然后随着时间的推移,该更改几乎回滚,正如您从当前定义。

总之,这似乎是一个 Clang 库错误。_mm_shuffle_epi32不是地球上记录最多的功能,但我发现的研究暗示它应该导致__mm128i. 也许,如果他们希望正确检查参数类型,他们应该将其声明为 [inlined?] 函数,而不是宏?

当我试图在各种 IRC 频道上对此进行讨论时,没有人回应,所以...

于 2015-07-04T03:48:07.650 回答