Hello,
In page http://wiki.osdev.org/GCC_Cross-Compiler
You can add a 'Yes' to GCC 4.4.0 with binutils 2.17
I also wanted to ask: when building binutils, gcc and newlib... why not remove the --prefix=$PREFIX things?
If you don't precise any prefix the compiler will automatically be installed in /usr/local, which is already in $PATH
Binaries, include files, etc. won't conflict with each other (if building multiple cross compilers) or with an existing gcc because they are installed in /usr/local/(target)/, /usr/local/bin/(target)-gcc/, /usr/local/lib/gcc/(target)/, etc.
I think it would be much simplier to do so, and I think that's the way it should be normally done
GCC Cross-compiler
GCC Cross-compiler
MysteriOS
Currently working on: TCP/IP
Currently working on: TCP/IP
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: GCC Cross-compiler
The prefix is useful in certain situations.
In my case, I have cross-compilers which require support libraries & headers (that I provide), and without the PREFIX it'd be difficult to do that.
If you're just looking for a stock cross-compiler, you don't need the prefix (but it is nice, as you can delete the one directory if you want to remove the compiler rather than navigating a tree of folders).
In my case, I have cross-compilers which require support libraries & headers (that I provide), and without the PREFIX it'd be difficult to do that.
If you're just looking for a stock cross-compiler, you don't need the prefix (but it is nice, as you can delete the one directory if you want to remove the compiler rather than navigating a tree of folders).
Re: GCC Cross-compiler
I admit that, originally, I was afraid to go with the default, as it was very poorly documented just what that default would be - I was unwilling to jeopardize my installation.
And after that, I left the --prefix in the tutorial, because it gives a hint what could be done if you aren't root on the machine, is explicit (I always prefer explicitness over implicit functionality), and is easy to delete-and-redo.
And after that, I left the --prefix in the tutorial, because it gives a hint what could be done if you aren't root on the machine, is explicit (I always prefer explicitness over implicit functionality), and is easy to delete-and-redo.
Every good solution is obvious once you've found it.
Re: GCC Cross-compiler
Oooh - I missed the release of 4.4! [rebuilds cross compiler]
And another "vote" here for leaving --prefix in for the ease of deletion and rebuilding.
Cheers,
Adam
And another "vote" here for leaving --prefix in for the ease of deletion and rebuilding.
Cheers,
Adam
Re: GCC Cross-compiler
I understand the "ease of deletion" argument (thought I don't know why you would delete it )
But like Solar the first time I wanted to create a cross-compiler I thought that without that --prefix argument my newly-compiled GCC would overwrite the one already installed
That seems ridiculous but I was so afraid of this that I was checking several times if I had spelled '--prefix' correctly
Why not a single paragraph saying "The --prefix parameter is optional but we recommand using it" ?
But like Solar the first time I wanted to create a cross-compiler I thought that without that --prefix argument my newly-compiled GCC would overwrite the one already installed
That seems ridiculous but I was so afraid of this that I was checking several times if I had spelled '--prefix' correctly
Why not a single paragraph saying "The --prefix parameter is optional but we recommand using it" ?
MysteriOS
Currently working on: TCP/IP
Currently working on: TCP/IP
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: GCC Cross-compiler
To replace it with a newer version? Update cygwin?I don't know why you would delete it
- Firestryke31
- Member
- Posts: 550
- Joined: Sat Nov 29, 2008 1:07 pm
- Location: Throw a dart at central Texas
- Contact:
Re: GCC Cross-compiler
Or if you realize you misconfigured it.
"D'oh! I forgot to add that one flag that does the thing to the stuff so I can do this to that! Well, there goes 7 hours of work."
"D'oh! I forgot to add that one flag that does the thing to the stuff so I can do this to that! Well, there goes 7 hours of work."
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Re: GCC Cross-compiler
I was wondering why no one has posted a tutorial yet for a native build of gcc and binutils.. It's remarkably easy as
long as you have a good libgloss with your newlib. I think I had to add about 15 new functions to my libgloss to get a
native compiler. And the configure command is pretty straight forward too -> I had to do a bit of research on the net to find out --host was not the computer you were building everything on.
Hope the info below helps someone. I had problems with the gcc that came default with cygwin, so I built a new version for it before I did a native build for my OS.
$BUILD refers to the machine you are currently compiling on.
For binutils:
../binutils-x-x-x/configure --prefix=$PREFIX --target=$TARGET --host=$TARGET --build=$BUILD --disable-nls
For gcc:
../gcc-x-x-x/configure --prefix=$PREFIX --target=$TARGET --host=$TARGET --build=$BUILD --disable-nls --enable-languages=c
While building, binutils and gcc would error out with undefined references. I just added these to my libgloss till it finally finished and installed. Voila, native toolchain
Pretty straight forward, but I'm not volunteering to make a tutorial. Maybe someone could fix this up(and any mistakes) and post it on the wiki. But hopefully this post will help someone out who doesn't know what to do about a native toolchain.
long as you have a good libgloss with your newlib. I think I had to add about 15 new functions to my libgloss to get a
native compiler. And the configure command is pretty straight forward too -> I had to do a bit of research on the net to find out --host was not the computer you were building everything on.
Hope the info below helps someone. I had problems with the gcc that came default with cygwin, so I built a new version for it before I did a native build for my OS.
$BUILD refers to the machine you are currently compiling on.
For binutils:
../binutils-x-x-x/configure --prefix=$PREFIX --target=$TARGET --host=$TARGET --build=$BUILD --disable-nls
For gcc:
../gcc-x-x-x/configure --prefix=$PREFIX --target=$TARGET --host=$TARGET --build=$BUILD --disable-nls --enable-languages=c
While building, binutils and gcc would error out with undefined references. I just added these to my libgloss till it finally finished and installed. Voila, native toolchain
Pretty straight forward, but I'm not volunteering to make a tutorial. Maybe someone could fix this up(and any mistakes) and post it on the wiki. But hopefully this post will help someone out who doesn't know what to do about a native toolchain.
Re: GCC Cross-compiler
Well yes... if you go for Newlib. Porting Newlib would be the Step 2 mentioned in the GCC Cross-Compiler tutorial. Then would come Step 3 (complete cross-compiler), then would come Step 4 (native build).kubeos wrote:I was wondering why no one has posted a tutorial yet for a native build of gcc and binutils.. It's remarkably easy as long as you have a good libgloss with your newlib.
Adding a C library is a point at which the tutorial "forks". Newlib is probably the "easiest" way to go currently, but some might not agree with Newlib because of its licensing, or its OS interface, or its scope, or whatever, and might want to use a different C library...
Every good solution is obvious once you've found it.