OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Aug 17, 2017 9:26 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: ___udivdi3
PostPosted: Tue Feb 21, 2017 6:52 pm 
Offline
Member
Member

Joined: Mon Feb 02, 2015 7:11 pm
Posts: 228
Link with libgcc.a. Someone explained it above.

You can find where it is with GCC:

Code:
gcc $(CFLAGS) -print-file-name=libgcc.a

_________________
https://github.com/kiznit/rainbow-os


Top
 Profile  
 
 Post subject: Re: ___udivdi3
PostPosted: Tue Feb 21, 2017 9:09 pm 
Offline
Member
Member
User avatar

Joined: Mon Feb 22, 2016 4:40 am
Posts: 39
Location: United Kingdom
kzinti wrote:
Link with libgcc.a. Someone explained it above.

You can find where it is with GCC:

Code:
gcc $(CFLAGS) -print-file-name=libgcc.a


I try linking against libgcc with "-lgcc" and I get the following:

Code:
/usr/local/lib/gcc/i686-elf/6.3.0/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/usr/local/lib/gcc/i686-elf/6.3.0/../../../../i686-elf/bin/ld: cannot find -lstdc++
/usr/local/lib/gcc/i686-elf/6.3.0/../../../../i686-elf/bin/ld: cannot find -lm
/usr/local/lib/gcc/i686-elf/6.3.0/../../../../i686-elf/bin/ld: cannot find -lc


What am I doing wrong? Why is it trying to pull in stdc++? I've passed "-nostdlib" and "-ffreestanding", so I don't see why this is happening.

EDIT: I've fixed it. Linker arguments were backwards.

_________________
Current developing Tupai, a monolithic x86 operating system
http://zesterer.homenet.org/projects.shtml


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group