2016-09-29 66 views
2

我试图在OS X下提交扫描。procedure I am following在32位和64位Linux下工作良好,类似的过程在Winows nmake。在OS X cov-build未能与:扫描服务和“此平台不被Coverity支持”

$ CXXFLAGS="-DNDEBUG -g2 -O3" cov-build --dir cov-int make -j 2 

Coverity Build Capture (64-bit) version 8.5.0.3 on Darwin 12.6.0 x86_64 
Internal version numbers: db70178643 p-kent-push-26368.949 

Platform info: 
Sysname = Darwin 
Release = 12.6.0 
Machine = x86_64 

[ERROR] This platform is not supported by Coverity. 
[ERROR] See documentation for the list of supported platforms. 

不同的OS X机器会产生同样的错误:

$ CXXFLAGS="-DNDEBUG -g2 -O3" cov-build --dir cov-int make -j 2 

Coverity Build Capture (64-bit) version 8.5.0.3 on Darwin 13.4.0 x86_64 
Internal version numbers: db70178643 p-kent-push-26368.949 

Platform info: 
Sysname = Darwin 
Release = 13.4.0 
Machine = x86_64 

[ERROR] This platform is not supported by Coverity. 
[ERROR] See documentation for the list of supported platforms. 

我无法查找的文档:

$ cov-build --help 
Coverity Build Capture (64-bit) version 8.5.0.3 on Darwin 12.6.0 x86_64 
Internal version numbers: db70178643 p-kent-push-26368.949 

No help found for 'cov-build' 

Coverity Data Sheet状态OS X被支持,并且一个press release states OS X 10.8 is supported

  • AIX
  • FreeBSD的
  • HP-UX
  • Linux的
  • 的Mac OS X
  • NetBSD的
  • 的Solaris
  • 的Windows

为什么我会收到[ERROR] This platform is not supported by Coverity,我该如何解决?

+1

可能值得尝试'export COVERITY_UNSUPPORTED = 1',尽管我还没有尝试过很长一段时间。 –

回答

2

问题是Mac OSX 10.8在您使用的Coverity版本中不受支持。不幸的是,苹果通过操作系统版本打破与Coverity的兼容性有些普遍。

您可以导出COVERITY_UNSUPPORTED = 1。这将绕过平台支持检查,但不保证事情按预期工作。你确实有很好的成功几率。

+0

再次感谢迦勒。我们发现我们需要您的'COVERITY_UNSUPPORTED = 1'的工作量,我们需要避免OS X 10.8的Xcode编译器。一旦我们转移到MacPorts Clang 3.7,事情就像预期的那样。 OS X为我们的平台提供了我们的食谱。另请参阅我们wiki上的[Coverity Scan Build说明性说明](http://cryptopp.com/wiki/Coverity_Scan)。 – jww

+0

我的道歉,我把Darwin 12.6映射到OSX 12的心理错误。这里的问题是,Coverity不再支持我们的8.0版本的OSX 10.8。其余的建议保持不变 - 设置env var并查看会发生什么。编译器支持是一个单独的问题 - 我很高兴看到您找到了适合您的解决方案。 – Caleb

+0

我试图在OS X 10.9上运行Coverity 8.5.0.5,它显示了同样的症状,仅供参考。 – Bombe

0

这建立在Flash Sheridan和Caleb的建议基础上。平台的问题较少,编译器的问题较多。 Xcode 5.0和5.1生成扫描版本失败:

CXXFLAGS="-DNDEBUG -g2 -O3" cov-build --dir cov-int make -j 2 
... 

cat cov-int/build-log.txt 
... 

"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../ 
lib/clang/5.0/include/stddef.h", line 29: error #109: 

expression preceding parentheses of apparent call must have 

(pointer-to-) function type 

#if !defined(_PTRDIFF_T) || __has_feature(modules) 


"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../ 
lib/clang/5.0/include/stddef.h", line 31: error #59: 

function call is not allowed in a constant expression 

#if !__has_feature(modules) 
... 

第二个解决方法取决于Flash Sheridan和Caleb的解决方法。它增加了“使用不同的编译器”。下面,我们使用MacPorts Clang 3.7来执行扫描构建。

$ CXX=/opt/local/bin/clang++-mp-3.7 COVERITY_UNSUPPORTED=1 CXXFLAGS="-DNDEBUG -g3 -O2" cov-build --dir cov-int make -j 8 
Coverity Build Capture (64-bit) version 8.5.0.3 on Darwin 12.6.0 x86_64 
Internal version numbers: db70178643 p-kent-push-26368.949 

/opt/local/bin/clang++-mp-3.7 -DNDEBUG -g3 -O2 -fPIC -march=native -pipe -c cryptlib.cpp 
/opt/local/bin/clang++-mp-3.7 -DNDEBUG -g3 -O2 -fPIC -march=native -pipe -c cpu.cpp 
... 

Emitted 134 C/C++ compilation units (100%) successfully 

134 C/C++ compilation units (100%) are ready for analysis 
The cov-build utility completed successfully. 

任何有兴趣,我们是一个自由和开放源码软件项目,我们利用Coverity Scan Service的不收取任何费用。但是,文档很轻松。

如果您想要为Unix,Linux,OS X和Windows执行扫描构建的说明性说明,请参阅Crypto++ wiki | Coverity Scan