GNU ld on OS X

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.
Post Reply
ehird
Member
Member
Posts: 214
Joined: Thu Mar 15, 2007 8:48 am

GNU ld on OS X

Post by ehird »

Going through "BareBones", I saw I needed binutils. So, I installed it via MacPorts.

But it doesn't include gas or gld. I used the nasm version of the loader, but what about the ld script? "ld" on OS X is a Mach-O OS X binary thing, that works totally different.

I'm not sure why the package doesn't include them, actually.
urxae
Member
Member
Posts: 149
Joined: Sun Jul 30, 2006 8:16 am
Location: The Netherlands

Post by urxae »

Most people use a cross-compiled toolchain for OS development. (There's a section for binutils on that page)
ehird
Member
Member
Posts: 214
Joined: Thu Mar 15, 2007 8:48 am

Post by ehird »

Yes, sounds like a good idea. Though, a question - on a 2.16ghz core 2 duo cpu with 1gb of ram, will the gcc compile be a slow one? I imagine it'll take some time, but hopefully not too long...
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

urxae wrote:Most people use a cross-compiled toolchain for OS development. (There's a section for binutils on that page)
That's what I did and it worked for me. Just download the binutils source and follow the instructions on the wiki...
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

ehird wrote:Yes, sounds like a good idea. Though, a question - on a 2.16ghz core 2 duo cpu with 1gb of ram, will the gcc compile be a slow one? I imagine it'll take some time, but hopefully not too long...
On a 2.33 GHz Core 2 Duo with 2 GB of RAM, compiling GCC and binutils took maybe 15 minutes altogether, maybe less.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
ehird
Member
Member
Posts: 214
Joined: Thu Mar 15, 2007 8:48 am

Post by ehird »

Oh cool. I'll go do that then.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

ehird wrote:Yes, sounds like a good idea. Though, a question - on a 2.16ghz core 2 duo cpu with 1gb of ram, will the gcc compile be a slow one? I imagine it'll take some time, but hopefully not too long...
hehe, I've done it on a P2 @ 400mhz and it doesn't take a "very" long time.. have patience.. 8)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
ehird
Member
Member
Posts: 214
Joined: Thu Mar 15, 2007 8:48 am

Post by ehird »

Yeah, it finished really quickly and works.

Now I'm trying to get a bootable floppy, just to make me feel as if i'm way further than I am ;)
Post Reply