2013-03-18 14 views
5

Sto tentando di eseguire questo LLVM instrumentation project, ma sono solo in grado di caricare l'ottimizzazione della strumentazione sotto Linux.LLVM: Ottimizzazione caricamento in errore su OSX

Ho compilato e installato LLVM 3.2 e Clang 3.2 su OSX e ho la stessa versione in Linux.

Quando provo per l'esecuzione in 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 

stesso comando, in 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 

risposta

1

Non so esattamente come risolvere questo problema, ma il problema è che si' reincorporando staticamente alcune delle librerie LLVM di base nella strumentazione dylib in modo incompatibile con il fatto di essere "decollato" dal driver opt. Quindi, quando lo apri, ottieni dei globali duplicati per vari argomenti della linea di comando. Questo probabilmente ha poco a che fare con LLVM e molto altro ha a che fare con lo specifico processo di compilazione usato su OS X hanno diversi valori di default per la visibilità di simboli e/o collegamenti statici o condivisi.