LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-04-2005, 06:02 PM   #1
spencerbray
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Rep: Reputation: 0
Linux, compiling against alternative c-library


All,

Although I'm not new to programming, I am to the world of Linux programming. The subject of compiling against an alternative c-library such as uClibc is troubling me.

Before anyone says "tool chain", "wrappers" etc I've looked at the them but still have some fundamental questions.

What I'm looking for is an overview of how to point the linking process at an entire library such as uClibc. This raises questions such as:

1) How does the linker know which ld-xx to use?
2) How does the linker know which libc-x to use?

I just need to understand the connection between the linker process and the actual library you require to link against.

Is it just a case of setting some flags? What above telling the linker to use an alternative library do the tool chains and the like actually do? Do I really need to use a tool chain if I want to link to an alternative library for the same platform?

If anyone can fill in some of the gaps for me I would really appreciate it

Spencer
 
Old 02-04-2005, 06:47 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"What I'm looking for is an overview of how to point the linking process at an entire library such as uClibc. This raises questions such as:

1) How does the linker know which ld-xx to use?
2) How does the linker know which libc-x to use?

I just need to understand the connection between the linker process and the actual library you require to link against.

Is it just a case of setting some flags? What above telling the linker to use an alternative library do the tool chains and the like actually do? Do I really need to use a tool chain if I want to link to an alternative library for the same platform?"

You specify all of these things on the gcc command line. I am not sure what a tool chain is. If you are talking about a Program Development Environment then most PDEs will generate the gcc command from information you give the PDE. You don't have to use a PDE and I rarely do.

The best online tutorial for gcc is the GNU gcc tutorial. I just tried it and got connection refused. You can use Google to find other gcc tutorials if gcc.gnu.org doesn't come back any time soon.

http://gcc.gnu.org/onlinedocs/gcc/

-------------------------------
Steve Stites
 
Old 02-06-2005, 05:04 PM   #3
spencerbray
LQ Newbie
 
Registered: Jan 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Steve,

I've had a look at the site and it's more of a manual than tutorial. Are you able to point me in the right direction with some tips?

Thanks

Spencer
 
Old 02-07-2005, 02:09 AM   #4
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
Re: Linux, compiling against alternative c-library

Quote:
Originally posted by spencerbray


1) How does the linker know which ld-xx to use?
<gcc prefix>/lib/gcc-lib/*/*/specs ( for example /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs is where it's at on my system)

in this file (a little ways down, do a search for ld-linux and you'll find it) it has the linker specified

Quote:
Originally posted by spencerbray


2) How does the linker know which libc-x to use?
If you set your LDFLAGS or LD_LIBRARY_PATH to point to the new libs before the linker can find glibc it should work fine.


Last edited by __J; 02-07-2005 at 02:14 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux alternative to the MSDN Library Aphex_Twin2 Linux - General 1 05-17-2005 09:35 AM
cross compiling a shared library baba_gorakhnath Linux - Laptop and Netbook 0 03-10-2005 11:02 PM
Problem compiling programs using ncurses library (gcc 3.2.2 and RH9 default inst.) jclark7777 Linux - Newbie 1 07-20-2004 01:59 PM
Re-compiling PHP with GD library ubers0ldat Linux - Software 1 08-20-2003 02:59 PM
Newbie: Compiling Error - QT Library [New Theme with KDE 3 - SuSE 7.3] pokkkie Linux - Newbie 2 08-19-2002 05:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration