undefined reference to `__gcc_personality_v0'

Hello

I am trying to compile an executable using pgf90 v6.1 and I get the following error. I do not get the error when I remove the static link flag. I am unsure why this is happening and will greatly appreciate any hints on this one.

Thanks

Default Fortran Compiler: /share/apps/pgi/linux86-64/6.1/bin/pgf90
Default C Compiler: cc
Default C++ Compiler: C++

Files used for this build date:

CVS command = cvs -d $CVSROOT -r export -r HEAD -d jproc_table jproc_table
/share/apps/pgi/linux86-64/6.1/bin/pgf90 -c -Mfixed -Mextend -O2 -I. -DSUBST_GRID_ID=’’
-DSUBST_CONST="/home/root/AQM/CMAQ4.6/models/include/release/CONST.EXT"
-DSUBST_RXCMMN="/home/root/AQM/CMAQ4.6/models/include/release/cb4_ae4_aq/RXCM.EXT"
-DSUBST_RXDATA="/home/root/AQM/CMAQ4.6/models/include/release/cb4_ae4_aq/RXDT.EXT"
calczen.F -o calczen.o

/share/apps/pgi/linux86-64/6.1/bin/pgf90 -c -Mfixed -Mextend -O2 -I. -DSUBST_GRID_ID=’’
-DSUBST_CONST="/home/root/AQM/CMAQ4.6/models/include/release/CONST.EXT"
-DSUBST_RXCMMN="/home/root/AQM/CMAQ4.6/models/include/release/cb4_ae4_aq/RXCM.EXT"
-DSUBST_RXDATA="/home/root/AQM/CMAQ4.6/models/include/release/cb4_ae4_aq/RXDT.EXT"
chj.f -o chj.o

/share/apps/pgi/linux86-64/6.1/bin/pgf90 -c -Mfixed -Mextend -O2 -I. -DSUBST_GRID_ID=’’
-DSUBST_CONST="/home/root/AQM/CMAQ4.6/models/include/release/CONST.EXT"
-DSUBST_RXCMMN="/home/root/AQM/CMAQ4.6/models/include/release/cb4_ae4_aq/RXCM.EXT"
-DSUBST_RXDATA="/home/root/AQM/CMAQ4.6/models/include/release/cb4_ae4_aq/RXDT.EXT"
index2.f -o index2.o

/share/apps/pgi/linux86-64/6.1/bin/pgf90 -c -Mfixed -Mextend -O2 -I. -DSUBST_GRID_ID=’’
-DSUBST_CONST="/home/root/AQM/CMAQ4.6/models/i/usr/lib64/libc.a(iofclose.o): In function fclose': (.text+0x202): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(iofclose.o):(.eh_frame+0x21b): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(iofflush.o): In function fflush’:
(.text+0xfa): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(iofflush.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(iofputs.o): In function fputs': (.text+0x136): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(iofputs.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(iofread.o): In function fread’:
(.text+0x142): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(iofread.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(ioftell.o): In function ftell': (.text+0x137): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(ioftell.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(iofwrite.o): In function fwrite’:
(.text+0x15f): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(iofwrite.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(ioputs.o): In function puts': (.text+0x188): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(ioputs.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(ioseekoff.o): In function _IO_seekoff’:
(.text+0x1e0): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(ioseekoff.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(wfileops.o): In function _IO_wfile_underflow': (.text+0x116e): undefined reference to _Unwind_Resume’
/usr/lib64/libc.a(wfileops.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0' /usr/lib64/libc.a(fputc.o): In function fputc’:
(.text+0xf7): undefined reference to _Unwind_Resume' /usr/lib64/libc.a(fputc.o):(.eh_frame+0x14b): undefined reference to __gcc_personality_v0’
/usr/lib64/libc.a(fseek.o): In function fseek': (.text+0xea): undefined reference to _Unwind_Resume’

Hi avemuri,

A few years back, after PGI 6.1 was released, GNU separated out the static runtime exception handling routines into a separate library requiring you to add the flag “-lgcc_eh” to the link line.

Note that “-lgcc_eh” is added automatically by the PGI compilers with releases 7.0 and later.

Hope this helps,
Mat

Hi Mat,
Can you give me more details about link line, which one is that?
I apologize for my basic question.
thanks,
swan

Hi,

From what you posted above, we don’t see a complete link line.

What Mat means about link line is when you compile a program, you can do in two steps, first compile and then link.

compile line: pgf90 -c abc.f -o abc.o
link line : pgf90 -o my_executable abc.o -Lwhere_your_libgcc_eh_is -lgcc_eh


You will need to replace “where_your_libgcc_eh” with the actual location of libgcc_eh.a on your system.

Hongyon