[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cross-compiling question: static libraries and binaries to different
Re: cross-compiling question: static libraries and binaries to different places?
Fri, 08 Mar 2002 10:31:37 +0100
Es schrieb Dan Kegel:
> Guido Draheim wrote:
> > ... See - the libtool crossgcc support (to which I did
> > contribute some of the time) can simply ask the cross-gcc
> > for the local searchpath via `gcc -print-search-dirs` -
> > this is needed for win32 compiles atleast, and I have a
> > patch on my disk which generalizes the idea for all
> > cross-gcc targets (since there have been problems with
> > crosscompiling linux-to-linux).
> You mean this?
YES!! I just didn't know how to make an argument about it on
the mailinglist, may be the sheer number of our voices can
avoid that ;-) - oh btw your patch needs an enhancement for
the last s/;/ /g since on unix a ":" is used. There was a
discussion a while back about the use of path_separator here,
but the final solution was to cut the line into three, and
examine the raw print-search-dirs string for occurrences of
";". If yes, use that one as the path_separator, if no
then use ":" and assume that unix path parts do never
contain ";" either but have ":" as the pathseparator. (and
IIRC, there was some rumour about differences as with a gcc
on win32 hosted in a unix pesonality, so you can't be that
sure about the ";" even on win32.). Anyway, you actually got
the idea, and I didn't say anything explicit, so it makes
me confident that this is an obvious flaw (a bug?) in the
libtool crosscompiling support. It neeeeeeds to be fixed.
go ahead, I'm all with you, guido
> --- libtool.m4.orig Thu Mar 7 16:58:42 2002
> +++ libtool.m4 Thu Mar 7 17:04:23 2002
> @@ -2312,6 +2312,13 @@
> +# When cross-compiling, get the list of system library directories
> +# from gcc if possible, since hardcoded paths above are surely wrong.
> +if test "$GCC" = yes && test "$cross_compiling" = yes; then
> + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" |
> sed -e "s/^libraries://" -e "s/;/ /g"`
> test "$dynamic_linker" = no && can_build_shared=no
> I just spent two hours realizing why libtool could not link with shared
> libraries when cross-compiling; it ended up being exactly the thing
> you're talking about. I created a patch according to your suggestion
> on the libtool mailing list, and it makes life much nicer.
> Is this in CVS yet? By golly, it sure needs to be.
> - Dan