LinuxQuestions.org
Visit Jeremy's Blog.
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 09-27-2004, 12:42 AM   #1
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Rep: Reputation: 38
configuring a cross compiler


Hi,
I recently downloaded the new version of gcc(3.4.2).I want to replace the 3.3 version that I have now.My question is how do I configure it as a cross compiler(is my terminology correct?).What is the difference between a cross compiler and a straight one?Which should be better?If I don't have a compiler loaded on the system,then how do I configure gcc?
ALso, when I downloaded gcc,I also downloaded the g++,ada,java and the other libraries that come along with the release.How do i utilize these?Or does the main pack suffice?Please advise.
 
Old 09-27-2004, 01:57 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
A cross compiler is a compiler running on an architecture (eg. Linux/i386) that builds binaries suitable for another architecture (eg. Solaris/SPARC).
I don't think it is your goal.
 
Old 09-27-2004, 03:05 AM   #3
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
thanks for the info,mate.But my other questino is still unanswered.What do I do with the other packages that come with gcc.Please help
 
Old 09-27-2004, 02:39 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
The answer depends on the distribution you are using, and specially the packaging used.
The simple way is to ask your software/package manager application to first uninstall your previous gcc and then to install the new one, taking care of all the dependancy stuff.
Can't be more specific without more clues about what you have downloaded and on what distro you want to install it.
 
Old 09-29-2004, 12:46 AM   #5
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
Hi,
sorry for missing out on the info.I'm running fedora core2 and I downloaded the gcc 3.4.2 release from the gnu mirror as bzipped files.Again I ask you,will the main gcc package suffice or will I need to install the gcc-core,gcc-ada,gcc-++ and the g77 packages too?Well,the other packs don't come with a configure script or a make file.How do I get about with these?
 
Old 09-29-2004, 02:15 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
You are trying the hard way.

As you certainly know, linux software can be distributed as a package (rpm or other) or as a "blob" (tarballs, bzipped ...).
When you choose the package way, you are lucky that all the dependancies processing, installation and uninstallation tasks are automatically done for you by the installer (it should be yum, yumgui or apt on fedora core).

When you choose the blob option, you are likely to mess up your system by overwriting files and unsynchronizing what your installer thinks is there and what is actually on the disk.

To minimize the risk, better for you to look what gcc packages are currently installed on your PC, uninstall them and then install the matching bzips.

The simpler alternative is to find already built gcc 3.4.2 packages (perhaps on unofficial fedora archives) and work with them.
 
Old 09-29-2004, 02:21 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
Just a few more words,
from your last posting, it seems you are downloading gcc under source form.

This is increasing the complexity of the installation operation, as you cannot uninstall the previous compiler because it is needed to build the new one.

Perhaps one way to overcome that is to configure the new compiler to install itself in a non standard location, so you can have both installed in parallel.
 
Old 09-29-2004, 02:36 AM   #8
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
Thanks for the help jlliagre.i got what you're trying to imply. I know that to make the packages a compiler is required.But what happens when a system is built from scratch,not using pre-compiled binaries?how are the packs installed then?
 
Old 09-29-2004, 02:53 AM   #9
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
The first compiler ever was an assembler written in machine code I'm sure. And then the first C compiler was probably written in assembly...but nowadays I'm sure they just modify a pre-existing compiler to spit out an executable designed for a new system (i.e. cross-compiling).
 
Old 09-29-2004, 02:57 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,795

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
Chicken and egg problem
 
Old 09-29-2004, 03:13 AM   #11
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
Thanks again mate.I hope that your advise will help me a lot on this issue.
Another thing though,do you code in ADA?if you do where did you learn it,coz i heard that it's development has been stopped.How can i learn ADA (maybe thru the net with som tutorials??).i'm sure nobody teaches ADA 'bout my place.
 
  


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
cross compiler alpha_foobar Linux - General 0 08-17-2005 06:15 PM
Cross compiler !!! hiteshmaisheri Linux - Laptop and Netbook 3 03-05-2005 09:51 AM
cross compiler leonora Programming 2 01-08-2005 11:13 AM
Cross compiler help please daveschile Linux - Software 1 04-09-2004 07:24 PM
Cross-compiler for x86-64 ogre7299 Linux - Software 0 10-27-2003 11:27 AM

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

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