This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problems when doing cross compilation


Hi,
I want to investigate newlib for our future IOT project. Now I got
problem to create a cross tool-chain base on newlib-2.2.0.20150323,
binutils-2.17, gcc-4.8.4. My build machine is 64 bit Ubuntu 14.04, I
want build 32 bit toolchain for i586.

My build step is:
1. Macro export.
a. export TARGET=i386-linux-gnu
b. export PREFIX=/opt/newlib32
c. export PATH=$PATH:/opt/newlib32/bin
2. binutils build
a. SRC_DIR/configure --target=$TARGET --prefix=$PREFIX; make all -j8
CFLAGS="-Wno-error=unused-but-set-variable  -Wno-error=format-security
"; make install
3. Gcc build
a. SRC_DIR/configure --target=$TARGET --prefix=$PREFIX
--with-newlib --without-headers --with-gnu-as    --with-gnu-ld
--disable-shared --enable-languages=c    --disable-werror
--disable-decimal-float --disable-lib
b. make all-gcc CFLAGS_FOR_TARGET="-I
â/newlib-2.2.0.20150323/newlib/libc/include/"
c. make install-gcc
4. newlib build
a. ../../newlib-2.2.0.20150323/newlib/configure --target=$TARGET
--prefix=$PREFIX CC=$TARGET-gcc LD=$TARGET-ld
b. Make all
Then I got the following error:
--------
rm -f lib.a
ln x86_64/lib.a lib.a >/dev/null 2>/dev/null || \
         cp x86_64/lib.a lib.a
cp: cannot stat 'x86_64/lib.a': No such file or directory
make[4]: *** [lib.a] Error 1
--------
It is wrong to use x86_64, because my target is 32bit machine. Did I
made some mistake during configuraton?
If I add âhost=$TARGET, I got the error as follows:
--------
configure:4936: i586-pc-linux-gnu-gcc -O2   conftest.c  >&5
/opt/newlib32/lib/gcc/i586-pc-linux-gnu/4.8.4/../../../../i586-pc-linux-gnu/bin/ld:
crt1.o: No such file: No such file or directory
---------

Any comments are appreciated.

Best regards.
J. F.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]