Re: [PATCH] SH: Do not build syscalls if option provided

Jeff Johnston <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAOox84vureMtgSbOeNhX4uA34WFyFObQx6Ze0z8eyC9WubEqKg@mail.gmail.com>
Thanks Yilin, patch pushed to master.

-- Jeff J.

On Sat, Aug 13, 2022 at 12:23 PM Yilin Sun via Newlib <[email protected]>
wrote:

> 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 <[email protected]>
> ---
>  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
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.