cross gcc
cross gcc
Hello,
I've download cygwin and all the sources required and created ?? a cross compiler by doing what is said here:
http://www.osdev.org/osfaq2/index.php/GCC%20Cross-Compiler
Now, I've got a /usr/src/build-gcc dir with:
/gcc
Here I have a lot of .exe files that look like a gcc version for windows, but they all require cygwin1.dll.
/i586-elf
This is empty?
My main aim is to make a native win32 gcc that produces linux files. Can anyone pleas help me?
I've download cygwin and all the sources required and created ?? a cross compiler by doing what is said here:
http://www.osdev.org/osfaq2/index.php/GCC%20Cross-Compiler
Now, I've got a /usr/src/build-gcc dir with:
/gcc
Here I have a lot of .exe files that look like a gcc version for windows, but they all require cygwin1.dll.
/i586-elf
This is empty?
My main aim is to make a native win32 gcc that produces linux files. Can anyone pleas help me?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:cross gcc
cygwin program require to be started through the cygwin shell, iirc ...
btw, can you locate some "ld.exe" ? and what does "ld --help" report as "supported targets" ?
btw, can you locate some "ld.exe" ? and what does "ld --help" report as "supported targets" ?
Re:cross gcc
ld --help:
...
ld: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec tekhex binary ihex
ld: supported emulations: i386pe
ld: emulation specific options:
i386pe:
...
Is that good? Why do I need to start it from cygwin? Can't I remove the dependencies?
...
ld: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec tekhex binary ihex
ld: supported emulations: i386pe
ld: emulation specific options:
i386pe:
...
Is that good? Why do I need to start it from cygwin? Can't I remove the dependencies?
Re:cross gcc
If you really followed the FAQ document (i.e., ran 'make install'), the executables and binaries should be in /usr/cross. At this point, you could delete /usr/src/build-*.Now, I've got a /usr/src/build-gcc dir with...
You don't have to start it from Cygwin (or rather, the bash shell provided by Cygwin), but you need the Cygwin.dll in your system because the build process linked against it.Why do I need to start it from cygwin?
There is an option in Cygwin's GCC somewhere ("--no-cygwin"?) which allows linking against the Microsoft runtime instead, which in fact does create native Windows applications that no longer require the Cygwin.dll.
That's of interest for people who do not want to place whatever they compiled under terms of the GPL (since the Cygwin.dll is GPL, and thus everything that links to it) - but your cross-GCC is GPL, anyway.
The other interest is if you'd like to distribute binaries to people who don't have the Cygwin.dll... but then, you could just wrap up the Cygwin.dll alongside your GCC binaries. It's redistributable, you know?
Not postscriptum, no. But you could try to build a GCC that is linked against the Windows runtime. I haven't tried that, though, and thus can't help you. I'd be interested in the results, though.Can't I remove the dependencies?
Every good solution is obvious once you've found it.
Re:cross gcc
You just tested your system ld. (The one that came with Cygwin.) You'd have to run /usr/src/build-gcc/gcc/.../ld.exe...GernotFrisch wrote: ld --help:
Every good solution is obvious once you've found it.
Re:cross gcc
My /usr/cross is quite empty:
\usr\cross\i586-elf
\usr\cross\lib
\usr\cross\i586-elf\sys-include
\usr\cross\i586-elf\sys-include\config.temp
\usr\cross\i586-elf\sys-include\COPIED
\usr\cross\i586-elf\sys-include\i586-elf
\usr\cross\lib\gcc-lib
\usr\cross\lib\gcc-lib\i586-elf
\usr\cross\lib\gcc-lib\i586-elf\3.3.1
(\ is /, I used the dos-dir to list it)
I don't have a ln.exe in my /usr/src/build-gcc/gcc directory. So, somehting must have gone wrong, huh? I think I will run the whole process in a bash file and put the output in a file. Maybe it's better for you to see the error then?
Thanks a very lot for at least talking to me about this topic. This is my 3rd attempt to do this. This time I have the feeling of beeing --><-- that close to it...
\usr\cross\i586-elf
\usr\cross\lib
\usr\cross\i586-elf\sys-include
\usr\cross\i586-elf\sys-include\config.temp
\usr\cross\i586-elf\sys-include\COPIED
\usr\cross\i586-elf\sys-include\i586-elf
\usr\cross\lib\gcc-lib
\usr\cross\lib\gcc-lib\i586-elf
\usr\cross\lib\gcc-lib\i586-elf\3.3.1
(\ is /, I used the dos-dir to list it)
I don't have a ln.exe in my /usr/src/build-gcc/gcc directory. So, somehting must have gone wrong, huh? I think I will run the whole process in a bash file and put the output in a file. Maybe it's better for you to see the error then?
Thanks a very lot for at least talking to me about this topic. This is my 3rd attempt to do this. This time I have the feeling of beeing --><-- that close to it...
Re:cross gcc
Goofed up somewhere, most likely your 'make all-gcc install-gcc' failed while halfway through the installation part.GernotFrisch wrote: My /usr/cross is quite empty...
Sounds like a plan. But since I know GCC make generates a lot of output, feel free to mail it to [email protected] (my mail address), instead of putting it on the forum.I think I will run the whole process in a bash file and put the output in a file. Maybe it's better for you to see the error then?
Hey! I wrote the page, so I should be worrying if it doesn't help people, right?Thanks a very lot for at least talking to me about this topic.
Every good solution is obvious once you've found it.
Re:cross gcc
Since I was responsible for the amd64 part (the cross part) you could mail me a bz2 or gz of the output too.
Just wondering, did you make & install a 64-bit binutils already? GCC doesn't do much without it.
Just wondering, did you make & install a 64-bit binutils already? GCC doesn't do much without it.
Re:cross gcc
Candy, unless I'm mistaken, and judging from him having a directory "i586-elf", he's going for the generic part of the how-to only...
Every good solution is obvious once you've found it.
Re:cross gcc
err... Doh, I hate questions I don't even understand. Well, what I want is:
Make a gcc compiler chain (that is from .cpp to executable program, I hope) that runs on win32 and outputs a linux binary for the 2.4 kernel, 32 bit.
Does that anser the question?
Make a gcc compiler chain (that is from .cpp to executable program, I hope) that runs on win32 and outputs a linux binary for the 2.4 kernel, 32 bit.
Does that anser the question?
Re:cross gcc
In that case, our Wiki is the wrong place, I'm afraid, as it stops well short from actually building a full cross-compiler. A full cross-compiler has standard C library headers, and spits out ready-to-run executables; building such a thing takes multiple stages, including getting the target runtime (which basically requires having a functional Linux box at hand).
The cross-compiler mentioned in our Wiki only completes the first stage, which is enough to build kernel binaries, but does not suffice for executables.
Sorry, I overlooked the Linux part - or took it for a typo, as many people think that ELF <=> Linux files.
A quick search-of-the-web gave me http://www.xraylith.wisc.edu/~khan/soft ... -howto.txt - perhaps that will help you.
The cross-compiler mentioned in our Wiki only completes the first stage, which is enough to build kernel binaries, but does not suffice for executables.
Sorry, I overlooked the Linux part - or took it for a typo, as many people think that ELF <=> Linux files.
A quick search-of-the-web gave me http://www.xraylith.wisc.edu/~khan/soft ... -howto.txt - perhaps that will help you.
Every good solution is obvious once you've found it.
Re:cross gcc
*retreats back into his cave... different type of cross*GernotFrisch wrote: err... Doh, I hate questions I don't even understand. Well, what I want is:
Make a gcc compiler chain (that is from .cpp to executable program, I hope) that runs on win32 and outputs a linux binary for the 2.4 kernel, 32 bit.
Does that anser the question?
Re:cross gcc
Oh. I thought it would be enough to have the binaries and use the actual header files/libraries from my linux distri?
Re:cross gcc
You need the headers (so the compiler knows what functions are available in the runtime), and some of the runtime files (like, startup / shutdown code - the stuff executed before int main() is actually called, and the cleanup stuff called after main() exits).
That's what that other page I linked above tells you how to do.
Our Wiki tells you how to set up a "naked" cross-compiler, one that doesn't have any "runtime" yet because we - as OS developers - have to build that ourselves.
That's what that other page I linked above tells you how to do.
Our Wiki tells you how to set up a "naked" cross-compiler, one that doesn't have any "runtime" yet because we - as OS developers - have to build that ourselves.
Every good solution is obvious once you've found it.
Re:cross gcc
again - the compiler you create can compile:
int main(int, char**)
{
long n=130275;
return n;
}
Can it?
If so, I (hope I) only have to copy my .h and .a files from my running Linux distri into the compiler's include/lib directories and can use it to compile anything just as if it were running on a linux box, no? Does the compiler need to know the .a and .h files when it is about to be created? If so, why?
The link you gave me looks very promising. I will follow it although it means a few sleeples nights, I guess.
int main(int, char**)
{
long n=130275;
return n;
}
Can it?
If so, I (hope I) only have to copy my .h and .a files from my running Linux distri into the compiler's include/lib directories and can use it to compile anything just as if it were running on a linux box, no? Does the compiler need to know the .a and .h files when it is about to be created? If so, why?
The link you gave me looks very promising. I will follow it although it means a few sleeples nights, I guess.