This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

autoconf, -rpath-link, and CC_FOR_BUILD


I'm working on some generalized make rules for cross-compiling autoconf
packages.  I've got a pretty slick system, but I'm running into a catch-22 when
it comes to recursively linked libraries.  I'm looking for advice on how to
drive autoconf better.

I first ran into a problem when cross-compiling the x.org server.  The
xorg-server binary dynamically links against libXfont.  libXfont in turn
dynamically links against freetype.  Both libXfont.so and libfreetype.so are
already "installed" in the target root's lib dir, which is at (let's say)
/path/to/target-root/lib.  But the cross compiler's ld doesn't have
/path/to/target-root/lib in its search path, so I tried invoking xorg-server's
makefile like this:

PATH=/path/too/cross-toolchain/bin:$(PATH) make -C /path/to/xorg-server-source \
  LDFLAGS=-L/path/to/target-root/lib

This allows the linker to find libXfont.so, but for some reason it doesn't look
for libfreetype.so in the same directory!  The only way I could get ld to find
recursively-linked libraries was by using -rpath-link, thusly:

PATH=/path/too/cross-toolchain/bin:$(PATH) make -C /path/to/xorg-server-source \
  LDFLAGS="-L/path/to/target-root/lib -Wl,-rpath-link=/path/to/target-root/lib"

Once I made that my standard make invocation, everything worked really well. 
Until today.  When I tried this on libX11, I ran into CC_FOR_BUILD.

CC_FOR_BUILD is the variable formerly known as "HOST_CC".  This is not the cross
compiler, it is the host's compiler, and it MUST NOT search in
/path/to/target-root/lib.  So sending -L/path/to/target-root/lib is wrong, and
-rpath-link=/path/to/target-root/lib is worse.  What I want is a way to send
just the cross-ld the target path, and not send the host ld the target path.

Is there a way to call autoconf/make such that I can associate the proper paths
with the proper linkers?

Thanks,
Dave



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]