This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: Bare Bone Arm-Elf-Gcc
- From: "William A. Gatliff" <bgat at billgatliff dot com>
- To: David Mc Kenna <mckennad at esatclear dot ie>
- Cc: crossgcc at sources dot redhat dot com, newlib at sources dot redhat dot com
- Date: Thu, 6 Feb 2003 09:25:36 -0600
- Subject: Re: Bare Bone Arm-Elf-Gcc
- References: <3e416ee0.5328.0@esatclear.ie>
- Reply-to: bgat at billgatliff dot com
David:
I usually supply my own write_r et al functions. In addition, I
usually rebuild Newlib without RDP/RDI when I don't have Angel
around--- like when I'm testing my ARM7TDMI stub, to be out Real Soon
Now!
Rebuilding Newlib without RDP/RDI gets rid of all the SWIs that Angel
uses, but exposes a bug in the 1.10.0 startup code.
The code currently looks like this:
#else
/* Set up the stack pointer to a fixed value */
ldr r3, .LC0
mov sp, r3
...
.LC0:
#ifdef ARM_RDI_MONITOR
.word HeapBase
#else
#ifndef ARM_RDP_MONITOR
#ifdef __pe__
.word 0x800000
#else
/* .word 0x80000 */ /* Top of RAM on the PIE board. */
#endif
#endif
#endif
.LC1:
.word __bss_start__
...
Without RDP/RDI, the value of LCO is the start of .bss, which is
obviously wrong. As it turns out, it's also the end of .ctors, which
causes the system to crash during default constructors, if it gets
that far. :^)
The fix is to do something like this:
#ifndef ARM_RDP_MONITOR
#ifdef __pe__
.word 0x800000
#else
.word _stack
#endif
#endif
HTH,
b.g.
On Wed, Feb 05, 2003 at 08:06:56PM +0000, David Mc Kenna wrote:
> Hi all,
>
> I have successfully compiled gcc v3.2.1, binutils v2.13 and newlib v1.10 on
> cygwin for Arm-elf.
>
> From these programs I have compiled and run, on hardware, several programs doing
> math functions,etc. .
>
> I have come across problems when I try to do printf and scanf statements. My
> main problem is that from delving into newlib/libc/sys/arm/syscalls.c that printf
> and scanf require RDI or RDP i.e. Angel or Demon, installed on the chip, which
> I don't have.
>
> To get over this I have encoded a software UART using bit banging in assembly
> and I would like gcc to use this function by default for I/O from the chip.
>
>
> What is the easiest way to implement this? Is it by modifying syscalls.c or
> going in via libgloss?
>
> Below is my compile script
>
> Any help is appreciated
>
> Thanks,
> Dave
>
>
>
> cd $gccver
> ln -s ../$newlibver/newlib newlib
> ln -s ../$newlibver/libgloss libgloss
>
> cp /home/PCAdmin/script/t-arm-elf $src_root/$gccver/gcc/config/arm
>
>
> cd $src_root/BUILD/binutils && \rm -rf *
> ../../$binutilsver/configure \
> --with-included-gettext --enable-interwork --with-cpu=arm7tdmi \
> --target=$target --host=$host --build=$build --enable-multilib -disable-shared
> \
> --prefix=$prefix -v > ../logs/$target-$binutilsver-configure.log 2>&1
>
> # Make Binutils
>
> make -w all install > ../logs/$target-$binutilsver-make.log 2>&1
>
>
> cd $src_root/BUILD/gcc && rm -rf *
>
> $src_root/$gccver/configure \
> --with-newlib --without-headers --with-gnu-as --with-gnu-ld --enable-win32-registry
> \
> --target=$target --prefix=$prefix --exec-prefix=$prefix --host=$host
> \
> --enable-multilib --enable-interwork --disable-shared --enable-languages=c
> > ../logs/$target-$gccver-bootconf.log 2>&1
>
> make all-gcc install-gcc > ../logs/$target-$gccver-bootmake.log 2>&1
>
> cd $src_root/BUILD/newlib
> $src_root/$newlibver/configure --target=$target --prefix=$prefix > ../logs/$target-$newlibver-conf.log
> 2>&1
>
> make all install > ../logs/$target-$newlibver-make.log 2>&1
>
> cd $src_root/BUILD/gcc && rm -rf *
>
> $src_root/$gccver/configure \
> --enable-languages=c,c++ \
> --target=$target --host=$host --build=$build --enable-win32-registry \
> --with-newlib \
> --prefix=$prefix \
> --exec-prefix=$prefix \
> --enable-multilib --enable-interwork \
> --with-gnu-as --with-gnu-ld -v > ../logs/$target-$gccver-fullconf.log 2>&1
>
>
> make -w all-gcc install-gcc > ../logs/$target-$gccver-fullmake.log 2>&1
>
>
>
> --
> http://www.iol.ie
>
> ------
> Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
>
--
Bill Gatliff
Professional embedded Linux training.
http://billgatliff.com