DragonFly BSD
DragonFly kernel List (threaded) for 2004-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: how does buildword search the right directories?

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 21 Aug 2004 10:12:31 -0700 (PDT)

    Heh.  It took me a while to figure that out when I first started retooling
    buildworld.  But, yes, the key is the fact that all the primary compiler
    and assembler tools run through the objformat program.  Many of the paths
    are hardwired at compile time so, for example, the buildworld crosstools
    stage builds a custom objformat and compiler binaries which the buildworld
    uses simply by virtue of running the correct objformat binary.


:On 21.08.2004, at 14:19, Simon 'corecode' Schubert wrote:
:> How does buildworld search the right directories for 
:> includes/libraries, i.e. not the default system path (/usr/lib, 
:> /usr/include), but the buildworld path 
:> (/usr/obj/usr/src/world_i386/usr/lib...)?
:> And... If buildworld doesn't do it, how would it be done (need this 
:> for a cross compile project)?
:heh, hand me a cluebat to hit myself :), found it:
:calling /usr/bin/ld --verbose shows /usr/lib as search path. calling 
:/usr/obj/usr/src/world_i386/usr/bin/ld --verbose *also* showed /usr/lib 
:as search path.
:Why? because ld is objformat'ed and thus calls 
:/usr/libexec/binutils212/elf/ld, not minding the changed binary path. 
:And it seems those binaries care about their location to determine 
:which path to search.
:so setting OBJFORMAT_PATH to the proper location helps these tools 
:finding the right path.
:JFYI, of course
:   simon

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]