GCC Cross-Compiler issue

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
tobbebia
Posts: 17
Joined: Fri Feb 19, 2010 1:49 pm
Location: Sweden

GCC Cross-Compiler issue

Post by tobbebia »

Hi!
I am very new to using GNU tools and doing os deving, so i apologize if the answer to this question is obvious! I have been following some simple os dev tutorials using DJGPP on Windows Vista, but earlier today i decided to install Ubuntu 9.10 (dual boot), and i wanted to make a working GCC Cross-Compiler for i386 target that i can use for os deving.

I followed the tutorial at this link to compile a GCC Cross-compiler:
http://wiki.osdev.org/GCC_Cross-Compiler

... and the AS asm from binutils seems to work, but GCC doesnt.

When i try to compile anything with the gcc cross-compiler i get this error message:

Code: Select all

/usr/cross/libexec/gcc/i386-elf/4.4.3/cc1: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory
Btw I did not forget this before compiling gcc:
(if it even has to do with this)
If you plan to use GCC 4.3.0 or a later version, you will also have to install the following:
GMP (this package is also readily available for MSYS)
MPFR
If I can't get this to work i will have to go back and do os dev on Windows. But linux seems much more intresting to me! :)

So if anyone knows how to fix this it would be very nice!

tobbebia
Last edited by tobbebia on Wed Sep 14, 2011 1:19 pm, edited 1 time in total.
My GitHub account: http://github.com/tobbebia
fronty
Member
Member
Posts: 188
Joined: Mon Jan 14, 2008 5:53 am
Location: Helsinki

Re: GCC Cross-Compiler issue

Post by fronty »

Is that shared library in a directory where your loader is told to look at?
tobbebia
Posts: 17
Joined: Fri Feb 19, 2010 1:49 pm
Location: Sweden

Re: GCC Cross-Compiler issue

Post by tobbebia »

fronty wrote:Is that shared library in a directory where your loader is told to look at?
How can I see where the loader is looking? Thx for your reply.
My GitHub account: http://github.com/tobbebia
fronty
Member
Member
Posts: 188
Joined: Mon Jan 14, 2008 5:53 am
Location: Helsinki

Re: GCC Cross-Compiler issue

Post by fronty »

/etc/ld.so.conf (or ld-elf), LD_LIBRARY_PATH, man ldconfig. If the directory containing that library isn't in anywhere loader thinks it should be, try setting LD_LIBRARY_PATH and running it then. If it works, change your configuration.
tobbebia
Posts: 17
Joined: Fri Feb 19, 2010 1:49 pm
Location: Sweden

Re: GCC Cross-Compiler issue

Post by tobbebia »

fronty wrote:/etc/ld.so.conf (or ld-elf), LD_LIBRARY_PATH, man ldconfig. If the directory containing that library isn't in anywhere loader thinks it should be, try setting LD_LIBRARY_PATH and running it then. If it works, change your configuration.
Thanks!
Your solution worked.

tobbebia
My GitHub account: http://github.com/tobbebia
Post Reply