5

このLLVM インスツルメンテーション プロジェクトを実行しようとしていますが、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
4

1 に答える 1

1

これを修正する正確な方法はわかりませんが、問題は、opt ドライバーによって「dlopen」されているのと互換性のない方法で、いくつかのコア LLVM ライブラリを計測 dylib に静的にリンクしていることです。したがって、それを開くと、さまざまなコマンドライン引数に対して重複するグローバルが取得されます。これはおそらく LLVM とはほとんど関係がなく、OS X で使用される特定のビルド プロセスと関係があります。シンボルの可視性および/または共有リンクと静的リンクのデフォルトが異なります。

于 2013-07-07T07:24:33.230 に答える