GCC编译选项语法问题 [英] GCC Compiling options syntax question
问题描述
我正在尝试gprof我的程序.我想要逐行分析.
但是,我似乎无法编写语法.我使用的是"make"而不是"gcc",因此请仅提供适合make的建议.如果您能给我完整的"make"语法,我将不胜感激.
基于此网站:
http://sourceware.org/binutils/docs/gprof/Output-Options.html [ ^ ]
http://sourceware.org/binutils/docs/gprof/Line_002dby_002dline.html [ ^ ]
这是我输入的内容:
使USE_LOCAL_HEADERS = 0 LDFLAGS =''-L.''BASE_CFLAGS = -m32 CFLAGS =''-fopenmp -pg -l -g''
输出为:
Hi,
I am trying to gprof my program. I want a line-by-line profiling.
However, I can''t seem to get the syntax write. I am using "make" and not "gcc" so please help only with suggestions that fit make. I wouldbe very grateful if you can give me the full "make" syntax.
Based on this website:
http://sourceware.org/binutils/docs/gprof/Output-Options.html[^]
http://sourceware.org/binutils/docs/gprof/Line_002dby_002dline.html[^]
Here is what I am inputting:
make USE_LOCAL_HEADERS=0 LDFLAGS=''-L.'' BASE_CFLAGS=-m32 CFLAGS=''-fopenmp -pg -l -g''
The output is:
/usr/bin/ld: cannot find -l-g
collect2: ld returned 1 exit status
make[2]: *** [build/release-linux-ppc64/ioquake3.ppc64] Error 1
make[2]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/svfb_201110271440/ioquake3dev_clean'
make: *** [release] Error 2
我需要选项"-l",-g"和"-pg".
问候,
Linux noob
I need option "-l", "-g" and "-pg".
Regards,
Linux noob
推荐答案
-l"选项对gcc无效,因此它假定应将其以及所有以下选项传递给链接器.您需要检查哪些选项对gprof有效,如此处所述. a href ="http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC2" target ="_ blank" title ="New Window"> ^ ],以及如此处所述 [
The ''-l'' option is not valid for gcc so it assumes that it, and all following options, should be passed to the linker. You need to check which options are valid for gprof, as described here[^], and for gcc as described here[^].
这篇关于GCC编译选项语法问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!