Fedora Linux Support Community & Resources Center
  #1  
Old 25th July 2005, 05:23 PM
sivaram_swdw Offline
Registered User
 
Join Date: May 2005
Posts: 13
Static linking issue with glibc

Hey folks,

I am trying to run one C program which makes use of several header files. In the makefile we have set the following option:
LDFLAGS += -static

We want all the libraries to be linked statically.
But we are getting the following warnings when we try to make the file

midas-1.9.5/linux/lib/mfe.o femagic.o magic_box.o camacnul.o ../../midas-1.9.5/linux/lib/libmidas.a -lpthread -static -lm -lz -lutil -lnsl -pg
../../midas-1.9.5/linux/lib/libmidas.a(midas.o)(.text+0x1072b): In function `rpc_server_callback':
src/midas.c:12173: warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../../midas-1.9.5/linux/lib/libmidas.a(midas.o)(.text+0x3d79): In function `rpc_client_connect':
src/midas.c:8575: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking


We thought that its just warning message and continue to run the program but its getting crashed. But when we commented out the LDFLAGS += -static statement in the Make file and then rerun the make and run the program then its working fine without any problem.

Does anyone have suggestions regarding this.

Thanks in advance,
Ram.
Reply With Quote
  #2  
Old 25th July 2005, 06:37 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,936
I don't do static linking but your question made me curious and I found:
http://www.gnu.org/software/libc/FAQ.html#s-2.22
It's rather suprising to me that -static doesn't really give a completely static executable. According to the web this suprises many. For example:
http://groups-beta.google.com/group/...4b2b7f639d812c
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #3  
Old 27th July 2005, 12:30 PM
sivaram_swdw Offline
Registered User
 
Join Date: May 2005
Posts: 13
Hi Tashir,

Thank you for your suggestion, I'll keep looking on your suggestions.

Cheers,
Ram.
Reply With Quote
Reply

Tags
glibc, linking, static

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
glibc-common issue on x86_64 PinGUIWin Using Fedora 8 22nd August 2009 10:51 AM
gcc 4.1 static linking deeloke Fedora Core 5 - Dev 0 30th April 2007 03:25 PM
"yum install glibc-devel" = Error: glibc-common conflicts with glibc < 2.3.6 nat101l Using Fedora 22 10th November 2005 06:16 PM
static linking pthread lib afeick Programming & Packaging 10 4th November 2005 01:18 PM
glibc issue? spatula Fedora Core 4 Test 3 19th April 2005 08:33 AM


Current GMT-time: 08:04 (Friday, 18-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat