Hi,<br><br>I'm trying to profile a code that's I/O intensive and so I would like to <br>use the profiling version of the C library, libc_p.a. In a nutshell, executables<br>compiled with gcc with -p (or -pg) and linked with libc_p.a have a floating <br>
point exception right out the gate. (I also have the Intel C compiler installed,<br>icc, and the same is true.)<br><br>This is true for all versions of gcc I have installed, except for 2.95, for<br>which the link fails.<br>
<br>For example:<br><br>-------------------------------------------------------------------------<br>%coot 108: cat hello.c<br>#include <stdio.h><br><br>main() {<br><br>  printf ("hello, world!\n");<br><br>
}<br>%coot 109: gcc hello.c<br>%coot 110: a.out<br>hello, world!<br>%coot 111: gcc hello.c -lc_p<br>%coot 112: a.out<br>hello, world!<br>%coot 113: gcc -p hello.c -lc_p<br>%coot 114: a.out<br>Floating exception<br>%coot 115: gcc -p hello.c <br>
%coot 116: a.out<br>hello, world!<br>%coot 117: gcc -pg hello.c<br>%coot 118: a.out<br>hello, world!<br>%coot 119: gcc -p hello.c -lc_p<br>%coot 120: a.out<br>Floating exception<br>%coot 121: gcc -pg hello.c -lc_p<br>%coot 122: a.out<br>
Floating exception<br>%coot 123: gcc-3.3 -pg hello.c -lc_p<br>%coot 124: a.out<br>Floating exception<br>%coot 125: gcc-3.4 -pg hello.c -lc_p<br>%coot 126: a.out<br>Floating exception<br>%coot 127: gcc-4.2 -pg hello.c -lc_p<br>
%coot 128: a.out<br>Floating exception<br>%coot 129: gcc-2.95 hello.c<br>%coot 130: a.out<br>hello, world!<br>%coot 131: gcc-2.95 -pg hello.c<br>%coot 132: a.out<br>hello, world!<br>%coot 133: gcc-2.95 -pg hello.c -lc_p<br>
/usr/bin/../lib/libc_p.a(syslog.op): In function `__vsyslog_chk':<br>(.text+0x70e): undefined reference to `_Unwind_Resume'<br>(blah-blah-blah)<br>%coot 134:<br>--------------------------------------------------------------------------<br>
<br>I'm using the version of libc_p.a found in the Synaptic Package manger (SPM) under libc6-prof.<br>The versions of gcc were also found under the SPM.<br><br>I found  in the Synaptic Package manger (SPM) under libc6-prof.<br>
<br>I've also installed gcc in the same way. Under the SPM, versions 2.95,<br>3.3., 3.4, 4.1, and 4.2 are available. The base version is 4.1:<br><br>-----------------------------------------<br>%coot 104: gcc -v<br>Using built-in specs.<br>
Target: i486-linux-gnu<br>Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu<br>
Thread model: posix<br>gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)<br>%coot 105:<br>-----------------------------------<br><br>I have a neighbor running Red Hat with gcc 3.2.3, and I am able to build and run there:<br>
-----------------------------------------------------------------------------------------------------------------------------------------------<br>[pember@tern _gprof]$ gcc -p hello.c -lc_p<br>[pember@tern _gprof]$ ./a.out<br>
hello, world!<br>[pember@tern _gprof]$ <br>-----------------------------------------------------------------------------------------------------------------------------------------------<br><br>Is there some other version of libc_p I should be using?<br>
<br>Thanks,<br>Rick Pember<br>