From b7109cf82e3f180c068b98065f596212ef6b2296 Mon Sep 17 00:00:00 2001 From: Yilin Sun via Newlib Date: Sun, 14 Aug 2022 00:22:50 +0800 Subject: [PATCH] SH: Do not build syscalls if option provided 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 --- 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.43.5