選項有:c, objective-c, c-header, c++, cpp-output, assembler, 以及 assembler-with-cpp
e.g.
gcc -x c hello.pig
特殊用法:
-x none
filename:關掉上一個-x選項,
e.g.
gcc -x c hello.pig -x none hello2.c
e.g.
gcc -c hello.c
將只會生成hello.o
e.g.
gcc -shello.c
將只會生成hello.s格式的 彙編**,可以用文字編輯器檢視。
e.g.
gcc -e hello.c > hello.txt
或
gcc -e hello.c | more
e.g.
gcc -o hello.so hello.c
e.g.
gcc -pipe -o hello.so hello.c
e.g.
gcc hello.c -include /root/hello.h
-i-:取消上一個命令的功能,所以這個flag通常接在-idir後使用;
-md:和-m相同,只是將資訊輸出到一個.d檔案中
-mm:和-m相同,但是它將忽略由#include造成的依賴關係。
-mmd:和-mm相同,只是將資訊輸出到一個.d檔案中
-wl,options:傳遞options給連線程式,options之間用逗號分隔
-shared-fpic:編譯器就生成位置無關目標碼,適用於-static
-fpic:編譯器就輸出位置無關目標碼,適用於-shared