This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: newlib and h8300s
- From: "George Gallant" <george dot gallant at coredgenetworks dot com>
- To: "'Jeff Johnston'" <jjohnstn at redhat dot com>
- Cc: <newlib at sourceware dot org>
- Date: Wed, 15 Nov 2006 14:56:35 -0600
- Subject: RE: newlib and h8300s
Jeff,
The problem is the "C" functions are generated with parameters passed on
the stack while the "S" functions use registers er0-er3. The default
4.1.1 compiler is stack based so the half dozen "S" function calls fail.
Adding the "-mquickcall" makes my app work with the "S" functions and fail
with the "C" functions.
My current solution is to generate newlib with "CFLAGS=-mquickcall". Another
solution (perhaps better) would be to make the default compiler be
QUICKCALL. As we no not need leading underscores and a compiler tends to be
used for a long time, compiler mods are ok.
George
-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On
Behalf Of Jeff Johnston
Sent: Wednesday, November 15, 2006 2:40 PM
To: George Gallant
Cc: newlib@sourceware.org
Subject: Re: newlib and h8300s
George Gallant wrote:
> I have built newlib-1.14.0 on both Linux and cygwin. Both cases seem
> identical. The problem I am facing is that some of the memxxx and strxxx
> functions are built using the registers er0-er2 while others are using the
> stack. libc.a contains a mixture.
>
> George
>
George,
You'll have to elaborate more. This is a problem because...? How
are you configuring?
By default, there are generic C implementations of the ANSI string
functions found in libc/string. A platform can override these routines
(and other ANSI functions) with specialized versions which can be
written in assembler or C. These routines are placed in the
machine-specific or system-specific directores and must have the same
name as the generic copies so that they form the same object name when
compiled as the generic C versions (e.g. memset.S or memset.c). At
build time, object files are gathered from the machine and sys
directories and they end up overwriting the objects created in the
various generic directories. In the case of h8300, the machine
directory is libc/machine/h8300. There you will find a few of the
string routines. If you need more, feel free to add. If those
implementations should not be built under your configurations, then we
can deal with that as well.
-- Jeff J.