Re: [OpenWrt-Devel] GCC4.3 patch (wip)

2008-06-16 Thread Hinko Kocevar
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

 
 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

-- 
Č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


Re: [OpenWrt-Devel] GCC4.3 patch (wip)

2008-06-16 Thread Luigi 'Comio' Mantellini
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_basechar... 

Thanks and Best regards,

luigi


Industrie Dial Face S.p.A.
Luigi Mantellini
RD - Software
Industrie Dial Face S.p.A.
Via Canzo, 4 
20068 Peschiera Borromeo (MI), Italy
Tel.:   +39 02 5167 2813
Fax:+39 02 5167 2459
E-mail: [EMAIL PROTECTED]
GPG fingerprint: 3DD1 7B71 FBDF 6376
1B4A
 B003 175F E979 907E
1650
attachment: idf_logo.gif___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] GCC4.3 patch (wip)

2008-06-16 Thread Hinko Kocevar
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_basechar... 
 


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


Re: [OpenWrt-Devel] GCC4.3 patch (wip)

2008-06-13 Thread Geert Uytterhoeven
On Fri, 13 Jun 2008, Luigi 'Comio' Mantellini wrote:
 I'm still working to port OpenWRT on my architecture (m68k/coldfire). I

 diff --git a/target/linux/generic_m68k/config-default 
 b/target/linux/generic_m68k/config-default
 new file mode 100644
 index 000..6f8acb5
 --- /dev/null
 +++ b/target/linux/generic_m68k/config-default
 @@ -0,0 +1,616 @@
 +#
 +# Automatically generated make config: don't edit
 +# Linux kernel version: 2.6.25
 +# Mon May 12 19:37:01 2008
 +#
 +CONFIG_MIPS=y
  

That looks a bit strange for an m68k config...

 diff --git a/target/linux/generic_m68k/image/lzma-loader/src/Makefile 
 b/target/linux/generic_m68k/image/lzma-loader/src/Makefile
 new file mode 100644
 index 000..910172c
 --- /dev/null
 +++ b/target/linux/generic_m68k/image/lzma-loader/src/Makefile
 @@ -0,0 +1,68 @@
 +# 
 +# Copyright (C) 2006 OpenWrt.org
 +#
 +# This is free software, licensed under the GNU General Public License v2.
 +# See /LICENSE for more information.
 +#
 +RAMSTART = 0x8000
 +RAMSIZE = 0x0010 # 1MB
 +LOADADDR = 0x8040# RAM start + 4M
 +KERNEL_ENTRY = 0x80001000
 +IMAGE_COPY:=0
 +
 +CROSS_COMPILE = mips-linux-
   
Another one...

 diff --git a/target/linux/generic_m68k/image/lzma-loader/src/decompress.c 
 b/target/linux/generic_m68k/image/lzma-loader/src/decompress.c
 new file mode 100644
 index 000..45ac509
 --- /dev/null
 +++ b/target/linux/generic_m68k/image/lzma-loader/src/decompress.c

 +#define cache_unroll(base,op)\
 + __asm__ __volatile__(   \
 + .set noreorder;\n \
 + .set mips3;\n \
 + cache %1, (%0);\n \
 + .set mips0;\n \
 + .set reorder\n\
 + :   \
 + : r (base),   \
 +   i (op));

Erhm...

And there are many more...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say programmer or something like that.
-- Linus Torvalds
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] GCC4.3 patch (wip)

2008-06-13 Thread Luigi 'Comio' Mantellini
Ciao,

in order to advance the building I manually created the following link:

 cd
staging_dir/toolchain-m68k_gcc4.3.1/lib/gcc/m68k-linux-uclibc/4.3.1/include
 ln -s ../include-fixed/limits.h .

In your opinion... can it be a solution?

with this workaround the uClibc compilation advances untile this strange
error:

make[4]: Leaving directory 
`/mnt/devel/openwrt/OpenWRT.git/build_dir/toolchain-m68k_gcc4.3.1/uClibc-0.9.29'
PATH=/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/ope
 
nwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/t32/bin/pc_linux:/opt/Arabella/bin
 
PATH=/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k
 
_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/host/bin:/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/host/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/t32/bin/pc_linux:/opt/Arabella/bin
 make -C 
/mnt/devel/openwrt/OpenWRT.git/build_dir/toolchain-m68k_gcc4.3.1/uClibc-0.9.29 
AR=m68k-linux-uclibc-ar AS=m68k-linux-uclibc-gcc -c -Os -pipe -funit-at-a-time 
-fhonour-copts LD=m68k-linux-uclibc-ld NM=m68k-linux-uclibc-nm 
CC=m68k-linux-uclibc-gcc GCC=m68k-linux-uclibc-gcc 
CXX=m68k-linux-uclibc-g++ RANLIB=m68k-linux-uclibc-ranlib 
STRIP=m68k-linux-uclibc-strip OBJCOPY=m68k-linux-uclibc-objcopy 
OBJDUMP=m68k-linux-uclibc-objdump SIZE=m68k-linux-uclibc-size DEVEL_PREFIX=/ 
RUNTIME_PREFIX=/ HOSTCC=gcc CPU_CFLAGS=-Os -pipe -funit-at-a-time 
-fhonour-copts PREF
 IX=/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/ 
install_runtime install_dev
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
make[4]: *** [install_runtime] Error 127
make[4]: Leaving directory 
`/mnt/devel/openwrt/OpenWRT.git/build_dir/toolchain-m68k_gcc4.3.1/uClibc-0.9.29'
make[3]: *** 
[/mnt/devel/openwrt/OpenWRT.git/staging_dir/toolchain-m68k_gcc4.3.1/stamp/.uclibc_installed]
 Error 2
make[3]: Leaving directory `/mnt/devel/openwrt/OpenWRT.git/toolchain/uClibc'
make[2]: *** [toolchain/uClibc/compile] Error 2
make[2]: Leaving directory `/mnt/devel/openwrt/OpenWRT.git'
make[1]: *** 
[/mnt/devel/openwrt/OpenWRT.git/staging_dir/m68k/stamp/.toolchain_install] 
Error 2
make[1]: Leaving directory `/mnt/devel/openwrt/OpenWRT.git'
make: *** [world] Error 2
 
Of course the tar command works fine on my system.

Any idea?

luigi

On ven, 2008-06-13 at 09:34 +0200, Luigi 'Comio' Mantellini wrote:
 Sorry. You are right. (I'm working also on a mips architecture and I
 have made 

Re: [OpenWrt-Devel] GCC4.3 patch (wip)

2008-06-13 Thread Luigi 'Comio' Mantellini
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

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)?


I'm sorry for this ship's log but I'm not an OpenWRT developer and I
don't know the internals... I only know that I need to port OpenWRT to
Coldfire architecture

Thanks a lot and all comments are wellcome.

luigi



 Of course the tar command works fine on my system.
 
 Any idea?
 
 luigi
 
 On ven, 2008-06-13 at 09:34 +0200, Luigi 'Comio' Mantellini wrote:
  Sorry. You are right. (I'm working also on a mips architecture and I
  have made some mistake in copying).
  
  Try this.
  
  Thanks,
  
  luigi
  
  
  
  
  
  On ven, 2008-06-13 at 09:10 +0200, Geert Uytterhoeven wrote:
   On Fri, 13 Jun 2008, Luigi 'Comio' Mantellini wrote:
I'm still working to port OpenWRT on my architecture (m68k/coldfire). I
   
diff --git a/target/linux/generic_m68k/config-default 
b/target/linux/generic_m68k/config-default
new file mode 100644
index 000..6f8acb5
--- /dev/null
+++ b/target/linux/generic_m68k/config-default
@@ -0,0 +1,616 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25
+# Mon May 12 19:37:01 2008
+#
+CONFIG_MIPS=y
 
   
   That looks a bit strange for an m68k config...
   
diff --git a/target/linux/generic_m68k/image/lzma-loader/src/Makefile 
b/target/linux/generic_m68k/image/lzma-loader/src/Makefile
new file mode 100644
index 000..910172c
--- /dev/null
+++ b/target/linux/generic_m68k/image/lzma-loader/src/Makefile
@@ -0,0 +1,68 @@
+# 
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License 
v2.
+# See /LICENSE for more information.
+#
+RAMSTART = 0x8000
+RAMSIZE = 0x0010   # 1MB
+LOADADDR = 0x8040  # RAM start + 4M
+KERNEL_ENTRY = 0x80001000
+IMAGE_COPY:=0
+
+CROSS_COMPILE = mips-linux-
  
   Another one...
   
diff --git 
a/target/linux/generic_m68k/image/lzma-loader/src/decompress.c 
b/target/linux/generic_m68k/image/lzma-loader/src/decompress.c
new file mode 100644
index 000..45ac509
--- /dev/null
+++ b/target/linux/generic_m68k/image/lzma-loader/src/decompress.c
   
+#define cache_unroll(base,op)  \
+   __asm__ __volatile__(   \
+   .set noreorder;\n \
+   .set mips3;\n \
+   cache %1, (%0);\n \
+   .set mips0;\n \
+   .set reorder\n\
+   :   \
+   : r (base),   \
+ i (op));
   
   Erhm...
   
   And there are many more...
   
   Gr{oetje,eeting}s,
   
 Geert
   
   --
   Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL 
   PROTECTED]
   
   In personal conversations with technical people, I call myself a hacker. 
   But
   when I'm talking to journalists I just say programmer or something like 
   that.
 -- Linus Torvalds
   ___
 
  __   Luigi Mantellini
.'__'. RD - Software
   (.'  '.)Industrie Dial Face S.p.A.
   ( :==: )Via