Click here to Skip to main content
16,015,827 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
VB
/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


I need option "-l", "-g" and "-pg".

Regards,
Linux noob
Posted

1 solution

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[^].
 
Share this answer
 
Comments
BrainlessLabs.com 18-Nov-11 12:56pm    
I agree with Richard. Let us know if you get some problem with it.
coffeenet 20-Nov-11 22:58pm    
"make USE_LOCAL_HEADERS=0 LDFLAGS='-L. -pg' BASE_CFLAGS=-m32 CFLAGS='-fopenmp -pg -g'" is how it got operative now. So, as you kindly said, "-l" was not valid. Thank you for the help.
Richard MacCutchan 21-Nov-11 8:15am    
You're welcome. Please mark this answer as accepted so others will know your problem is resolved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900