PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

glibc and pgf90 problems
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
waldyd



Joined: 26 Apr 2005
Posts: 4

PostPosted: Tue Feb 21, 2006 2:01 pm    Post subject: glibc and pgf90 problems Reply with quote

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?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6208
Location: The Portland Group Inc.

PostPosted: Tue Feb 21, 2006 3:42 pm    Post subject: Reply with quote

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:
Code:

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.
Code:

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


Last edited by mkcolg on Fri Mar 10, 2006 5:51 pm; edited 1 time in total
Back to top
View user's profile
waldyd



Joined: 26 Apr 2005
Posts: 4

PostPosted: Fri Mar 10, 2006 2:28 pm    Post subject: Final solution... Reply with quote

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...
Back to top
View user's profile
Jeremy.Avise



Joined: 06 Apr 2005
Posts: 2

PostPosted: Tue Mar 14, 2006 1:51 pm    Post subject: Still a problem Reply with quote

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.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6208
Location: The Portland Group Inc.

PostPosted: Tue Mar 14, 2006 4:59 pm    Post subject: Reply with quote

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
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group