GCC 4.5.0 and the cross-compiler tutorial

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: GCC 4.5.0 and the cross-compiler tutorial

Post by Solar »

protecyon wrote:It's a hack but to help GCC find the libraries you can create the LD_LIBRARY_PATH for example:
LD_LIBRARY_PATH=/mydir/gmp/lib:/mydir/mpc/lib:/mydir/mpfr/lib
LD_LIBRARY_PATH is bad (*). If you use it for anything else but patching libraries into a system for test / workaround purposes, chances are you are mis-using it.

Either
  • using the host system's GMP and MPFR, or
  • building GMP and MPFR in default directories (/usr/... or /opt/...), or
  • putting their sources into the GCC source tree and build them alongside everything else
works (unless you're playing dork like I did). Each option is preferrable to setting LD_LIBRARY_PATH.


(*): http://xahlee.org/UnixResource_dir/_/ldpath.html
Every good solution is obvious once you've found it.
Post Reply