2016-09-14 1 views
1

Ich möchte clam statischen Analyzer auf anderen Ziel ausführen. Hier ist das Makefile Snip:, wie Clang statischen Analyzer auf anderen Ziel mit Scan-Build ausführen

CC = <path to clang folder>/build/bin/clang 
. 
. 
.  
src/%.o: ../src/%.c 
    ${CC} --target=powerpc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "[email protected]" "$<" 

Ich versuche, zu PowerPC kompilieren. Dies ist die Befehlszeile und die Ausgabe:

>> <path_to_llvm_folder>/llvm/tools/clang/tools/scan-build/scan-build --use-analyzer=<path_to_llvm_folder>/build/bin/clang make 
scan-build: Using '<path_to_llvm_folder>/build/bin/clang' for static analysis 
Building file: ../src/testing.c 
Invoking: GCC C Compiler 
<path to clang folder>/llvm/tools/clang/tools/scan-build/ccc-analyzer --target=powerpc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/testing.d" -MT"src/testing.o" -o "src/testing.o" "../src/testing.c" 
cc1: warning: command line option "-ftarget=powerpc" is valid for Java but not for C 

Beachten Sie, dass, obwohl die Make-Datei Klirren Aufruf wird - ich gcc Warnung bin immer ... Wie verwende ich Klirren den Code und für die statische Analyse für verschiedene Ziel zu kompilieren ?

Antwort

0

gefunden die Lösung. Ich denke, es ist ein Fehler in dem ccc-Analysator Skript im nächsten param:

my %CompilerLinkerOptionMap = (
    '-Wwrite-strings' => 0, 
    '-ftrapv-handler' => 1, # specifically call out separated -f flag 
    '-mios-simulator-version-min' => 0, # This really has 1 argument, but always has '=' 
    '-isysroot' => 1, 
    '-arch' => 1, 
    '-m32' => 0, 
    '-m64' => 0, 
    '-stdlib' => 0, # This is really a 1 argument, but always has '=' 
    '--sysroot' => 1, 
    '-target' => 1, 
    '-v' => 0, 
    '-mmacosx-version-min' => 0, # This is really a 1 argument, but always has '=' 
    '-miphoneos-version-min' => 0 # This is really a 1 argument, but always has '=' 
); 

die

'-target' => 1, 

Bedürfnisse

'--target' => 1, 

(mit Doppel '-') sein. ..

Verwandte Themen