[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] libtool seems to ignore -EL
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] libtool seems to ignore -EL |
Date: |
Thu, 29 Jul 2010 17:12:07 +0200 |
User-agent: |
KMail/1.9.9 |
Hi,
> I try cross-building libiconv 1-13.1.
> My steps are as following:
> $env CC=mips-linux-gnu-gcc CFLAGS='-EL -Os -mips32r2 -muclibc
> -msoft-float' LDFLAGS='-msoft-float -muclibc -EL -mip
> s32r2' ./configure prefix=/home/admin/libiconv --host=mipsel-linux
> --build=i686-pc-linux
> $make
> ...
> /bin/sh ../libtool --mode=link mips-linux-gnu-gcc -EL -mips32r2 -EL
> -O2 -mips32r2 -fvisibility=hidden -o libcharset.la -rpath
> /usr/local/lib -version-info 1:0:0 -no-undefined localcharset.lo
> relocatable.lo
> libtool: link: mips-linux-gnu-gcc -shared .libs/localcharset.o
> .libs/relocatable.o -mips32r2 -mips32r2 -Wl,-soname
> -Wl,libcharset.so.1 -o .libs/libcharset.so.1.0.0
> /opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/mips-linux-gnu/4.3.3/../../../../mips-linux-gnu/bin/ld:
> .libs/localcharset.o: compiled for a little endian system and target
> is big endian
> /opt/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/mips-linux-gnu/4.3.3/../../../../mips-linux-gnu/bin/ld:
> .libs/localcharset.o: endianness incompatible with that of the
> selected emulation
>
> From the log messages, make has the correct linking options passed to
> libtool but libtool seems to ignore some of them.
> I take some time to trace the libtool script. The argument parsing
> procedure for the option -EL
> seems to escape here:
> =======================================================
> # Some other compiler flag.
> -* | +*)
> func_quote_for_eval "$arg"
> arg="$func_quote_for_eval_result"
> ;;
> ========================================================
> and can't be accumulated to the varible `compiler_flags` which is
> finally passed to the linker.
>
> I patch the libtool script by the following command after they have
> been created by configure.
> ===========================================================================================
> $sed -i 's/\(-fprofile-\*|-F\*|@\*\))/\1|-EL)/' libcharset/libtool
> preload/libtool libtool
> ===========================================================================================
>
> And the I get libiconv built successfully.
> It seems to be a bug of libtool, isn't it?
Your problem is that the option -EL is not being passed to the compiler.
You had put it into CFLAGS. The description of CFLAGS in the Autoconf manual
[1] says that it's for "Debugging and optimization options". It is OK in
my opinion for libtool to remove debugging and optimization options.
Can you instead try to set
CC='mips-linux-gnu-gcc -mips32r2 -EL -muclibc -msoft-float'
CFLAGS='-Os'
LDFLAGS=''
and configure libiconv-1.13.1 with that? If you still get the same error,
then it's definitely a bug in libtool; please write to bug-libtool in
this case.
Bruno