i686-pc-cygwin to i386-pc-elf cross-compiler...
i686-pc-cygwin to i386-pc-elf cross-compiler...
This is driving me nuts.
For four days (!) now, I've been trying to build a gcc 3 cross-compiler toolchain that would allow me to build ELF binaries under Cygwin.
I'm asking, has anybody of the people here done this already, or knows someone who has?
Please don't point me to the countless tutorials and mailing lists explaining how to build cross-compilers in general, I feel like I've seen them all. Has someon eactually built a Cygwin-to-ELF gcc >= 3.2 cross-compiler?
For four days (!) now, I've been trying to build a gcc 3 cross-compiler toolchain that would allow me to build ELF binaries under Cygwin.
I'm asking, has anybody of the people here done this already, or knows someone who has?
Please don't point me to the countless tutorials and mailing lists explaining how to build cross-compilers in general, I feel like I've seen them all. Has someon eactually built a Cygwin-to-ELF gcc >= 3.2 cross-compiler?
Every good solution is obvious once you've found it.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
first, its not a cross compiler.
all you need to do is rebuild binutils from source
search this forum fsor cygwin + elf.
all you need to do is rebuild binutils from source
search this forum fsor cygwin + elf.
-- Stu --
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
That's good advice but gives me three posts: Yours above, and two of my own... :-/df wrote: search this forum fsor cygwin + elf.
Every good solution is obvious once you've found it.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
Thanks, I'll give it a try.
Every good solution is obvious once you've found it.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
http://www.pro-pos.org/index.php/HowToCrossCompile.
Tested to work with gcc-3.2.3 and gcc-3.3 (both binutils-2.14).
Thanks for the help!
Tested to work with gcc-3.2.3 and gcc-3.3 (both binutils-2.14).
Thanks for the help!
Every good solution is obvious once you've found it.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
i'm running 3.2.3 and didnt have to do those patches you wrote of.. very strange...
secondly, its not a cross compiler, its just rebuilding binutils.
crosscompiling is when your on say x86 and you have compiled gcc to output PPC or ALPHA etc.
secondly, its not a cross compiler, its just rebuilding binutils.
crosscompiling is when your on say x86 and you have compiled gcc to output PPC or ALPHA etc.
-- Stu --
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
Not quite. Crosscompiling is the fine art of compiling for another platform than the host platform. I.e. you can (theoretically) crosscompile a Linux x86 app on a Windows (x86) machine.df wrote: crosscompiling is when your on say x86 and you have compiled gcc to output PPC or ALPHA etc.
From http://www-public.tu-bs.de:8080/~y00185 ... node5.html
Cross compiling is the procedure for building a program for a platform different from the one on which the cross compiler runs. "Platform" does not only mean the hardware architecture but also software platforms, e.g. the process for building the GNU/Hurd operating system from sources on a running Linux for the same hardware architecture is also a (sic!) cross compiling.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
Of course, if you aren't building more than binutils, you don't have to patch gcc sources...df wrote: i'm running 3.2.3 and didnt have to do those patches you wrote of.. very strange...
secondly, its not a cross compiler, its just rebuilding binutils.
Crosscompile is when --host (i686-pc-cygwin) != --target (i586-pc-elf).crosscompiling is when your on say x86 and you have compiled gcc to output PPC or ALPHA etc.
Every good solution is obvious once you've found it.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
This isn't really a cross-compile is it? More of a "cross-link"? Because all you're doing is linking existing object code into a different form of executable. You're not compiling for a different target machine, i.e. with new headers, not machine code, etc. Just linking a little differently into an elf instead of a pe...
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
Let me reiterate.bkilgore wrote: This isn't really a cross-compile is it? More of a "cross-link"? Because all you're doing is linking existing object code into a different form of executable. You're not compiling for a different target machine, i.e. with new headers, not machine code, etc. Just linking a little differently into an elf instead of a pe...
Crosscompiling = compiling a source X on a different platform Y than the intended target platform Z.
A platform is not the same thing as the target CPU. Examples of platforms follows below.
1. Windows on x86
2. Linux on x86
3. Linux on PPC
4. NetBSD on MIPS
5. FreeBSD on x86
Do note that x86 is listed three times and Linux twice. I'll even throw in a sixth platform to get the ball rolling around here; Java.
Now, you might argue that Solar's compiler isn't a cross-compiler since it is hosted on Windows/x86 and targets...just x86 since there's no OS in place yet, but I wouldn't as I'd consider plain, vanilla x86 with or without a BIOS a platform.
As always, it all boils down to a few definitions.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
You made my point exactly...you said it's compiling for a different platform. My point is that changing the target of a link does not in any way influence the compilation of machine code.DevL wrote: Let me reiterate.
Crosscompiling = compiling a source X on a different platform Y than the intended target platform Z.
Now, if you were going to build an ELF that would actually run on linux, instead of a PE that would run on windows, this would definitely be a cross-compile, even if they're both x86, because this would involve a different compilation, with different header files, different code, etc.
But to link the same object code into a different executable format is not cross-compiling.
Since there really is no intended target "platform" (as we're builing our own platform), you can't say linking to an elf in this case is compiling it for linux any more than linking it to pe was compiling it to run on windows. Either way the "target platform" is our own operating system. And since neither the target platform, nor the target machine architecture, is different, you can't consider it a cross-compile even under those definitions.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
The problem is that I'm working with C++. And if I compile C++ with a compiler that targets PE, I get different output than with a compiler that targets ELF.
(Hint: Exception handling, templates, all the juicy stuff.)
Of course I could fix the linker scripts to correctly turn PE object files into ELF binaries... I think.
But those linker scripts would no longer be compatible to someone trying to compile the same stuff under Linux... unless that dude first builds a compiler targeting PE, and *that* would be sick, wouldn't it?
/usr/bin/g++ produces different code than /usr/cross/bin/g++, and in my book, that's a cross-compiler.
But does it make sense picking on words? It works.
(Hint: Exception handling, templates, all the juicy stuff.)
Of course I could fix the linker scripts to correctly turn PE object files into ELF binaries... I think.
But those linker scripts would no longer be compatible to someone trying to compile the same stuff under Linux... unless that dude first builds a compiler targeting PE, and *that* would be sick, wouldn't it?
/usr/bin/g++ produces different code than /usr/cross/bin/g++, and in my book, that's a cross-compiler.
But does it make sense picking on words? It works.
Every good solution is obvious once you've found it.
Re:i686-pc-cygwin to i386-pc-elf cross-compiler...
And that's all that counts. Guess it's mw having a thing for semantics.Solar wrote: But does it make sense picking on words? It works.
@bkilgore
Interesting and valid points. We're not 100% in agreement, but I do see your point.