public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] SH: Do not build syscalls if option provided
@ 2022-08-13 16:22 Yilin Sun
  2022-08-15 19:13 ` Jeff Johnston
  0 siblings, 1 reply; 2+ messages in thread
From: Yilin Sun @ 2022-08-13 16:22 UTC (permalink / raw)
  To: newlib

This patch makes syscalls for SH architecture respecting the global option
"--disable-newlib-supplied-syscalls". This is useful when a bare-metal
toolchain is needed.

Signed-off-by: Yilin Sun <imi415@imi.moe>
---
 newlib/Makefile.in              | 12 ++++++------
 newlib/libc/sys/sh/Makefile.inc |  2 ++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index ad81c4fd7..f26d99ae9 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -552,7 +552,7 @@ check_PROGRAMS =
 @HAVE_LIBC_SYS_RDOS_DIR_TRUE@	libc/sys/rdos/wait.c libc/sys/rdos/write.c
 
 @HAVE_LIBC_SYS_RTEMS_DIR_TRUE@am__append_56 = libc/sys/rtems/dummysys.c libc/sys/rtems/cpusetalloc.c libc/sys/rtems/cpusetfree.c
-@HAVE_LIBC_SYS_SH_DIR_TRUE@am__append_57 = libc/sys/sh/syscalls.c libc/sys/sh/trap.S libc/sys/sh/creat.c libc/sys/sh/ftruncate.c libc/sys/sh/truncate.c
+@HAVE_LIBC_SYS_SH_DIR_TRUE@@MAY_SUPPLY_SYSCALLS_TRUE@am__append_57 = libc/sys/sh/syscalls.c libc/sys/sh/trap.S libc/sys/sh/creat.c libc/sys/sh/ftruncate.c libc/sys/sh/truncate.c
 @HAVE_LIBC_SYS_SYSMEC_DIR_TRUE@am__append_58 = \
 @HAVE_LIBC_SYS_SYSMEC_DIR_TRUE@	libc/sys/sysmec/_exit.c libc/sys/sysmec/access.c libc/sys/sysmec/chmod.c libc/sys/sysmec/chown.c libc/sys/sysmec/close.c libc/sys/sysmec/creat.c libc/sys/sysmec/crt1.c \
 @HAVE_LIBC_SYS_SYSMEC_DIR_TRUE@	libc/sys/sysmec/execv.c libc/sys/sysmec/execve.c libc/sys/sysmec/fork.c libc/sys/sysmec/fstat.c libc/sys/sysmec/getpid.c libc/sys/sysmec/isatty.c \
@@ -1661,11 +1661,11 @@ am__objects_51 = libc/ssp/libc_a-chk_fail.$(OBJEXT) \
 @HAVE_LIBC_SYS_RTEMS_DIR_TRUE@am__objects_66 = libc/sys/rtems/libc_a-dummysys.$(OBJEXT) \
 @HAVE_LIBC_SYS_RTEMS_DIR_TRUE@	libc/sys/rtems/libc_a-cpusetalloc.$(OBJEXT) \
 @HAVE_LIBC_SYS_RTEMS_DIR_TRUE@	libc/sys/rtems/libc_a-cpusetfree.$(OBJEXT)
-@HAVE_LIBC_SYS_SH_DIR_TRUE@am__objects_67 = libc/sys/sh/libc_a-syscalls.$(OBJEXT) \
-@HAVE_LIBC_SYS_SH_DIR_TRUE@	libc/sys/sh/libc_a-trap.$(OBJEXT) \
-@HAVE_LIBC_SYS_SH_DIR_TRUE@	libc/sys/sh/libc_a-creat.$(OBJEXT) \
-@HAVE_LIBC_SYS_SH_DIR_TRUE@	libc/sys/sh/libc_a-ftruncate.$(OBJEXT) \
-@HAVE_LIBC_SYS_SH_DIR_TRUE@	libc/sys/sh/libc_a-truncate.$(OBJEXT)
+@HAVE_LIBC_SYS_SH_DIR_TRUE@@MAY_SUPPLY_SYSCALLS_TRUE@am__objects_67 = libc/sys/sh/libc_a-syscalls.$(OBJEXT) \
+@HAVE_LIBC_SYS_SH_DIR_TRUE@@MAY_SUPPLY_SYSCALLS_TRUE@	libc/sys/sh/libc_a-trap.$(OBJEXT) \
+@HAVE_LIBC_SYS_SH_DIR_TRUE@@MAY_SUPPLY_SYSCALLS_TRUE@	libc/sys/sh/libc_a-creat.$(OBJEXT) \
+@HAVE_LIBC_SYS_SH_DIR_TRUE@@MAY_SUPPLY_SYSCALLS_TRUE@	libc/sys/sh/libc_a-ftruncate.$(OBJEXT) \
+@HAVE_LIBC_SYS_SH_DIR_TRUE@@MAY_SUPPLY_SYSCALLS_TRUE@	libc/sys/sh/libc_a-truncate.$(OBJEXT)
 @HAVE_LIBC_SYS_SYSMEC_DIR_TRUE@am__objects_68 = libc/sys/sysmec/libc_a-_exit.$(OBJEXT) \
 @HAVE_LIBC_SYS_SYSMEC_DIR_TRUE@	libc/sys/sysmec/libc_a-access.$(OBJEXT) \
 @HAVE_LIBC_SYS_SYSMEC_DIR_TRUE@	libc/sys/sysmec/libc_a-chmod.$(OBJEXT) \
diff --git a/newlib/libc/sys/sh/Makefile.inc b/newlib/libc/sys/sh/Makefile.inc
index d4081ec92..d4ea148f3 100644
--- a/newlib/libc/sys/sh/Makefile.inc
+++ b/newlib/libc/sys/sh/Makefile.inc
@@ -1 +1,3 @@
+if MAY_SUPPLY_SYSCALLS
 libc_a_SOURCES += %D%/syscalls.c %D%/trap.S %D%/creat.c %D%/ftruncate.c %D%/truncate.c
+endif
-- 
2.37.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-15 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-13 16:22 [PATCH] SH: Do not build syscalls if option provided Yilin Sun
2022-08-15 19:13 ` Jeff Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).