___udivdi3

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.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: ___udivdi3

Post by kzinti »

Link with libgcc.a. Someone explained it above.

You can find where it is with GCC:

Code: Select all

gcc $(CFLAGS) -print-file-name=libgcc.a
User avatar
zesterer
Member
Member
Posts: 59
Joined: Mon Feb 22, 2016 4:40 am
Libera.chat IRC: zesterer
Location: United Kingdom
Contact:

Re: ___udivdi3

Post by zesterer »

kzinti wrote:Link with libgcc.a. Someone explained it above.

You can find where it is with GCC:

Code: Select all

gcc $(CFLAGS) -print-file-name=libgcc.a
I try linking against libgcc with "-lgcc" and I get the following:

Code: Select all

/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
Post Reply