Re: [pcre-dev] [PATCH] fix cross compiling

Top Page
Delete this message
Author: Petr Pisar
Date:  
To: pcre-dev
CC: Raphaël HUCK
Subject: Re: [pcre-dev] [PATCH] fix cross compiling
On Wed, Nov 02, 2011 at 04:16:31PM +0000, Philip Hazel wrote:
> On Wed, 2 Nov 2011, Raphaël HUCK wrote:
>
> > this patch fixes cross compiling and has been used for 6 years in
> > OpenWrt:
> >
> > https://dev.openwrt.org/browser/trunk/openwrt/package/pcre/patches/750-pcre_config_cross.patch?rev=1864
> >
> > Would you consider integrating it into PCRE?
>
> It seems that your patch removes the output -L/usr/lib from the line
> output by the command "pcre-config --libs". I've just looked at a number
> of x-config commands, and there doesn't seem to be any consistency. Some
> of them have -L/usr/lib and some of them do not. Presumably it is the
> presence of this that causes you trouble?
>
> Does anybody on this list care to comment as to whether it is currently
> best practice to include -L/usr/lib or to omit it?
>

We in Fedora also patch pcre-config to remove the -L option completely
(http://pkgs.fedoraproject.org/gitweb/?p=pcre.git;a=blob;f=pcre-8.10-multilib.patch)
because it breaks multilib scenario: user have installed pcre twice---32b and
64b version---and he leaves compiler to select proper library path.

If I remember correctly, GNU toolchain has -B option to tell cross-compiler
where cross-compiled system resides. I cross-compiled Gentoo Linux from i585
to emebedded MIPS few years ago and this was one frequent bug: If libraries
and header files are in standard paths (gcc --print-system), then the path
should not be explicitly repeated in various compile-time script (foo-config).

-- Petr