Luigi 'Comio' Mantellini wrote:
> Hi Hinko,
> Hi List,
> 
> see my inline comments.
> 
> On lun, 2008-06-16 at 10:05 +0200, Hinko Kocevar wrote:
> 
>> Luigi 'Comio' Mantellini wrote:
>>> Ciao again,
>>>
>>>
>>> On ven, 2008-06-13 at 11:22 +0200, Luigi 'Comio' Mantellini wrote:
>>>> Ciao,
>>>> make[4]: Entering directory 
>>>> `/mnt/devel/openwrt/OpenWRT.git/build_dir/toolchain-m68k_gcc4.3.1/uClibc-0.9.29'
>>>> install -d 
>>>> /mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1//lib
>>>> install -m 644 lib/lib*-0.9.29.so \
>>>>            
>>>> /mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1//lib
>>>> cd lib && tar -cf - *.so.* | tar -xf - -C 
>>>> /mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1//lib
>>>> tar: error while loading shared libraries: libpthread.so.0: ELF file data 
>>>> encoding not little-endian
>>>> tar: error while loading shared libraries: libpthread.so.0: ELF file data 
>>>> encoding not little-endian
>> You've seem to remove some some mandatory path in system library search - if 
>> your had LD_LIBRARY_PATH set you've might need to do:
>> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/your/lib
>> in contrast to
>> export LD_LIBRARY_PATH=/path/to/your/lib
>>
> 
> 
> I added the following into $(TOP)/rule.mk (and I don't like what I
> do...):
> 
> export LD_LIBRARY_PATH=$(TOP)/staging_dir/host/lib:$(LD_LIBRARY_PATH)
> 
> 
> Anyway I decided to change approach: install directly on the host
> environment the GMP and MPFR library need to GCC4.3 compiler... OpenWRT
> should make some check to recognize these libraries:
> 
> 
>         ifneq ($(CONFIG_GCC_VERSION_4_3_X),)
>         define Require/gmp
>                 echo 'int main(int argc, char **argv) { return 
> ((__GNU_MP_VERSION*1000+__GNU_MP_VERSION_MINOR)*1000+__GNU_MP_VERSION_PATCHLEVEL)>=004001000?0:1;
>  }' |
>                         gcc -include gmp.h -x c -o $(TMP_DIR)/gmptest.o -lgmp 
> -
>         endef
>         
>         $(eval $(call Require,gmp, \ 
>                 Please install lib gmp >= 4.1.0 \ 
>         ))
>         
>         define Require/mpfr
>                 echo 'int main(int argc, char **argv) { return 
> (MPFR_VERSION>=MPFR_VERSION_NUM(2,3,0))?0:1; }' | \ 
>                         gcc -include mpfr.h -x c -o $(TMP_DIR)/a.out -lmpfr -
>         endef
>         
>         $(eval $(call Require,mpfr, \ 
>                 Please install lib mpfr >= 2.3.0 \ 
>         ))
>         
>         endif
> 
> 
> Unfortunately, this code cannot be performed by prereq-build.mk because
> we don't know if we need gcc4.3 or not.
> 
> 
>>> My self-answer: This error is caused by the "LD_LIBRARY_PATH" that I
>>> defined into rule.mk. At this point I need to resolve an issue: GCC4.3
>>> requires gmp and mpfr libraries. I added the makefile under the
>>> toolchain directory in order to create the needed libraries (libgmp.so
>>> and libmpfr.so). I  placed these libraries into the
>>> staging_dir/host/lib/ directory... but (cross)gcc doesn't start because
>>> this directory is not in the ld path... I thought to solve this issue
>>> using the LD_LIBRARY_PATH=$(TOP)/staging_dir/host/lib/ ... but this
>>> creates the error in tar application....
>>>
>>> Now, with LD_LIBRARY_PATH env. variable removed, I'm compiling the
>>> gcc-final... but I will need it when the (cross)gcc is invoked.
>>>
>>> question: Where can I place the host libraries (__NOT TARGET__) in order
>>> to be visible to cross-compiler (and in general, to crosstools)?
>> Maybe all you need to do is correctly supply the full path to the 
>> includes/libraries via C(PP)FLAGS/LDFLAGS in the makefile, or on the command 
>> line instead of using LD_LIBRARY_PATH. Another approach would be to 
>> statically build/link the tar app inside the openWRT SDK and use the 
>> LD_LIBRARY_PATH after all.
>>
>> HTH,
>>
>> Hinko
>>
> 
> 
> I would patch OpenWRT as little as possible, of course. The solution
> should be to link statically libgmp and libmpfr to gcc cross-compiler...
> but How can I say this to the gcc configure?
> 
> Furthermore I chosen to avoid to compile the mpfr and gmp into the
> OpenWRT environment... Now I have an error during the gcc-final
> regarding ctype_base<char>... 
> 


I guess you could look at the uclibc buildroot at http://buildroot.uclibc.org/ 
and the way they handle the mpfr/gmp for gcc toolchain.


-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: [EMAIL PROTECTED]
Http: www.cetrtapot.si

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to