Compiler
Re: Compiler
The most recommended approach here is to use a cross compiler. Check out the wiki tutorial on how to build one: GCC_Cross-Compiler
Re: Compiler
But i'd like to use a ready compiler like djgpp or cygwin,because i'm starting the OS dev now .Where can i download a version of djgpp with the djgpp.env file?
Re: Compiler
You really shouldn't. You can get away with it, yes, but the effort and pain involved far outweighs having to wait for a while (during which you can be coding away!) for a cross-compiler to build. Just install Cygwin and do what the wiki page tells you to, because it's much simpler.Atom wrote:But i'd like to use a ready compiler like djgpp or cygwin
Also, while you're doing the cross-compilation, you can laugh at the "make [5]" messages for binutils. Yes, that's six levels of nested make. And it runs ./configure once per program. Ouch.
Re: Compiler
Unless you're aiming for a different target platform I see no reason to bother building a cross compiler. When I'm compiling for i386 I have used the standard gcc that came with my linux distribution for quite some time now and I've seen no reason to change it...
Re: Compiler
Hello,
There is no "best" compiler. Besides, you may need more then a complier to build anything complex. A better question would have been "what is the best toolchain" but even that falls short as there is no "best" anything.
Use whatever toolchain that best suits you. Later on you will want to make your system self hosting anyways. For now just use whats best for you - djgpp, gcc, msvc, or build a cross-compiler if needed.
There is no "best" compiler. Besides, you may need more then a complier to build anything complex. A better question would have been "what is the best toolchain" but even that falls short as there is no "best" anything.
Use whatever toolchain that best suits you. Later on you will want to make your system self hosting anyways. For now just use whats best for you - djgpp, gcc, msvc, or build a cross-compiler if needed.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: Compiler
Yay...skyking wrote:Unless you're aiming for a different target platform I see no reason to bother building a cross compiler. When I'm compiling for i386 I have used the standard gcc that came with my linux distribution for quite some time now and I've seen no reason to change it...
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Re: Compiler
So let me iterate for the umpteenth time:skyking wrote:Unless you're aiming for a different target platform I see no reason to bother building a cross compiler.
- a cross-compiler will not accept the #include of host platform headers, giving you a clear message about "file not found" instead of unresolved linker references.
- a cross-compiler will not silently link any host platform binaries.
- a cross-compiler will not silently compile in any dependencies on host platform runtime binaries (mostly a Windows problem, but there you are).
- a cross-compiler is the first step towards a native toolchain, i.e. you have to make this step sooner or later anyway.
- a cross-compiler is build from vanilla sources, making it possible for others to reproduce your exact build environment.
- a cross-compiler is what most people here use; if you encounter toolchain problems down the road (like problems with leading underscores etc.), the first thing you will be told (again) is to build a cross-compiler.
Every good solution is obvious once you've found it.
Re: Compiler
I'm not sure whether it's that trivial. I've tried building GNU/open source/Linux stuff from sources, and it's always a big pain in the butt to configure everything correctly and get it to compile. Although I agree that sooner or later one probably needs a cross-compiler, for early development I see no harm in using the vanilla GCC on Linux, as long as one is aware of all the dangers you list.Solar wrote:Bottom line: You are of course free to do and use whatever you want, but we will continue to strongly suggest building a cross-compiler, and suggesting otherwise is generally not considered helpful. Especially since it's a trivial thing to build one.
JAL
- 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: Compiler
And we all know that doesn't want to happen...jal wrote:as long as one is aware of all the dangers
Re: Compiler
True, true. But in my experience, those that are not aware of them seldomly manage to even copy a tutorial let alone build a cross compiler, and start asking stupid questions anyway.Combuster wrote:And we all know that doesn't want to happen...jal wrote:as long as one is aware of all the dangers
JAL