【问题标题】:Scan service and "This platform is not supported by Coverity"扫描服务和“Coverity 不支持此平台”
【发布时间】:2017-02-07 05:13:26
【问题描述】:

我正在尝试在 OS X 下提交扫描。procedure I am following 在 32 位和 64 位 Linux 下运行良好,类似的过程在带有nmake 的 Winows 下运行良好。在 OS X 上 cov-build 失败:

$ 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
  • 索拉里斯
  • 窗口

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

【问题讨论】:

  • 这可能值得尝试export COVERITY_UNSUPPORTED=1,虽然我已经有一段时间没有尝试过了。

标签: xcode macos static-analysis coverity


【解决方案1】:

问题是您使用的 Coverity 版本不支持 Mac OSX 10.8。不幸的是,Apple 在 OS 版本中破坏与 Coverity 的兼容性是很常见的。

您可以导出 COVERITY_UNSUPPORTED=1。这将绕过平台支持检查,但不能保证一切都会按预期工作。你确实有相当大的成功几率。

【讨论】:

  • 再次感谢迦勒。我们发现我们需要你的工作量COVERITY_UNSUPPORTED=1,并且我们需要避免使用 OS X 10.8 的 Xcode 编译器。一旦我们迁移到 MacPorts Clang 3.7,事情就按预期进行。 OS X 完善了我们的平台方案。另请参阅我们的 wiki 上的 prescriptive instructions for Coverity Scan Build
  • 抱歉,我在将 Darwin 12.6 映射到 OSX 12 时犯了一个心理错误。这里的问题是 Coverity 从我们的 8.0 版本开始不再支持 OSX 10.8。其余的建议保持不变 - 设置 env var 看看会发生什么。编译器支持是一个单独的问题 - 我很高兴看到您找到了适合您的解决方案。
  • 我正在尝试在 OS X 10.9 上运行 Coverity 8.5.0.5,但它表现出相同的症状,仅供参考。
【解决方案2】:

这建立在 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

【讨论】:

    猜你喜欢
    • 2018-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-29
    • 1970-01-01
    • 1970-01-01
    • 2021-01-05
    • 2017-04-30
    相关资源
    最近更新 更多