newlib: xtensa: remove sys/xtensa. use machine/xtensa

Remove sys/xtensa that is actually duplicate newlib's code.
Move used code to machine/xtensa or to libgloss
This commit is contained in:
Alexey Lapshin 2024-08-30 09:35:24 +00:00 committed by Corinna Vinschen
parent f78009cb1c
commit 48f1655c95
15 changed files with 13 additions and 115 deletions

View File

@ -22,6 +22,7 @@ multilibtool_DATA += \
%D%/crt1-boards.o
%C%_libgloss_a_SOURCES = \
%D%/clibrary_init.c \
%D%/sleep.S \
%D%/syscalls.c \
%D%/window-vectors.S

View File

@ -1,6 +1,6 @@
/* Copyright (c) 2003-2006 Tensilica Inc. ALL RIGHTS RESERVED.
Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
@ -29,8 +29,8 @@ const char * __progname = 0;
void
__clibrary_init (int argc, char **argv, char **envp,
void (*init)(void),
void (*fini)(void))
void (*init)(void),
void (*fini)(void))
{
if (argv != 0)
__progname = *argv;

View File

@ -233,7 +233,11 @@ stmp-targ-include: config.status
fi
$(AM_V_at)s=machine/$(machine_dir)/machine d=machine $(TARG_INCLUDE_CP_DIR)
$(AM_V_at)s=machine/$(machine_dir)/sys d=sys $(TARG_INCLUDE_CP_DIR)
$(AM_V_at)s=machine/$(machine_dir)/include d= $(TARG_INCLUDE_CP_DIR)
$(AM_V_at)for i in $(call rwildcard,$(srcdir)/libc/machine/$(machine_dir)/include/,*.h); do \
f=`echo $$i | sed s:^$(srcdir)/libc/machine/$(machine_dir)/include/::`; \
$(MKDIR_P) targ-include/`dirname $$f`; \
cp $$i targ-include/$$f; \
done
$(AM_V_at)s=sys/$(sys_dir)/include d= $(TARG_INCLUDE_CP_DIR)
$(AM_V_at)for i in $(call rwildcard,$(srcdir)/libc/sys/$(sys_dir)/include/,*.h); do \
f=`echo $$i | sed s:^$(srcdir)/libc/sys/$(sys_dir)/include/::`; \

13
newlib/configure vendored
View File

@ -777,8 +777,6 @@ HAVE_LONG_DOUBLE_FALSE
HAVE_LONG_DOUBLE_TRUE
HAVE_LIBC_SYS_Z8KSIM_DIR_FALSE
HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE
HAVE_LIBC_SYS_XTENSA_DIR_FALSE
HAVE_LIBC_SYS_XTENSA_DIR_TRUE
HAVE_LIBC_SYS_W65_DIR_FALSE
HAVE_LIBC_SYS_W65_DIR_TRUE
HAVE_LIBC_SYS_TIRTOS_DIR_FALSE
@ -5513,13 +5511,6 @@ fi
else
HAVE_LIBC_SYS_W65_DIR_TRUE='#'
HAVE_LIBC_SYS_W65_DIR_FALSE=
fi
if test "${sys_dir}" = xtensa; then
HAVE_LIBC_SYS_XTENSA_DIR_TRUE=
HAVE_LIBC_SYS_XTENSA_DIR_FALSE='#'
else
HAVE_LIBC_SYS_XTENSA_DIR_TRUE='#'
HAVE_LIBC_SYS_XTENSA_DIR_FALSE=
fi
if test "${sys_dir}" = z8ksim; then
HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE=
@ -7708,10 +7699,6 @@ if test -z "${HAVE_LIBC_SYS_W65_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_W65_DIR_F
as_fn_error $? "conditional \"HAVE_LIBC_SYS_W65_DIR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LIBC_SYS_XTENSA_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_XTENSA_DIR_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBC_SYS_XTENSA_DIR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_Z8KSIM_DIR_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBC_SYS_Z8KSIM_DIR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -23,7 +23,6 @@ m4_foreach_w([SYS_DIR], [
sh sysmec sysnec810 sysnecv850 sysvi386 sysvnecv70
tic80 tirtos
w65
xtensa
z8ksim
], [AM_CONDITIONAL([HAVE_LIBC_SYS_]m4_toupper(SYS_DIR)[_DIR], test "${sys_dir}" = SYS_DIR)])

View File

@ -26,8 +26,8 @@
OF THE POSSIBILITY OF SUCH DAMAGE. */
#ifndef _FENV_H
#define _FENV_H
#ifndef _SYS_FENV_H
#define _SYS_FENV_H
#ifdef __cplusplus
extern "C" {
@ -85,4 +85,4 @@ int fegetexcept(void);
}
#endif
#endif
#endif // _SYS_FENV_H

View File

@ -64,9 +64,6 @@ endif
if HAVE_LIBC_SYS_W65_DIR
include %D%/w65/Makefile.inc
endif
if HAVE_LIBC_SYS_XTENSA_DIR
include %D%/xtensa/Makefile.inc
endif
if HAVE_LIBC_SYS_Z8KSIM_DIR
include %D%/z8ksim/Makefile.inc
endif

View File

@ -1 +0,0 @@
libc_a_SOURCES += %D%/creat.c %D%/isatty.c %D%/clibrary_init.c

View File

@ -1,9 +0,0 @@
/* creat() "system call" (copied from libc/posix/creat.c) */
#include <fcntl.h>
int
creat (const char *path, mode_t mode)
{
return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
}

View File

@ -1,16 +0,0 @@
/* Dummy crt0 code. */
/* Copyright (c) 2003 by Tensilica Inc. ALL RIGHTS RESERVED.
These coded instructions, statements, and computer programs are the
copyrighted works and confidential proprietary information of Tensilica Inc.
They may not be modified, copied, reproduced, distributed, or disclosed to
third parties in any manner, medium, or form, in whole or in part, without
the prior written consent of Tensilica Inc. */
/* Xtensa systems normally use a crt1 file associated with a particular
linker support package (LSP). There is no need for this crt0 file,
except that the newlib makefiles require it to exist if there is a
sys/xtensa directory. The directory exists only to hold the header
files for the Xtensa ISS semihosting "platform". */
void crt0_unused (void) {}

View File

@ -1,13 +0,0 @@
#ifndef _UNISTD_H_
#define _UNISTD_H_
# include <sys/unistd.h>
#ifndef L_SET
/* Old BSD names for the same constants; just for compatibility. */
#define L_SET SEEK_SET
#define L_INCR SEEK_CUR
#define L_XTND SEEK_END
#endif
#endif /* _UNISTD_H_ */

View File

@ -1,18 +0,0 @@
/* isatty.c */
/* Dumb implementation so programs will at least run. */
#include <sys/stat.h>
#include <reent.h>
int
_isatty_r (struct _reent *ptr, int fd)
{
struct stat buf;
if (_fstat_r (ptr, fd, &buf) < 0)
return 0;
if (S_ISCHR (buf.st_mode))
return 1;
return 0;
}

View File

@ -1,33 +0,0 @@
/* Copyright (c) 2005-2006 Tensilica Inc. ALL RIGHTS RESERVED.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TENSILICA
INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
#include <sys/fcntl.h>
/* Alternate names for values for the WHENCE argument to `lseek'.
These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
#ifndef L_SET
#define L_SET 0 /* Seek from beginning of file. */
#define L_INCR 1 /* Seek from current position. */
#define L_XTND 2 /* Seek from end of file. */
#endif

View File

@ -2,7 +2,7 @@ AC_CACHE_CHECK([for XCHAL_HAVE_FP_SQRT], newlib_cv_xchal_have_fp_sqrt, [dnl
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
[[#define _LIBM
// targ-include does not exist yet, use relative path
#include "../sys/xtensa/include/xtensa/config/core-isa.h"
#include "../machine/xtensa/include/xtensa/config/core-isa.h"
#if (!XCHAL_HAVE_FP_SQRT)
# error "Have not XCHAL_HAVE_FP_SQRT"
#endif