glibc and pgf90 problems

Hi… :-)

When doing make win pgf90 an gcc, the following was prompted by the console:

/usr/lib/libc.a(iofclose.o)(.text+0x196): In function fclose': : undefined reference to _Unwind_Resume’
/usr/lib/libc.a(iofclose.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(iofflush.o)(.text+0xcd): In function fflush’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(iofflush.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(iofputs.o)(.text+0xf3): In function fputs': : undefined reference to _Unwind_Resume’
/usr/lib/libc.a(iofputs.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(iofwrite.o)(.text+0x106): In function fwrite’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(iofwrite.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(ioseekoff.o)(.text+0x190): In function _IO_seekoff': : undefined reference to _Unwind_Resume’
/usr/lib/libc.a(ioseekoff.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(wfileops.o)(.text+0x48e): In function _IO_wfile_underflow’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(wfileops.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(fileops.o)(.text+0x37d): In function _IO_new_file_underflow': : undefined reference to _Unwind_Resume’
/usr/lib/libc.a(fileops.o)(.text+0x218a): In function _IO_file_fopen': \ \ \ : undefined reference to _Unwind_Resume’
/usr/lib/libc.a(fileops.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(syslog.o)(.text+0x1b8): In function closelog’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o)(.text+0x235): In function openlog’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o)(.text+0x6cd): In function vsyslog’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o)(.text+0x6de): In function vsyslog’:
: undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o)(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(backtrace.o)(.text+0x1b): In function backtrace_helper': : undefined reference to _Unwind_GetIP’
/usr/lib/libc.a(backtrace.o)(.text+0x34): In function backtrace_helper': : undefined reference to _Unwind_GetGR’
/usr/lib/libc.a(backtrace.o)(.text+0x3f): In function backtrace_helper': : undefined reference to _Unwind_GetCFA’
/usr/lib/libc.a(backtrace.o)(.text+0x98): In function backtrace': : undefined reference to _Unwind_Backtrace’
make[1]: *** [model] Error 2
make[1]: Leaving directory `/home/waldyd/camx’
make: *** [pg_linux] Error 2
[waldyd@localhost camx]$

It seems to be a problem with gcc and pgf90, how can i solve this… I am using Fedora Core 4 and pgf90 v 41 (i know it is not supported, but i have done make before editing localrc file) How can i solve this?

Hi waldyd,

This is the same answer I did for your previous post GLIBC and RAMS installing problems…

For the undefined references, you want to find the library which contains the symbols. In this case, the symbols can be found in “/usr/lib/gcc/i386-redhat-linux/4.0.0/libgcc_eh.a”. Using the “nm” utility, followed by a “grep” will show if the symbol is present and an upper case “T” indicates that the symbol is defined. A “U” indicates that the symbol is used but undefined. For exmple:

fedora4:/usr/lib/gcc/i386-redhat-linux/4.0.0% nm libgcc_eh.a | grep -i "_Unwind_GetCFA"
nm: unwind-sjlj.o: no symbols
00000224 T _Unwind_GetCFA

To search multiple libraries use the “foreach” command.

foreach i ( `ls *.a` )
foreach? echo $i
foreach? nm $i | grep "_Unwind_GetCFA"
foreach? end

Adding “-lgcc_eh” should solve your linking problem.

Hope this helps,
Mat

HI…

On Fedora Core 4,what i finally did was:

  1. Include -lgcc_eh library
  2. include -lpthread library
  3. Eliminate the -static linker option

And That’s it :-) … All solves…

Thanks mkcolg… Your info was so usefull…

I find that the following program:

WRITE(,) ‘This is a test.’
END

when compiled with “pgf90 -Bstatic” gives the “undefined reference to _Unwind_Resume” messages. This is under Fedora Core 4, and pgf90 versions 6.0-2 and 6.1-2.

Hi djohnson,

Interesting. It looks like the FC4 libc contains exception handling symbols. These symbols are defined in the dynamic library but not in the static library. As a work around, add “-lc -lgcc_eh” to your link line.

I’ll pass this information along so hopefully we can get “-lgcc_eh” added to the link line by default.

Thanks,
Mat

Adding the -lc works! I’d tried the

pgf90 -Bstatic -lgcc_eh

before and it didn’t work, but

pgf90 -Bstatic -lc -lgcc_eh

works fine. Thanks.