--with-sysroot conflicts in binutils and gcc

2010-10-21 Thread Khem Raj
Hi

When building gcc and binutils in a cross environment there is a
conflict with respect to --with-sysroot
libtool 2.4 expects --with-sysroot on configure options to use sysroot
which is fine now the build time sysroot
and run time sysroot for gcc and binutils might differ eg. when
building binutils build=x86_64-linux
host=arm-linux-gnueabi target=arm-linux-gnueabi, in this case we are
building binutils like a target package
in terms of cross compiling but if we use --with-sysroot without a
value then libtool will guess it right pointing to build time sysroot
but binutils will then use a default sysroot which is
not pointing to / on the target file system, if we set
--with-sysroot="/" then binutils will get it right but libtool
will get it wrong.

toolchain has two options when it comes to sysroot --with-sysroot and
--with-build-sysroot I think libtool should
also differentiate between two and set both to same if not explicitly
set during configure time. I think libtool
means to use build time sysroot and not runtime sysroot its just that
configure options are colliding

What do you think

-Khem

___
http://lists.gnu.org/mailman/listinfo/libtool


Re: --with-sysroot conflicts in binutils and gcc

2010-10-23 Thread Khem Raj
On Sat, Oct 23, 2010 at 1:27 AM, Paolo Bonzini  wrote:
> On 10/23/2010 10:01 AM, Ralf Wildenhues wrote:
>>
>> Hi Paolo,
>>
>> * Paolo Bonzini wrote on Sat, Oct 23, 2010 at 09:38:43AM CEST:
>>>
>>> Also, libtool should probably ignore --with-sysroot if build==host;
>>> native compilers are never build with a sysroot in practice.
>>
>> OK, so this would mean there is no way --with-sysroot could be (ab)used
>> to fix the DESTDIR (re)link failures that libtool users experience
>> today.  Desired side-effect?
>
> No, do you have a pointer?  I don't understand what failure is there that
> cannot be fixed by --enable-fast-install (so that relink doesn't happen at
> install time), no?
>
>> The rest of your proposed patch could also be wrapped in
>> gcc/configure.ac, I'm not sure whether it belongs there rather than in
>> Libtool?
>
> I don't recall if binutils needs to know about a sysroot.
>
> Another solution is to do the following renaming in GCC
>
> --with-sysroot -> --enable-sysroot
> --with-build-sysroot -> --with-target-sysroot
> (not existing) -> --with-host-sysroot
>
> The task of mapping from old to new arguments is given to the toplevel
> configure script; subdirectories _never_ see a $with_sysroot with a meaning
> other than the one Libtool uses.  To do this, the toplevel configure simply
> has to mangle the {host,build,target}_configure_args to include the correct
> args:
>
> --without-sysroot for build_configure_args
>
> --with-sysroot=${with_host_sysroot:-no}
> --enable-sysroot=${with_sysroot:-${enable_sysroot:-no}}
> for host_configure_args
>
> --with-sysroot=${with_target_sysroot:-${with_build_sysroot:-no}}
> for target_configure_args.
>
> The patch should be relatively small, so OE can backport it to 4.5 if they
> wish.  Adjusting the docs and selling the idea on gcc@ is probably harder
> than writing it.
>

I have renamed the libtool --with-sysroot to --with-libtool-sysroot
for experments to avoid the conflict
and it worked well for me.

See the patch here.

http://git.openembedded.org/cgit.cgi/openembedded/tree/recipes/libtool/libtool-2.4/rename-with-sysroot.patch

I guess thats not best

> Paolo
>

___
http://lists.gnu.org/mailman/listinfo/libtool