LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-04-2010, 12:08 AM   #1
dar_beh_dar
LQ Newbie
 
Registered: Aug 2006
Distribution: Fedora
Posts: 21

Rep: Reputation: 1
Determining GCC, binutils and libc version compatibility


Hi everyone,

this questions pertains mainly to building a brandnew GNU toolchain on one machine for deployment on fs of another machine that has no toolchain installed.

I understand the machine on which GNU toolchain is going to be built as the 'build' machine.

I understand the machine on which GNU toolchain is going to be deployed as the 'host' machine.

I understand the machine on which the code generated by the new GNU toolchain is going to be run as the 'target' machine.

Q1.) Is there a fixed 'rule', 'matrix' or 'table' somewhere which
tells me exactly which versions of 'binutils' and 'libc' are
required by a particular version of GCC? I.e. something along the
lines of:

- gcc ver.'k' can be built using gcc ver.'m'(or later)
with binutils ver.'i' and libc ver. 'j'
- gcc ver.'k' will operate with binutils ver.'t' and libc
ver.'r'(or later)

Is there some 'rule of thumb' / 'heuristics' giving me the above
version requirements for the building and operating GCC, or is this
information somehow implied or derived systematically. Where can I
find more about the above?


Q2) I assume that the libraries have no dependencies on any
underlying software other than the system calls provided by the
kernel. Furthermore it appears that the libraries are not too
sensitive about the kernel version they run on ( I found this out
from experience ). Therefore I could build the libraries on some
build machine and place them on the bare naked newly set up host
file system without regard to any other prerequisite SW
components?

Q3) During operation, do GCC and its various components place system
calls directly to the kernel or via library calls (or both)? In
other words I am trying to understand conceptually if GCC requires
'Glibc' for its own operation or not?

Q4) During operation, do the 'binutils' components place system calls
directly to the kernel or via library calls (or both)? In other
words I am trying to understand conceptually if the 'binutils'
require 'Glibc' for their operation or not?

( Of course it is clear to me that when GCC is operating it will need
libraries and headers to resolve object references in the target code
it produces, but that would be a >different< question )

I appreciate your feedback

Regards

dar_beh_dar
 
Old 04-04-2010, 12:16 AM   #2
bcwagne
Member
 
Registered: Feb 2008
Distribution: Debian Testing
Posts: 169

Rep: Reputation: 32
I'm afraid I can't answer your questions, but reading up at linuxfromscratch.org may help. Good luck!
 
Old 04-04-2010, 03:15 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
May be tell, which Linux you intend to use for
building a tool chain. Often it is easier to set
up a copy of the destination OS on a spare partition,
or a spare HD.
And please tell, what is the destination Linux.

Q3 - Q4 : The kernel is mainly about hardware.
http://en.wikipedia.org/wiki/Kernel_%28computing%29
.....
.....

ls /lib/libdl*
.. and others will show the glibc version.

ls /usr/lib/libbfd*
..or libopcodes* .. will usually id the binutils version.

cat /proc/version
may tell the kernel version and id the used compiler ( gcc ).
.....

Last edited by knudfl; 04-04-2010 at 03:17 AM.
 
Old 04-04-2010, 09:53 PM   #4
dar_beh_dar
LQ Newbie
 
Registered: Aug 2006
Distribution: Fedora
Posts: 21

Original Poster
Rep: Reputation: 1
Thanks to the members who have supplied responses so far.

My question does not pertain to a particular HW or configuration.

I am after a general conceptual answer to the following question:

* Given a brandnew LINUX filessystem, what applications ( apart from the shell ) need to be present or installed >before< you can install the GNU toolchain?

The libraries seem to have no dependencies on anything else. In practice I have managed to install a given library version on several different versions of the kernel. So the kernel version determines the libc version somewhat loosely.

* Within the GNU toolchain it is interesting to know if the binutils components need libraries to function? Stupid but important conceptual question.

* Same for the compiler collection ( GCC ). Do any of its components rely on underlying libc services? Or do they invoke kernel services directly?

* Finally: How does one determine which version of gcc goes with which version of binutils and which version of libc? Is there a specific relationship/rule which dictates which versions of gcc, binutlis and libc work together or is the selection of version numbers for the gcc, binutlis and libc toolchain components based on experience / trial & error or even some heuristics or rule of thumb?

I have my own thoughts on this. However coming out in the forum with this question serves as sort of a consultation with other forum members to see what other ( perhaps more experienced and knowledgeable ) LINUX community members think.

Thanks again for the answers supplied so far.
 
Old 04-05-2010, 04:26 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
See LFS for build instructions, ref. post # 2.
http://archive.linuxfromscratch.org/lfs-museum/

Requirements to build a tool chain, etc. :
LFS, Minimum ""Host System Requirements""
http://archive.linuxfromscratch.org/.../hostreqs.html
I.e. all twenty "packages".

Most questions will be answered by reading the LFS books :
Which version is required for which version, etc. etc.

And better read about what a kernel is and does.
Objects that are build with gcc will depend on the version
of glibc ( or a later version ) used at build time.


Unless you understand it all in depth, you will not
be able to build a tool chain for another Linux.
The recommended way is to build LFS ( a couple of times ).
And then later move on to CLFS, Cross Linux From Scratch.
To find out, how all things are connected.
.....
 
Old 04-05-2010, 11:14 PM   #6
dar_beh_dar
LQ Newbie
 
Registered: Aug 2006
Distribution: Fedora
Posts: 21

Original Poster
Rep: Reputation: 1
Hi knudfl,

thanks for your feedback. I think your reference to the LFS project helped to answer my question.

There does not seem to be a 'rule' for matching up verions of the GNU toolchain components. It is simply heuristics. Good.

However the PDF book for each of the LFS versions has two sections:

* Host System Requirements
* All Packages

If one looks up the PDF books from all of the LFS versions, one should be able to compile a matrix of what GCC, binutlis and libc versions go together.

That could serve as starting point.


However one of my questions remains unanswered still...perhaps because it was not suitably formulated.

I am still intrigued to know:

i) whether the 'binutils' components actually need to use the system C libraries or if they actually place system calls directly ( that would determine which headers to use in order to build them, amongst other things ).

ii) whether the 'gcc' components actually need to use the system C libraries or if they actually place system calls directly ( that would determine which headers to use in order to build it amongst other things ).

Thanks again for your tip though


Regards

dar_beh_dar
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
prblem with gcc libc.so.6 maaaaarco Linux From Scratch 3 12-13-2009 01:54 PM
Determining the version .. kshkid Linux - Newbie 2 02-10-2007 03:25 AM
GCC 3.4.3 libc.so error trainpic Linux From Scratch 3 03-09-2006 02:54 PM
gcc i686 libc xiaoyuer18 Linux - Distributions 0 10-12-2005 05:19 PM
libc version??? slack66 Slackware 3 07-07-2004 04:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:08 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