public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] define _COMPILING_NEWLIB for all targets when compiling
@ 2021-11-13  5:08 Michael Frysinger
  0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2021-11-13  5:08 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=372093689c07d7175f373abd054e22250a9f87fa

commit 372093689c07d7175f373abd054e22250a9f87fa
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Nov 8 19:23:33 2021 -0500

    define _COMPILING_NEWLIB for all targets when compiling
    
    The _COMPILING_NEWLIB symbol is for declaring "the code is being
    compiled for newlib itself" so headers can change behavior vs the
    header being used by users (who should get the normal clean API).
    Unfortunately, this symbol is defined inconsistently leading to it
    only being useful for a few subsections of the tree.
    
    Pull it out so that it's defined all the time for all targets.

Diff:
---
 newlib/configure.host                | 11 +++--------
 newlib/libc/machine/mips/Makefile.am |  2 --
 newlib/libc/machine/mips/Makefile.in |  2 --
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/newlib/configure.host b/newlib/configure.host
index ef481ff52..e737f73f5 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -54,7 +54,7 @@
 #   have_init_fini	have init/fini ("yes" or "no", set to "yes" by default)
 #   noinclude		list of include files to not install
 
-newlib_cflags=
+newlib_cflags="-D_COMPILING_NEWLIB"
 libm_machine_dir=
 machine_dir=
 shared_machine_dir=
@@ -467,15 +467,11 @@ case "${host}" in
 	sys_dir=a29khif
 	signal_dir=
 	;;
-  aarch64*-*-*)
-	newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB"
-	;;
   amdgcn*)
 	sys_dir=amdgcn
 	have_crt0="no"
 	;;
   arm*-*-*)
-	newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB"
 	sys_dir=arm
 	if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
 	  have_crt0="no"
@@ -652,11 +648,11 @@ case "${host}" in
 	default_newlib_io_long_double="yes"
 	default_newlib_io_pos_args="yes"
 	CC="${CC} -I${cygwin_srcdir}/include"
-	newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DGETREENT_PROVIDED -DSIGNAL_PROVIDED -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED"
+	newlib_cflags="${newlib_cflags} -DHAVE_OPENDIR -DHAVE_RENAME -DGETREENT_PROVIDED -DSIGNAL_PROVIDED -DHAVE_BLKSIZE -DHAVE_FCNTL -DMALLOC_PROVIDED"
 	syscall_dir=syscalls
 	;;
   *-*-phoenix*)
-	newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -D_COMPILING_NEWLIB -DHAVE_BLKSIZE -DHAVE_NANOSLEEP"
+	newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DHAVE_BLKSIZE -DHAVE_NANOSLEEP"
 	default_newlib_io_long_long="yes"
 	syscall_dir=
 	;;
@@ -671,7 +667,6 @@ case "${host}" in
 	default_newlib_io_long_long="yes"
 	default_newlib_io_c99_formats="yes"
 	newlib_cflags="${newlib_cflags} -ffunction-sections -fdata-sections "
-	newlib_cflags="${newlib_cflags} -D_COMPILING_NEWLIB"
 newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVIDED -DSIGNAL_PROVIDED -DGETREENT_PROVIDED -DREENTRANT_SYSCALLS_PROVIDED -DHAVE_NANOSLEEP -DHAVE_BLKSIZE -DHAVE_FCNTL -DHAVE_ASSERT_FUNC"
         # turn off unsupported items in posix directory 
 	newlib_cflags="${newlib_cflags} -D_NO_GETLOGIN -D_NO_GETPWENT -D_NO_GETUT -D_NO_GETPASS -D_NO_SIGSET -D_NO_WORDEXP -D_NO_POPEN -D_NO_POSIX_SPAWN"
diff --git a/newlib/libc/machine/mips/Makefile.am b/newlib/libc/machine/mips/Makefile.am
index 1695b18ff..17f78aad7 100644
--- a/newlib/libc/machine/mips/Makefile.am
+++ b/newlib/libc/machine/mips/Makefile.am
@@ -9,8 +9,6 @@ AM_CCASFLAGS = $(INCLUDES)
 noinst_LIBRARIES = lib.a
 
 lib_a_SOURCES = setjmp.S strlen.c strcmp.S strncpy.c memset.S memcpy.S
-lib_a_CCASFLAGS=$(AM_CCASFLAGS) -D_COMPILING_NEWLIB
-lib_a_CFLAGS=$(AM_CFLAGS) -D_COMPILING_NEWLIB
 
 ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
diff --git a/newlib/libc/machine/mips/Makefile.in b/newlib/libc/machine/mips/Makefile.in
index 5396e38ad..d3d900edc 100644
--- a/newlib/libc/machine/mips/Makefile.in
+++ b/newlib/libc/machine/mips/Makefile.in
@@ -198,8 +198,6 @@ INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 AM_CCASFLAGS = $(INCLUDES)
 noinst_LIBRARIES = lib.a
 lib_a_SOURCES = setjmp.S strlen.c strcmp.S strncpy.c memset.S memcpy.S
-lib_a_CCASFLAGS = $(AM_CCASFLAGS) -D_COMPILING_NEWLIB
-lib_a_CFLAGS = $(AM_CFLAGS) -D_COMPILING_NEWLIB
 ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
 CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host
 all: all-am


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-13  5:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-13  5:08 [newlib-cygwin] define _COMPILING_NEWLIB for all targets when compiling Michael Frysinger

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).