osdir.com
mailing list archive

Subject: Cross compile problem (gcc-3.2.1, glibc-2.3.1) - msg#00052

List: linux.ports.arm.general

Date: Prev Next Index Thread: Prev Next Index
Hi All,

I try to cross compile a toolchain for ARM (DNP1110).
When It tries to compile glibc, it doesn't find the
headers (stdio.h, unistd.h). It seems there is no
.../arm-linux/include directory
(.../arm-linux/sys-include is created though). When is
it created?

My build-toolchain script is attached.

Regards,

Zoltan

build-toolchain-3.2.1

#!/bin/sh

BINUTILS_VERSION=2.13.1
GCC_VERSION=3.2.1
GLIBC_VERSION=2.3.1
GLIBC_LINUXTHREADS_VERSION=2.3.1

GNU_TARGET_NAME=arm-linux
GNU_BUILD_NAME=i586-linux
TOP_DIR=`pwd`
BUILD_DIR=$TOP_DIR/build
STAGING_DIR=/usr/local/arm/$GCC_VERSION
SOURCE_DIR=$TOP_DIR
ROOT_DIR=$STAGING_DIR/rootfs

KERNEL=/usr/src/arm-linux-2.4.18
HOST=
HOSTCC=gcc


#
----------------------------------------------------------------------------
# There should be nothing to configure below this line

#
# Check if everything is there
#
echo -n "check if sources are available..."
mkdir -p $BUILD_DIR
if [ "$KERNEL" = "" -o ! -f
"$KERNEL/Documentation/arm/README" ]; then
echo "You haven't changed KERNEL to point at a valid
kernel tree"
exit 1
fi
if [ ! -f
$SOURCE_DIR/binutils-$BINUTILS_VERSION.tar.gz ]; then
echo binutils-$BINUTILS_VERSION seems to be missing
exit 1
fi
if [ ! -f $SOURCE_DIR/gcc-$GCC_VERSION.tar.gz ]; then
echo gcc-$GCC_VERSION seems to be missing
exit 1
fi
if [ ! -f $SOURCE_DIR/glibc-$GLIBC_VERSION.tar.gz ];
then
echo glibc-$GLIBC_VERSION seems to be missing
exit 1
fi
if [ ! -f
$SOURCE_DIR/glibc-linuxthreads-$GLIBC_LINUXTHREADS_VERSION.tar.gz
]; then
echo glibc-linuxthreads-$GLIBC_LINUXTHREADS_VERSION
seems to be missing
exit 1
fi

echo "done"

#
# binutils
#
echo -n "binutils..."
[ -d $BUILD_DIR/binutils-$BINUTILS_VERSION ] || {
echo -n "extracting..."
cd $BUILD_DIR
tar zxf $SOURCE_DIR/binutils-$BINUTILS_VERSION.tar.gz
cd binutils-$BINUTILS_VERSION
./configure \
--disable-shared \
--target=$GNU_TARGET_NAME \
--prefix=$STAGING_DIR \
--enable-targets=$GNU_TARGET_NAME
make
make install
}
echo "done"

#
# gcc
#
echo -n "gcc..."
[ -d $BUILD_DIR/gcc-$GCC_VERSION ] || {
echo -n "extracting..."
cd $BUILD_DIR
tar zxf $SOURCE_DIR/gcc-$GCC_VERSION.tar.gz
cd gcc-$GCC_VERSION
# hack to build gcc without glibc
perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1
-Dinhibit_libc -D__gthr_posix_h/'
gcc/config/arm/t-linux
}
echo "done"

# gcc stage 1
echo -n "gcc-stage 1..."
[ -d $BUILD_DIR/gcc-$GCC_VERSION-stage1-obj ] || {
mkdir $BUILD_DIR/gcc-$GCC_VERSION-stage1-obj
cd $BUILD_DIR/gcc-$GCC_VERSION-stage1-obj
PATH=$PATH:$STAGING_DIR/bin \
AR=$GNU_TARGET_NAME-ar \
RANLIB=$GNU_TARGET_NAME-ranlib \
CC=$HOSTCC \
../gcc-$GCC_VERSION/configure \
--target=$GNU_TARGET_NAME \
--prefix=$STAGING_DIR \
--enable-target-optspace \
--disable-nls \
--with-gnu-ld \
--disable-shared \
--enable-languages=c \
--with-headers=$KERNEL/include
PATH=$PATH:$STAGING_DIR/bin make
PATH=$PATH:$STAGING_DIR/bin make install
}
echo "done"

# glibc-cross
GLIBC=glibc-$GLIBC_VERSION
GLIBC_LINUXTHREADS=glibc-linuxthreads-$GLIBC_LINUXTHREADS_VERSION
echo -n "glibc..."
[ -d $BUILD_DIR/$GLIBC ] || {
cd $BUILD_DIR
gzip -dc $SOURCE_DIR/$GLIBC.tar.gz | tar -xf -
cd $BUILD_DIR/$GLIBC
gzip -dc $SOURCE_DIR/$GLIBC_LINUXTHREADS.tar.gz | tar
-xf -
perl -pi -e
's/i386/arm*)\n\tlibc_cv_gcc_unwind_find_fde=yes\n\tarch_minimum_kernel=2.0.10\n\t;;\n
i386/' sysdeps/unix/sysv/linux/configure
perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/'
sysdeps/unix/sysv/linux/arm/errlist.c
cd $BUILD_DIR
mkdir $GLIBC-obj
cd $GLIBC-obj
PATH=$PATH:$STAGING_DIR/bin \
AR=$GNU_TARGET_NAME-ar \
RANLIB=$GNU_TARGET_NAME-ranlib \
CC=$GNU_TARGET_NAME-gcc \
../$GLIBC/configure $GNU_TARGET_NAME \
--build=$GNU_BUILD_NAME \
--host=$GNU_TARGET_NAME \
--prefix=$STAGING_DIR/$GNU_TARGET_NAME \
--enable-add-ons \
--disable-sanity-checks \
--enable-shared \
--with-headers=$KERNEL/include
PATH=$PATH:$STAGING_DIR/bin make
PATH=$PATH:$STAGING_DIR/bin make install
}
echo "done"

# ld.so from glibc-cross: needs to be configured
differently for the
# target system (because of other paths)
echo -n "ld.so..."
[ -d $BUILD_DIR/$GLIBC-ldso ] || {
mkdir $BUILD_DIR/$GLIBC-ldso
cd $BUILD_DIR/$GLIBC-ldso
PATH=$PATH:$STAGING_DIR/bin \
AR=$GNU_TARGET_NAME-ar \
RANLIB=$GNU_TARGET_NAME-ranlib \
CC=$GNU_TARGET_NAME-gcc \
../$GLIBC/configure $GNU_TARGET_NAME \
--build=$GNU_BUILD_NAME \
--host=$GNU_TARGET_NAME \
--prefix= \
--enable-add-ons \
--disable-sanity-checks \
--enable-shared \
--with-headers=$KERNEL/include
PATH=$PATH:$STAGING_DIR/bin make
# CAREFUL: don't never ever make install here without
install_root!!!
mkdir -p $ROOT_DIR/lib
cp elf/ld.so $ROOT_DIR/lib/ld-$GLIBC_VERSION.so
}
echo "done"

# gcc stage 2
echo -n "gcc-stage 2..."
[ -d $BUILD_DIR/gcc-$GCC_VERSION-stage2-obj ] || {
mkdir $BUILD_DIR/gcc-$GCC_VERSION-stage2-obj
cd $BUILD_DIR/gcc-$GCC_VERSION
# remove glibc header hack
perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS =
-fomit-frame-pointer -fPIC).*/$1/'
gcc/config/arm/t-linux
cd $BUILD_DIR/gcc-$GCC_VERSION-stage2-obj
PATH=$STAGING_DIR/bin:$PATH \
AR=$GNU_TARGET_NAME-ar \
RANLIB=$GNU_TARGET_NAME-ranlib \
CC=$HOSTCC \
../gcc-$GCC_VERSION/configure \
--target=$GNU_TARGET_NAME \
--prefix=$STAGING_DIR \
--enable-target-optspace \
--disable-nls \
--with-gnu-ld \
--disable-shared \
--enable-languages="c,c++" \
--with-headers=$KERNEL/include
PATH=$PATH:$STAGING_DIR/bin make
PATH=$PATH:$STAGING_DIR/bin make install
}
echo "done"



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: gcc 3.2 / glibc 2.2.5 Cross compile tools build

Jonathan Marks wrote: Hi, Firstly, thanks to Erik for compiling the tools, and providing the script so that it can be repeated. We had a couple of issues with the cross-3.2 build, prompting us to rebuild the chain; one issue is definitely fixed, the other will require more testing on our part to confirm that it is fixed. 1. gcc is compiled with pthread disabled in gcc. This creates libgcc_s.so without pthread support, which is a problem when throwing c++ exceptions in multithreaded apps. 2. When the cross-3.2 tool chain is used to build glibc for our arm targets, any program compiled to used shared libraries cored on the arm target. This is the case for both glibc 2.2.3 and 2.2.5. Compling glibc for the arm target using the cross-2.95.3 tool chain fixed this problem. It is suspected that this problem has to do with binutils 2.12 and greater. The toolchain we built uses binutils 2.11.2, rather than 2.13, used in Erik's build. We have not tested this by creating a new filesystem with the new libraries yet - feedback is welcome. If there is interest in this tool chain build, I'm happy to provide it and its build instructions. Perhaps it can be posted on the ftp site with the other tool-chains. I for one would be interested in the build instructions... Eli --------------------. "If it ain't broke now, Eli Carter \ it will be soon." -- crypto-gram eli.carter(a)inet.com `------------------------------------------------- ------------------------------------------------------------------- Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php

Next Message by Date: click to view message preview

(no subject)

hi all, i build arm-linux-gdb at i386-linux host,but i can't use command "target sim",then i build a arm-elf version,so i can use "target sim". i have a simple hello world program compiled by arm-linux-gcc. but arm-linux-gdb helloworld target sim load run nothing happen just hangup.why can't print "hello world"? Jæìr¸©¶*'¢›b¢{!¶ÚþX¬¶Æ«šX§»+‚é?™¨¥™©ÿ–+-ŠwèþX§»«˜PüKbªç­µèm¶Ÿÿà ®ibžìh® ¤ýªæ–)îÇùšŠX§‚X¬¶Êa

Previous Message by Thread: click to view message preview

Alternate bus master mode on PXA250

Hello, I am trying to use alternate bus master mode on the PXA-250 (B0 stepping), but haven't been successful yet. In include/asm/arch-pxa/pxa-regs.h, alternate bus master grant is defined to be alternate function 2 of GPIO 13. The PXA250 developer's manual, on the other hand, has contradictory statements: - pg. 6-70: enable MBGNT Alternate Function 3 - pg. 4-3: memory controller grant is ALT_FN_2_OUT If anybody has used alternate bus master mode, which of the above have you used ? Best Regards, David Mazur -- Mind: Embedded Linux, eCos and JVM development in Europe http://mind.be tel +32-16-309.666 ------------------------------------------------------------------- Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php

Next Message by Thread: click to view message preview

Re: Cross compile problem (gcc-3.2.1, glibc-2.3.1)

It seems that there are some bugs in gcc-3.2.1 arm portion. I cannot generate good kernel for StrongARM SA1110 Assabet with gcc-3.2.1. Zoltan Csizmadia wrote: Hi All, I try to cross compile a toolchain for ARM (DNP1110). When It tries to compile glibc, it doesn't find the headers (stdio.h, unistd.h). It seems there is no .../arm-linux/include directory (.../arm-linux/sys-include is created though). When is it created? My build-toolchain script is attached. Regards, Zoltan build-toolchain-3.2.1 #!/bin/sh BINUTILS_VERSION=2.13.1 GCC_VERSION=3.2.1 GLIBC_VERSION=2.3.1 GLIBC_LINUXTHREADS_VERSION=2.3.1 GNU_TARGET_NAME=arm-linux GNU_BUILD_NAME=i586-linux TOP_DIR=`pwd` BUILD_DIR=$TOP_DIR/build STAGING_DIR=/usr/local/arm/$GCC_VERSION SOURCE_DIR=$TOP_DIR ROOT_DIR=$STAGING_DIR/rootfs KERNEL=/usr/src/arm-linux-2.4.18 HOST= HOSTCC=gcc # ---------------------------------------------------------------------------- # There should be nothing to configure below this line # # Check if everything is there # echo -n "check if sources are available..." mkdir -p $BUILD_DIR if [ "$KERNEL" = "" -o ! -f "$KERNEL/Documentation/arm/README" ]; then echo "You haven't changed KERNEL to point at a valid kernel tree" exit 1 fi if [ ! -f $SOURCE_DIR/binutils-$BINUTILS_VERSION.tar.gz ]; then echo binutils-$BINUTILS_VERSION seems to be missing exit 1 fi if [ ! -f $SOURCE_DIR/gcc-$GCC_VERSION.tar.gz ]; then echo gcc-$GCC_VERSION seems to be missing exit 1 fi if [ ! -f $SOURCE_DIR/glibc-$GLIBC_VERSION.tar.gz ]; then echo glibc-$GLIBC_VERSION seems to be missing exit 1 fi if [ ! -f $SOURCE_DIR/glibc-linuxthreads-$GLIBC_LINUXTHREADS_VERSION.tar.gz ]; then echo glibc-linuxthreads-$GLIBC_LINUXTHREADS_VERSION seems to be missing exit 1 fi echo "done" # # binutils # echo -n "binutils..." [ -d $BUILD_DIR/binutils-$BINUTILS_VERSION ] || { echo -n "extracting..." cd $BUILD_DIR tar zxf $SOURCE_DIR/binutils-$BINUTILS_VERSION.tar.gz cd binutils-$BINUTILS_VERSION ./configure \ --disable-shared \ --target=$GNU_TARGET_NAME \ --prefix=$STAGING_DIR \ --enable-targets=$GNU_TARGET_NAME make make install } echo "done" # # gcc # echo -n "gcc..." [ -d $BUILD_DIR/gcc-$GCC_VERSION ] || { echo -n "extracting..." cd $BUILD_DIR tar zxf $SOURCE_DIR/gcc-$GCC_VERSION.tar.gz cd gcc-$GCC_VERSION # hack to build gcc without glibc perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc -D__gthr_posix_h/' gcc/config/arm/t-linux } echo "done" # gcc stage 1 echo -n "gcc-stage 1..." [ -d $BUILD_DIR/gcc-$GCC_VERSION-stage1-obj ] || { mkdir $BUILD_DIR/gcc-$GCC_VERSION-stage1-obj cd $BUILD_DIR/gcc-$GCC_VERSION-stage1-obj PATH=$PATH:$STAGING_DIR/bin \ AR=$GNU_TARGET_NAME-ar \ RANLIB=$GNU_TARGET_NAME-ranlib \ CC=$HOSTCC \ ../gcc-$GCC_VERSION/configure \ --target=$GNU_TARGET_NAME \ --prefix=$STAGING_DIR \ --enable-target-optspace \ --disable-nls \ --with-gnu-ld \ --disable-shared \ --enable-languages=c \ --with-headers=$KERNEL/include PATH=$PATH:$STAGING_DIR/bin make PATH=$PATH:$STAGING_DIR/bin make install } echo "done" # glibc-cross GLIBC=glibc-$GLIBC_VERSION GLIBC_LINUXTHREADS=glibc-linuxthreads-$GLIBC_LINUXTHREADS_VERSION echo -n "glibc..." [ -d $BUILD_DIR/$GLIBC ] || { cd $BUILD_DIR gzip -dc $SOURCE_DIR/$GLIBC.tar.gz | tar -xf - cd $BUILD_DIR/$GLIBC gzip -dc $SOURCE_DIR/$GLIBC_LINUXTHREADS.tar.gz | tar -xf - perl -pi -e 's/i386/arm*)\n\tlibc_cv_gcc_unwind_find_fde=yes\n\tarch_minimum_kernel=2.0.10\n\t;;\n i386/' sysdeps/unix/sysv/linux/configure perl -pi -e 's/weak_alias \(__old_sys_nerr/\/\/ $&/' sysdeps/unix/sysv/linux/arm/errlist.c cd $BUILD_DIR mkdir $GLIBC-obj cd $GLIBC-obj PATH=$PATH:$STAGING_DIR/bin \ AR=$GNU_TARGET_NAME-ar \ RANLIB=$GNU_TARGET_NAME-ranlib \ CC=$GNU_TARGET_NAME-gcc \ ../$GLIBC/configure $GNU_TARGET_NAME \ --build=$GNU_BUILD_NAME \ --host=$GNU_TARGET_NAME \ --prefix=$STAGING_DIR/$GNU_TARGET_NAME \ --enable-add-ons \ --disable-sanity-checks \ --enable-shared \ --with-headers=$KERNEL/include PATH=$PATH:$STAGING_DIR/bin make PATH=$PATH:$STAGING_DIR/bin make install } echo "done" # ld.so from glibc-cross: needs to be configured differently for the # target system (because of other paths) echo -n "ld.so..." [ -d $BUILD_DIR/$GLIBC-ldso ] || { mkdir $BUILD_DIR/$GLIBC-ldso cd $BUILD_DIR/$GLIBC-ldso PATH=$PATH:$STAGING_DIR/bin \ AR=$GNU_TARGET_NAME-ar \ RANLIB=$GNU_TARGET_NAME-ranlib \ CC=$GNU_TARGET_NAME-gcc \ ../$GLIBC/configure $GNU_TARGET_NAME \ --build=$GNU_BUILD_NAME \ --host=$GNU_TARGET_NAME \ --prefix= \ --enable-add-ons \ --disable-sanity-checks \ --enable-shared \ --with-headers=$KERNEL/include PATH=$PATH:$STAGING_DIR/bin make # CAREFUL: don't never ever make install here without install_root!!! mkdir -p $ROOT_DIR/lib cp elf/ld.so $ROOT_DIR/lib/ld-$GLIBC_VERSION.so } echo "done" # gcc stage 2 echo -n "gcc-stage 2..." [ -d $BUILD_DIR/gcc-$GCC_VERSION-stage2-obj ] || { mkdir $BUILD_DIR/gcc-$GCC_VERSION-stage2-obj cd $BUILD_DIR/gcc-$GCC_VERSION # remove glibc header hack perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC).*/$1/' gcc/config/arm/t-linux cd $BUILD_DIR/gcc-$GCC_VERSION-stage2-obj PATH=$STAGING_DIR/bin:$PATH \ AR=$GNU_TARGET_NAME-ar \ RANLIB=$GNU_TARGET_NAME-ranlib \ CC=$HOSTCC \ ../gcc-$GCC_VERSION/configure \ --target=$GNU_TARGET_NAME \ --prefix=$STAGING_DIR \ --enable-target-optspace \ --disable-nls \ --with-gnu-ld \ --disable-shared \ --enable-languages="c,c++" \ --with-headers=$KERNEL/include PATH=$PATH:$STAGING_DIR/bin make PATH=$PATH:$STAGING_DIR/bin make install } echo "done" __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ------------------------------------------------------------------- Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php ------------------------------------------------------------------- Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by