2005-08-31 Paul Brook <paul@codesourcery.com>

* configure.host: Set have_crt0 to no for Arm targts when not
        providing syscalls.  Set sys_dir=arm unconditionally.
        Default have_crt0 based on sys_dir.
        * configure.in: Use have_crt0.
        * libc/configure.in: Ditto.
        * libc/sys/configure.in: Ditto.
        * configure: Regenerate.
        * libc/configure: Regenerate.
        * libc/sys/configure: Regenerate.
        * libc/sys/arm/Makefile.am (lib_a_SOURCES): Add aeabi_atexit.c.
        Only build other files when providing syscalls.
        * libc/sys/arm/Makefile.in: Regenerate.
        * libc/sys/arm/aeabi_atexit.c: New file.
This commit is contained in:
Jeff Johnston 2005-08-31 20:39:43 +00:00
parent 53fabb7b24
commit 45c8bb8f8c
11 changed files with 62 additions and 22 deletions

View File

@ -1,3 +1,19 @@
2005-08-31 Paul Brook <paul@codesourcery.com>
* configure.host: Set have_crt0 to no for Arm targts when not
providing syscalls. Set sys_dir=arm unconditionally.
Default have_crt0 based on sys_dir.
* configure.in: Use have_crt0.
* libc/configure.in: Ditto.
* libc/sys/configure.in: Ditto.
* configure: Regenerate.
* libc/configure: Regenerate.
* libc/sys/configure: Regenerate.
* libc/sys/arm/Makefile.am (lib_a_SOURCES): Add aeabi_atexit.c.
Only build other files when providing syscalls.
* libc/sys/arm/Makefile.in: Regenerate.
* libc/sys/arm/aeabi_atexit.c: New file.
2005-08-26 Christopher Faylor <cgf@timesys.com> 2005-08-26 Christopher Faylor <cgf@timesys.com>
* libc/include/string.h: Revert previous change. * libc/include/string.h: Revert previous change.

2
newlib/configure vendored
View File

@ -3205,7 +3205,7 @@ subdirs="${configdirs}"
CRT0= CRT0=
CRT0_DIR= CRT0_DIR=
if test -n "${sys_dir}"; then if test "x${have_crt0}" = "xyes"; then
CRT0=crt0.o CRT0=crt0.o
CRT0_DIR=libc/ CRT0_DIR=libc/
fi fi

View File

@ -42,6 +42,8 @@
# oext object file extension - needed for libtool support # oext object file extension - needed for libtool support
# crt1 name of crt1 object if one is provided # crt1 name of crt1 object if one is provided
# crt1_dir directory where crt1 object is found # crt1_dir directory where crt1 object is found
# have_crt0 "yes"/"no" if crt0 is/isn't provided.
# "" if crt0 is provided when sys_dir is set
newlib_cflags= newlib_cflags=
libm_machine_dir= libm_machine_dir=
@ -55,6 +57,7 @@ unix_dir=
mach_add_setjmp= mach_add_setjmp=
crt1= crt1=
crt1_dir= crt1_dir=
have_crt0=
use_libtool=no use_libtool=no
have_sys_mach_dir=no have_sys_mach_dir=no
default_newlib_io_long_long=no default_newlib_io_long_long=no
@ -318,8 +321,9 @@ case "${host}" in
sys_dir=arc sys_dir=arc
;; ;;
arm-*-*) arm-*-*)
if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
sys_dir=arm sys_dir=arm
if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
have_crt0="no"
fi fi
;; ;;
crx*) crx*)
@ -332,8 +336,9 @@ case "${host}" in
sys_dir= sys_dir=
;; ;;
ep9312-*-*) ep9312-*-*)
if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
sys_dir=arm sys_dir=arm
if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
have_crt0="no"
fi fi
;; ;;
frv*) frv*)
@ -413,13 +418,15 @@ case "${host}" in
unix_dir=unix unix_dir=unix
;; ;;
strongarm-*-*) strongarm-*-*)
if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
sys_dir=arm sys_dir=arm
if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
have_crt0="no"
fi fi
;; ;;
thumb-*-*) thumb-*-*)
if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
sys_dir=arm sys_dir=arm
if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
have_crt0="no"
fi fi
;; ;;
tic80*) tic80*)
@ -444,8 +451,9 @@ case "${host}" in
sys_dir=w65 sys_dir=w65
;; ;;
xscale-*-*) xscale-*-*)
if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then
sys_dir=arm sys_dir=arm
if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
have_crt0="no"
fi fi
;; ;;
z8k-*-coff) z8k-*-coff)
@ -725,3 +733,7 @@ if [ "x${newlib_io_pos_args}" = "x" ]; then
newlib_io_pos_args="yes"; newlib_io_pos_args="yes";
fi fi
fi fi
if test -z "${have_crt0}" && test -n "${sys_dir}"; then
have_crt0="yes"
fi

View File

@ -139,7 +139,7 @@ AC_CONFIG_SUBDIRS(${configdirs})
CRT0= CRT0=
CRT0_DIR= CRT0_DIR=
if test -n "${sys_dir}"; then if test "x${have_crt0}" = "xyes"; then
CRT0=crt0.o CRT0=crt0.o
CRT0_DIR=libc/ CRT0_DIR=libc/
fi fi

View File

@ -3006,7 +3006,7 @@ subdirs="machine sys"
CRT0= CRT0=
if test -n "${sys_dir}"; then if test "x${have_crt0}" = "xyes"; then
CRT0=crt0.o CRT0=crt0.o
fi fi

View File

@ -30,7 +30,7 @@ fi
AC_CONFIG_SUBDIRS(machine sys) AC_CONFIG_SUBDIRS(machine sys)
CRT0= CRT0=
if test -n "${sys_dir}"; then if test "x${have_crt0}" = "xyes"; then
CRT0=crt0.o CRT0=crt0.o
fi fi
AC_SUBST(CRT0) AC_SUBST(CRT0)

View File

@ -7,16 +7,18 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
noinst_LIBRARIES = lib.a noinst_LIBRARIES = lib.a
if MAY_SUPPLY_SYSCALLS if MAY_SUPPLY_SYSCALLS
extra_objs = syscalls.o extra_objs = libcfunc.o trap.o syscalls.o
else else
extra_objs = extra_objs =
endif endif
lib_a_SOURCES = libcfunc.c trap.S lib_a_SOURCES = aeabi_atexit.c
lib_a_LIBADD = $(extra_objs) lib_a_LIBADD = $(extra_objs)
lib_a_DEPENDENCIES = $(extra_objs) lib_a_DEPENDENCIES = $(extra_objs)
if MAY_SUPPLY_SYSCALLS
all: crt0.o all: crt0.o
endif
ACLOCAL_AMFLAGS = -I ../../.. ACLOCAL_AMFLAGS = -I ../../..
CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host

View File

@ -88,10 +88,10 @@ AUTOMAKE_OPTIONS = cygnus
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
noinst_LIBRARIES = lib.a noinst_LIBRARIES = lib.a
@MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = syscalls.o @MAY_SUPPLY_SYSCALLS_TRUE@extra_objs = libcfunc.o trap.o syscalls.o
@MAY_SUPPLY_SYSCALLS_FALSE@extra_objs = @MAY_SUPPLY_SYSCALLS_FALSE@extra_objs =
lib_a_SOURCES = libcfunc.c trap.S lib_a_SOURCES = aeabi_atexit.c
lib_a_LIBADD = $(extra_objs) lib_a_LIBADD = $(extra_objs)
lib_a_DEPENDENCIES = $(extra_objs) lib_a_DEPENDENCIES = $(extra_objs)
@ -106,7 +106,7 @@ LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) DEFS = @DEFS@ -I. -I$(srcdir)
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
lib_a_OBJECTS = libcfunc.o trap.o lib_a_OBJECTS = aeabi_atexit.o
CFLAGS = @CFLAGS@ CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC) CCLD = $(CC)
@ -325,7 +325,7 @@ mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean maintainer-clean-generic clean mostlyclean distclean maintainer-clean
all: crt0.o @MAY_SUPPLY_SYSCALLS_TRUE@all: crt0.o
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -0,0 +1,10 @@
#include <stdlib.h>
/* Register a function to be called by exit or when a shared library
is unloaded. This routine is like __cxa_atexit, but uses the
calling sequence required by the ARM EABI. */
int
__aeabi_atexit (void *arg, void (*func) (void *), void *d)
{
return __cxa_atexit (func, arg, d);
}

View File

@ -2993,7 +2993,7 @@ if test -n "${sys_dir}"; then
fi fi
CRT0= CRT0=
if test -n "${sys_dir}"; then if test "x${have_crt0}" = "xyes"; then
CRT0=crt0.o CRT0=crt0.o
fi fi

View File

@ -22,7 +22,7 @@ if test -n "${sys_dir}"; then
fi fi
CRT0= CRT0=
if test -n "${sys_dir}"; then if test "x${have_crt0}" = "xyes"; then
CRT0=crt0.o CRT0=crt0.o
fi fi
AC_SUBST(CRT0) AC_SUBST(CRT0)