Am I using the right gcc build?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Am I using the right gcc build?

Post by sortie »

Hi boemba,

You really need to learn to follow instructions carefully. You are making a sea of silly beginner mistakes because you didn't follow them exactly as well as understanding what it is going on.

You need to download the source code for binutils and gcc (as well as other dependencies that you usually don't need to build, but we do it here to be certain it works if your environment is unusual, and it is since you use Cygwin rather than a real Unix operating system). Put the optional dependencies for gcc inside the gcc source code directory (renamed so they don't have the version numbers). You want to build binutils and gcc outside of the build directory (this is recommended by the projects), which is why we have build-binutils and build-gcc directories for that purpose. You need to attach these build directories to the source directory, which is why we use the ./configure script from the source code directory. Since we are not in the source code directory, we need to invoke the configure script using an relative or absolute path to it. Since the version number is part of the source code directory's name and new versions occasionally come along, we just say x.y.z and you are meant to replace that by whatever version you are using, that is, the relative path to the binutils source directory. In your screenshot, you clearly see the shell couldn't find the configure script you were trying to invoke. Instead, you ignored that error, tried running Make and complained about a missing makefile rather than the fact that a previous command failed. You cannot assume you can continue to run future commands if the current one failed.

At least, I'll have to commend you for including screenshots (though pastebin pastes are preferred in most cases) so we know exactly what is on your screen, rather than what you think you see.

Edit: Oh, additionally, binutils is not part of the GMP project. You'll want to get it from the GNU ftp site. Indeed, binutils doesn't even use libgmp.
boemba
Posts: 9
Joined: Fri Mar 14, 2014 12:55 pm

Re: Am I using the right gcc build?

Post by boemba »

sortie wrote:Hi boemba,

You really need to learn to follow instructions carefully. You are making a sea of silly beginner mistakes because you didn't follow them exactly as well as understanding what it is going on.

You need to download the source code for binutils and gcc (as well as other dependencies that you usually don't need to build, but we do it here to be certain it works if your environment is unusual, and it is since you use Cygwin rather than a real Unix operating system). Put the optional dependencies for gcc inside the gcc source code directory (renamed so they don't have the version numbers). You want to build binutils and gcc outside of the build directory (this is recommended by the projects), which is why we have build-binutils and build-gcc directories for that purpose. You need to attach these build directories to the source directory, which is why we use the ./configure script from the source code directory. Since we are not in the source code directory, we need to invoke the configure script using an relative or absolute path to it. Since the version number is part of the source code directory's name and new versions occasionally come along, we just say x.y.z and you are meant to replace that by whatever version you are using, that is, the relative path to the binutils source directory. In your screenshot, you clearly see the shell couldn't find the configure script you were trying to invoke. Instead, you ignored that error, tried running Make and complained about a missing makefile rather than the fact that a previous command failed. You cannot assume you can continue to run future commands if the current one failed.

At least, I'll have to commend you for including screenshots (though pastebin pastes are preferred in most cases) so we know exactly what is on your screen, rather than what you think you see.

Edit: Oh, additionally, binutils is not part of the GMP project. You'll want to get it from the GNU ftp site. Indeed, binutils doesn't even use libgmp.
Thanks for your reply,
Edit: Oh, additionally, binutils is not part of the GMP project. You'll want to get it from the GNU ftp site. Indeed, binutils doesn't even use libgmp.
Thanks for pointing that out, I downloaded the right binutils now.

I was following this tutorial: http://wiki.osdev.org/GCC_Cross-Compiler which did NOT tell me to change x.y.z to the version number. I simply assumed it would be some script of some sort.
I changed it to the binutils folder I downloaded, but then I get the following error:
Image

Yes, I know I probably have to set some environment variable, but what is environment variable CC?
I searched for "CC" in the binutils folder to look if I had to set an environment variable to there but couldn't find any folder or something.

Sorry for my beginner mistakes but I can't help them :/

Also I wonder why it tries to configure i686 when I specified TARGET to be i585?
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: Am I using the right gcc build?

Post by madanra »

boemba wrote:Yes, I know I probably have to set some environment variable, but what is environment variable CC?
'CC' stands for C compiler. Typically it would be set to gcc, though once you've built your cross compiler and are using it to build your OS, you'd probably set it to i586-elf-gcc.
boemba wrote:Also I wonder why it tries to configure i686 when I specified TARGET to be i585?
In the screenshot you posted, it says it's configuring for a host of i686-pc-mingw32 - which is correct. Have a look at Target Triplet, particularly the Rationale section. The build platform and host platform are Windows (i686-pc-mingw32), and the target platform is your OS (i586-elf).
User avatar
hometue
Member
Member
Posts: 100
Joined: Thu Dec 19, 2013 1:40 am
Location: Asia, Singapore

Re: Am I using the right gcc build?

Post by hometue »

Hey boemba, just curious , how familiar are you with linux commands or linux stuff as a whole? (you know what they do and how to use them, well...at least most, I doubt you can use tar command without looking at the help. Just something to laugh at and maybe understand what I meant. And I am just curious, don't take offense by this question, I can't say I am much better anyway.)
CookieOS. Want a cookie? Its only black and white for now though, probably as bad as my baking skills.
boemba
Posts: 9
Joined: Fri Mar 14, 2014 12:55 pm

Re: Am I using the right gcc build?

Post by boemba »

hometue wrote:Hey boemba, just curious , how familiar are you with linux commands or linux stuff as a whole? (you know what they do and how to use them, well...at least most, I doubt you can use tar command without looking at the help. Just something to laugh at and maybe understand what I meant. And I am just curious, don't take offense by this question, I can't say I am much better anyway.)
Close to not familiar.
Guess it's time to dive more into the linux commands and terminal.
Post Reply