linking question

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.
Meshounah
Member
Member
Posts: 38
Joined: Sun Jun 24, 2007 6:48 pm

Post by Meshounah »

Candy wrote:http://www.osdev.org/wiki/GCC_Cross-Compiler of course.

Make a cross compiler and it will not pretend you're making a program for Windows.
ok i'll check it out :roll:
chik'n
Meshounah
Member
Member
Posts: 38
Joined: Sun Jun 24, 2007 6:48 pm

Post by Meshounah »

are you sure that what i need since none of the beginner tutorials mention it?
chik'n
User avatar
Combuster
Member
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:

Post by Combuster »

There used to be a label saying something like "You are expected to use a cross-compiler" on the wiki. there used to be an FAQ entry telling you to build one once you get references to alloca.

Sadly, the only remaining reference I could find on short notice is on the crosscompiler page itself :(
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Meshounah
Member
Member
Posts: 38
Joined: Sun Jun 24, 2007 6:48 pm

Post by Meshounah »

funny that bona fide os dev tutorial works in linux but not in cygwin :lol:
chik'n
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

Meshounah wrote:funny that bona fide os dev tutorial works in linux but not in cygwin :lol:
A crosscompiler is your best bet. It is compiled for your OS and if you like you can even add your own target to gcc/binutils and have it compile for your OS by default.

Linux tends to be a lot less encumbered with compatibility and legacy stuff than Windows; yet I've run into a few small issues with it that I don't have now with a normal crosscompiler. In most cases you should be fine though.

Cygwin is a small bit different but has a fair chance of working. I think it does add underscores, so it's got at least a few things you need to hack around.

MingW has a lot of different bits, not the least of which is the amount of Windows integration. Don't use it for OS dev (as in, don't even try to).

DJGPP should have died a long time ago. It doesn't even produce code that any normal OS should hope to work in and has too many hacks.
Meshounah
Member
Member
Posts: 38
Joined: Sun Jun 24, 2007 6:48 pm

Post by Meshounah »

ok i have a question though what does a cross compiler do that normal gcc can't(basically can't i just give gcc arguments a produce raw binary?
chik'n
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

Most of the ports of GCC for windows(Cygwin, MingW) don't support compiling to binary or ELF. The only way to compile to binary would be to use a cross compiler.
Meshounah
Member
Member
Posts: 38
Joined: Sun Jun 24, 2007 6:48 pm

Post by Meshounah »

ok thank you
chik'n
Meshounah
Member
Member
Posts: 38
Joined: Sun Jun 24, 2007 6:48 pm

Post by Meshounah »

ok second try to get a compiler going(needed flex) hopefully this work :roll:


didnt work it seemed to make all file but make install failed :cry:
chik'n
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

Meshounah wrote:ok second try to get a compiler going(needed flex) hopefully this work :roll:


didnt work it seemed to make all file but make install failed :cry:
Are you running make install as root, or have you changed the prefix to point to a directory you can write? What is the error it fails on?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

You needed flex? What version of gcc are you compiling? flex/bison requirements were removed as of 4.x.x IIRC...?

JamesM
Post Reply