20000317 sourceware import

This commit is contained in:
Ranjith Kumaran
2000-03-17 22:48:54 +00:00
parent fae4c299f1
commit 03261851a1
420 changed files with 66815 additions and 0 deletions

View File

@ -0,0 +1,144 @@
# Copyright (c) 1998 Cygnus Support
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
# that existing copyright notices are retained in all copies and that this
# notice is included verbatim in any distributions. No written agreement,
# license, or royalty fee is required for any of the authorized uses.
# Modifications to this software may be copyrighted by their authors
# and need not follow the licensing terms described here, provided that
# the new terms are clearly indicated on the first page of each file where
# they apply.
VPATH = @srcdir@
srcdir = @srcdir@
objdir = .
srcroot = $(srcdir)/../..
objroot = $(objdir)/../..
prefix = @prefix@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
program_transform_name = @program_transform_name@
bindir = @bindir@
libdir = @libdir@
tooldir = $(exec_prefix)/$(target_alias)
# Multilib support variables.
# TOP is used instead of MULTI{BUILD,SRC}TOP.
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
SHELL = /bin/sh
CC = @CC@
#AS = @AS@
AS = `if [ -f ${objroot}/../gas/as.new ] ; \
then echo ${objroot}/../gas/as.new ; \
else echo as ; fi`
AR = @AR@
#LD = @LD@
LD = `if [ -f ${objroot}/../ld/ld.new ] ; \
then echo ${objroot}/../ld/ld.new ; \
else echo ld ; fi`
RANLIB = @RANLIB@
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
then echo ${objroot}/../binutils/objdump ; \
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
then echo ${objroot}/../binutils/objcopy ; \
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
# object files needed
OBJS = close.o environ.o execve.o fork.o fstat.o getpid.o gettod.o isatty.o \
kill.o link.o lseek.o open.o read.o sbrk.o stat.o \
times.o unlink.o wait.o write.o
# Object files specific to particular targets.
EVALOBJS = ${OBJS}
GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \
then echo -L${objroot}/../gcc ; fi`
OUTPUTS = libnosys.a
NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi`
NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi`
INCLUDES = -I. -I$(srcdir)/..
# Note that when building the library, ${MULTILIB} is not the way multilib
# options are passed; they're passed in $(CFLAGS).
CFLAGS_FOR_TARGET = ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS}
LDFLAGS_FOR_TARGET = ${MULTILIB} ${NEWLIB_LDFLAGS}
AR_FLAGS = qc
.c.o:
$(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
.C.o:
$(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $<
.s.o:
$(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $<
#
# GCC knows to run the preprocessor on .S files before it assembles them.
#
.S.o:
$(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $<
#
# this is a bogus target that'll produce an assembler from the
# C source with the right compiler options. this is so we can
# track down code generation or debug symbol bugs.
#
.c.s:
$(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $<
all: ${OUTPUTS}
#
# here's where we build the library for each target
#
libnosys.a: $(EVALOBJS)
${AR} ${ARFLAGS} $@ $(EVALOBJS)
${RANLIB} $@
doc:
clean mostlyclean:
rm -f $(OUTPUTS) *.i *~ *.o *-test *.srec *.dis *.map *.x
distclean maintainer-clean realclean: clean
rm -f Makefile config.status $(OUTPUTS)
.PHONY: install info install-info clean-info
install:
@for outputs in ${OUTPUTS}; do\
mkdir -p $(tooldir)/lib${MULTISUBDIR}; \
$(INSTALL_PROGRAM) $${outputs} $(tooldir)/lib${MULTISUBDIR}; \
done
info:
install-info:
clean-info:
Makefile: Makefile.in config.status @host_makefile_frag_path@
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck

View File

@ -0,0 +1,23 @@
/* Name of package. */
#undef PACKAGE
/* Version of package. */
#undef VERSION
/* Missing syscall names */
#undef MISSING_SYSCALL_NAMES
/* Using ELF format */
#undef HAVE_ELF
/* Using GNU LD */
#undef HAVE_GNU_LD
/* .previous directive allowed */
#undef HAVE_ASM_PREVIOUS_DIRECTIVE
/* .pushsection/.popsection directives allowed */
#undef HAVE_ASM_POPSECTION_DIRECTIVE
/* symbol prefix */
#undef __SYMBOL_PREFIX

21
libgloss/libnosys/close.c Normal file
View File

@ -0,0 +1,21 @@
/*
* Stub version of close.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_close, (fildes),
int fildes)
{
errno = ENOSYS;
return -1;
}
stub_warning (_close)

View File

@ -0,0 +1,19 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Missing syscall names */
#undef MISSING_SYSCALL_NAMES
/* Using ELF format */
#undef HAVE_ELF
/* Using GNU LD */
#undef HAVE_GNU_LD
/* .previous directive allowed */
#undef HAVE_ASM_PREVIOUS_DIRECTIVE
/* .pushsection/.popsection directives allowed */
#undef HAVE_ASM_POPSECTION_DIRECTIVE
/* symbol prefix */
#undef __SYMBOL_PREFIX

1439
libgloss/libnosys/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,206 @@
# Copyright (c) 1995, 1996 Cygnus Support
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provided
# that existing copyright notices are retained in all copies and that this
# notice is included verbatim in any distributions. No written agreement,
# license, or royalty fee is required for any of the authorized uses.
# Modifications to this software may be copyrighted by their authors
# and need not follow the licensing terms described here, provided that
# the new terms are clearly indicated on the first page of each file where
# they apply.
#
# Process this file with autoconf to produce a configure script.
#
AC_PREREQ(2.5)dnl
AC_INIT(close.c)
AC_CONFIG_HEADER(config.h)
if test "${enable_shared}" = "yes" ; then
echo "Shared libraries not supported for cross compiling, ignored"
fi
if test "$srcdir" = "." ; then
if test "${with_target_subdir}" != "." ; then
libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
else
libgloss_topdir="${srcdir}/${with_multisrctop}../.."
fi
else
libgloss_topdir="${srcdir}/../.."
fi
AC_CONFIG_AUX_DIR($libgloss_topdir)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AC_PROG_INSTALL
# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are building a library that must be included in all links, so we
# can't link an executable until this lib is built.
# autoconf should provide a way to do this.
AC_DEFUN(LIB_AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_PROG(CC, gcc, gcc)
if test -z "$CC"; then
AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi
AC_PROG_CC_GNU
if test $ac_cv_prog_gcc = yes; then
GCC=yes
dnl Check whether -g works, even if CFLAGS is set, in case the package
dnl plays around with CFLAGS (such as to build both debugging and
dnl normal versions of a library), tasteless as that idea is.
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
AC_PROG_CC_G
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-O2"
fi
else
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
])
AC_DEFINE(HAVE_GNU_LD)
dnl Make sure syscall names match those being used by newlib
case "${target}" in
*-*-cygwin*)
;;
a29k-amd-udi)
;;
arc-*-*)
;;
arm-*-pe)
;;
arm-*-*)
;;
strongarm-*-*)
;;
d10v*)
;;
h8300*-*-*)
;;
h8500-*-*)
;;
i[3456]86-*-sco*)
;;
m32r-*-*)
;;
mn10?00-*-*)
;;
powerpcle-*-pe)
;;
sh*-*-*)
;;
sparc-sun-sunos*)
;;
sparc64-*-*)
;;
thumb-*-pe)
;;
thumb-*-*)
;;
v850-*-*)
;;
v850e-*-*)
;;
v850ea-*-*)
;;
w65-*-*)
;;
z8k-*-*)
;;
*)
AC_DEFINE(MISSING_SYSCALL_NAMES)
;;
esac
dnl Make sure we know if elf format used
case "${target}" in
*-*-elf)
AC_DEFINE(HAVE_ELF)
AC_CACHE_CHECK(for .previous assembler directive,
libc_cv_asm_previous_directive, [dnl
cat > conftest.s <<EOF
.section foo_section
.previous
EOF
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
else
rm -f conftest*])
AC_CACHE_CHECK(for .popsection assembler directive,
libc_cv_asm_popsection_directive, [dnl
cat > conftest.s <<EOF
.pushsection foo_section
.popsection
EOF
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
fi
fi
rm -f conftest*])
;;
esac
AC_CACHE_CHECK(for function prefix, libc_dollar_prefix, [dnl
cat > conftest.c <<\EOF
foo () { }
EOF
dnl
if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo" > /dev/null]);
then
libc_dollar_prefix=yes
else
libc_dollar_prefix=no
fi
rm -f conftest* ])
if test $libc_dollar_prefix = yes ; then
AC_DEFINE(__SYMBOL_PREFIX, "$")
else
AC_DEFINE(__SYMBOL_PREFIX, "")
fi
LIB_AC_PROG_CC
AS=${AS-as}
AC_SUBST(AS)
AR=${AR-ar}
AC_SUBST(AR)
LD=${LD-ld}
AC_SUBST(LD)
AC_PROG_RANLIB
host_makefile_frag=${srcdir}/../config/default.mh
dnl We have to assign the same value to other variables because autoconf
dnl doesn't provide a mechanism to substitute a replacement keyword with
dnl arbitrary data or pathnames.
dnl
host_makefile_frag_path=$host_makefile_frag
AC_SUBST(host_makefile_frag_path)
AC_SUBST_FILE(host_makefile_frag)
AC_OUTPUT(Makefile,
ac_file=Makefile . ${libgloss_topdir}/config-ml.in,
srcdir=${srcdir}
target=${target}
ac_configure_args="${ac_configure_args} --enable-multilib"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
libgloss_topdir=${libgloss_topdir}
)

View File

@ -0,0 +1,6 @@
/*
* Version of environ for no OS.
*/
char *__env[1] = { 0 };
char **environ = __env;

View File

@ -0,0 +1,23 @@
/*
* Stub version of execve.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_execve, (name, argv, env),
char *name _AND
char **argv _AND
char **env)
{
errno = ENOSYS;
return -1;
}
stub_warning(_execve)

21
libgloss/libnosys/fork.c Normal file
View File

@ -0,0 +1,21 @@
/*
* Stub version of fork.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_fork, (),
_NOARGS)
{
errno = ENOSYS;
return -1;
}
stub_warning(_fork)

24
libgloss/libnosys/fstat.c Normal file
View File

@ -0,0 +1,24 @@
/*
* Stub version of fstat.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_fstat, (fildes, st),
int fildes _AND
struct stat *st)
{
errno = ENOSYS;
return -1;
}
stub_warning(_fstat)

View File

@ -0,0 +1,21 @@
/*
* Stub version of getpid.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_getpid, (),
_NOARGS)
{
errno = ENOSYS;
return -1;
}
stub_warning(_getpid)

View File

@ -0,0 +1,27 @@
/*
* Stub version of gettimeofday.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <sys/time.h>
#include <sys/times.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
struct timeval;
struct timezone;
int
_DEFUN (_gettimeofday, (ptimeval, ptimezone),
struct timeval *ptimeval _AND
struct timezone *ptimezone)
{
errno = ENOSYS;
return -1;
}
stub_warning(_gettimeofday)

View File

@ -0,0 +1,21 @@
/*
* Stub version of isatty.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (isatty, (file),
int file)
{
errno = ENOSYS;
return 0;
}
stub_warning(isatty)

22
libgloss/libnosys/kill.c Normal file
View File

@ -0,0 +1,22 @@
/*
* Stub version of kill.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_kill, (pid, sig),
int pid _AND
int sig)
{
errno = ENOSYS;
return -1;
}
stub_warning(_kill)

22
libgloss/libnosys/link.c Normal file
View File

@ -0,0 +1,22 @@
/*
* Stub version of link.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_link, (existing, new),
char *existing _AND
char *new)
{
errno = ENOSYS;
return -1;
}
stub_warning(_link)

23
libgloss/libnosys/lseek.c Normal file
View File

@ -0,0 +1,23 @@
/*
* Stub version of lseek.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_lseek, (file, ptr, dir),
int file _AND
int ptr _AND
int dir)
{
errno = ENOSYS;
return -1;
}
stub_warning(_lseek)

23
libgloss/libnosys/open.c Normal file
View File

@ -0,0 +1,23 @@
/*
* Stub version of open.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_open, (file, flags, mode),
char *file _AND
int flags _AND
int mode)
{
errno = ENOSYS;
return -1;
}
stub_warning(_open)

23
libgloss/libnosys/read.c Normal file
View File

@ -0,0 +1,23 @@
/*
* Stub version of read.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_read, (file, ptr, len),
int file _AND
char *ptr _AND
int len)
{
errno = ENOSYS;
return -1;
}
stub_warning(_read)

27
libgloss/libnosys/sbrk.c Normal file
View File

@ -0,0 +1,27 @@
/*
* Version of sbrk for no operating system.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <sys/types.h>
#include <errno.h>
#undef errno
extern int errno;
caddr_t
_DEFUN (_sbrk, (incr),
int incr)
{
extern char end; /* set by linker */
static char *heap_end;
char *prev_heap_end;
if (heap_end == 0) {
heap_end = &end;
}
prev_heap_end = heap_end;
heap_end += incr;
return (caddr_t) prev_heap_end;
}

24
libgloss/libnosys/stat.c Normal file
View File

@ -0,0 +1,24 @@
/*
* Stub version of stat.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_stat, (file, st),
const char *file _AND
struct stat *st)
{
errno = ENOSYS;
return -1;
}
stub_warning(_stat)

22
libgloss/libnosys/times.c Normal file
View File

@ -0,0 +1,22 @@
/*
* Stub version of times.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <sys/times.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
clock_t
_DEFUN (_times, (buf),
struct tms *buf)
{
errno = ENOSYS;
return -1;
}
stub_warning(_times)

View File

@ -0,0 +1,21 @@
/*
* Stub version of unlink.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_unlink, (name),
char *name)
{
errno = ENOSYS;
return -1;
}
stub_warning(_unlink)

21
libgloss/libnosys/wait.c Normal file
View File

@ -0,0 +1,21 @@
/*
* Stub version of wait.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_wait, (status),
int *status)
{
errno = ENOSYS;
return -1;
}
stub_warning(_wait)

View File

@ -0,0 +1,39 @@
#ifndef __WARNING_H__
#define __WARNING_H__
#ifdef HAVE_GNU_LD
# ifdef HAVE_ELF
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
# ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
# define __make_section_unallocated(section_string) \
asm(".section " section_string "; .previous");
# elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
# define __make_section_unallocated(section_string) \
asm(".pushsection " section_string "; .popsection");
# else
# define __make_section_unallocated(section_string)
# endif
# define link_warning(symbol, msg) \
__make_section_unallocated (".gnu.warning." #symbol) \
static const char __evoke_link_warning_##symbol[] \
__attribute__ ((section (".gnu.warning." #symbol))) = msg;
#else /* !ELF */
# define link_warning(symbol, msg) \
asm(".stabs \"" msg "\",30,0,0,0\n" \
".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
# endif
#else /* !GNULD */
/* We will never be heard; they will all die horribly. */
# define link_warning(symbol, msg)
#endif
/* A canned warning for sysdeps/stub functions. */
#define stub_warning(name) \
link_warning (name, \
"warning: " #name " is not implemented and will always fail")
#endif /* __WARNING_H__ */

24
libgloss/libnosys/write.c Normal file
View File

@ -0,0 +1,24 @@
/*
* Stub version of write.
*/
#include "config.h"
#include <_ansi.h>
#include <_syslist.h>
#include <errno.h>
#undef errno
extern int errno;
#include "warning.h"
int
_DEFUN (_write, (file, ptr, len),
int file _AND
char *ptr _AND
int len)
{
errno = ENOSYS;
return -1;
}
stub_warning(_write)