【问题标题】:LLVM: Optimization loading failing on OSXLLVM:OSX 上的优化加载失败
【发布时间】:2013-03-18 11:37:42
【问题描述】:

我正在尝试运行这个LLVM instrumentation project,但我只能在 Linux 下加载检测优化。

我已经在 OSX 上编译安装了 LLVM 3.2 和 Clang 3.2,在 Linux 上也有相同的版本。

当我尝试在 Linux 中运行时:

command opt -load ./obj/llvminstrument/libllvminstrument.so -help |grep instrum
    -insert-edge-profiling                     - Insert instrumentation for edge profiling
    -insert-gcov-profiling                     - Insert instrumentation for GCOV profiling
    -insert-optimal-edge-profiling             - Insert optimal instrumentation for edge profiling
    -insert-path-profiling                     - Insert instrumentation for Ball-Larus path profiling
    -instrument_block                          - Injects block instrumentation instructions
    -instrument_function                       - Injects function instrumentation instructions
    -instrument_prepare                        - Prepares instrumentation instructions

相同的命令,在 OSX 中:

command opt -load ./obj/llvminstrument/libllvminstrument.dylib -help |grep instrum    │········
opt: CommandLine Error: Argument 'track-memory' defined more than once!                                                  │········
opt: CommandLine Error: Argument 'debug-buffer-size' defined more than once!                                             │········
opt: CommandLine Error: Argument 'print-all-options' defined more than once!                                             │········
opt: CommandLine Error: Argument 'print-options' defined more than once!                                                 │········
opt: CommandLine Error: Argument 'print-after-all' defined more than once!                                               │········
opt: CommandLine Error: Argument 'print-before-all' defined more than once!                                              │········
opt: CommandLine Error: Argument 'track-memory' defined more than once!                                                  │········
opt: CommandLine Error: Argument 'debug-buffer-size' defined more than once!                                             │········
opt: CommandLine Error: Argument 'print-all-options' defined more than once!                                             │········
opt: CommandLine Error: Argument 'print-options' defined more than once!                                                 │········
opt: CommandLine Error: Argument 'print-after-all' defined more than once!                                               │········
opt: CommandLine Error: Argument 'print-before-all' defined more than once!                                              │········
    -insert-edge-profiling                     - Insert instrumentation for edge profiling                               │········
    -insert-gcov-profiling                     - Insert instrumentation for GCOV profiling                               │········
    -insert-optimal-edge-profiling             - Insert optimal instrumentation for edge profiling                       │········
    -insert-path-profiling                     - Insert instrumentation for Ball-Larus path profiling

【问题讨论】:

    标签: macos llvm clang


    【解决方案1】:

    我不知道如何解决这个问题,但问题是您将几个核心 LLVM 库静态链接到检测 dylib 的方式与 opt 的“dlopen”不兼容司机。因此,当您打开它时,您会得到各种命令行参数的重复全局变量。这可能与 LLVM 关系不大,而更多地与 OS X 上使用的特定构建过程有关,对于符号的可见性和/或共享与静态链接有不同的默认值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-11
      • 2016-08-26
      • 2018-01-18
      • 1970-01-01
      • 2012-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多