undefined reference to `_Unwind_Resume'

Hi,

I have already seen this kind of error on previous topic, but it was with older PGI compilers.
I get the following error :

make -f Makefile_60.pgi
pgf90 -c -Mvect=cachesize:524288,nosse -Mcache_align -Munroll -Mnoframe -O2 -pc 64 -pgf90libs -I./include anheader.f90 ramspost_B.f90 ramspost_D.f90 ramspost_C.f90
anheader.f90:
ramspost_B.f90:
ramspost_D.f90:
ramspost_C.f90:
ar r ramspost_60-pgi.a *.o
ar: creating ramspost_60-pgi.a
pgf90 -c -Mvect=cachesize:524288,nosse -Mcache_align -Munroll -Mnoframe -O2 -pc 64 -pgf90libs -I./include ./ramspost_A.f90
pgf90 -o ramspost_60-pgi -v -Wl,-static -pgf90libs ramspost_A.o ramspost_60-pgi.a ./LIB/libutils-pgi-2.0-ramspost.a

/usr/bin/ld /usr/lib64/crt1.o /usr/lib64/crti.o /opt/pgi/linux86-64/9.0-4/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/4.1.2/crtbegin.o /opt/pgi/linux86-64/9.0-4/lib/f90main.o -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /opt/pgi/linux86-64/9.0-4/lib/pgi.ld -L/opt/pgi/linux86-64/9.0-4/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.1.2 -static ramspost_A.o ramspost_60-pgi.a ./LIB/libutils-pgi-2.0-ramspost.a -rpath /opt/pgi/linux86-64/9.0-4/lib -o ramspost_60-pgi -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -lrt -lpthread -lm -lgcc -lc -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.1.2/crtend.o /usr/lib64/crtn.o
/usr/lib64/librt.a(aio_suspend.o): In function aio_suspend64': (.text+0x3ef): undefined reference to _Unwind_Resume’
/usr/lib64/librt.a(aio_suspend.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0' /usr/lib64/libpthread.a(pthread_once.o): In function clear_once_control’:
…/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_once.S:133: undefined reference to _Unwind_Resume' /usr/lib64/libpthread.a(pthread_once.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib64/libpthread.a(unwind.o): In function __pthread_unwind': unwind.c:(.text+0x3a): undefined reference to _Unwind_ForcedUnwind’
/usr/lib64/libpthread.a(unwind.o): In function unwind_stop': unwind.c:(.text+0xf9): undefined reference to _Unwind_GetCFA’
unwind.c:(.text+0x123): undefined reference to _Unwind_GetCFA' /usr/lib64/libpthread.a(unwind.o): In function __pthread_unwind_next’:
unwind.c:(.text+0x1c8): undefined reference to _Unwind_ForcedUnwind' /usr/lib64/libc.a(iofclose.o): In function fclose’:
(.text+0x1f6): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(iofclose.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(iofflush.o): In function fflush': (.text+0xf0): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(iofflush.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(iofputs.o): In function fputs’:
(.text+0x135): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(iofputs.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(iofread.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(ioftell.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(iofwrite.o): In function fwrite': (.text+0x15e): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(iofwrite.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(ioputs.o): In function puts’:
(.text+0x17b): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(ioputs.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(ioseekoff.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(ioungetc.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(putchar.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(wfileops.o): In function _IO_wfile_underflow’:
(.text+0x1193): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(wfileops.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(fputc.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(fseek.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(getc.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(getchar.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(putc.o):(.eh_frame+0x12): more undefined references to __gcc_personality_v0' follow /usr/lib64/libc.a(fileops.o): In function _IO_file_underflow’:
(.text+0x10ee): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(fileops.o): In function _IO_file_fopen’:
(.text+0x196e): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(fileops.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(syslog.o): In function openlog': (.text+0x2d7): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(syslog.o): In function vsyslog': (.text+0x814): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(syslog.o): In function vsyslog': (.text+0x82c): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(syslog.o): In function closelog': (.text+0x942): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(syslog.o):(.eh_frame+0x13): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(iogetdelim.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
pgf90-Fatal-linker completed with exit code 1

make: *** [ramspost_60-pgi] Error 2


Do you know what wrong is?

Thanks

Hi obertrand,

When statically linking with the system libraries, you need to include the GCC exception handling library (libgcc_eh.lib). Either add “-lgcc_eh” to your link line or replace “-Wl,-static” with “-Bstatic”. (The PGI driver will automatically add the library when -Bstatic is used).

Hope this helps,
Mat