public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Yilin Sun <imi415@imi.moe>
To: newlib@sourceware.org
Subject: [PATCH] SH: Do not build syscalls if option provided
Date: Sun, 14 Aug 2022 00:22:50 +0800	[thread overview]
Message-ID: <20220813162250.125537-1-imi415@imi.moe> (raw)

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


             reply	other threads:[~2022-08-13 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13 16:22 Yilin Sun [this message]
2022-08-15 19:13 ` Jeff Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220813162250.125537-1-imi415@imi.moe \
    --to=imi415@imi.moe \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).