mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 08:46:17 +08:00
newlib: convert INTERNAL_NEWLIB to _LIBC
Since we already set up _LIBC to indicate source files are building for newlib, we don't need this malloc-specific symbol. Convert it over to simplify the build a bit.
This commit is contained in:
parent
e15b2e8691
commit
dea52d5c1e
@ -208,43 +208,41 @@ lib_a_CFLAGS = $(AM_CFLAGS)
|
|||||||
lib_a_DEPENDENCIES = $(LIBADD_OBJS) $(ELIX_OBJS)
|
lib_a_DEPENDENCIES = $(LIBADD_OBJS) $(ELIX_OBJS)
|
||||||
LIB_COMPILE = $(AM_V_CC)$(COMPILE)
|
LIB_COMPILE = $(AM_V_CC)$(COMPILE)
|
||||||
|
|
||||||
MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB
|
|
||||||
|
|
||||||
$(lpfx)$(MALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(MALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(FREER).o: $(MALLOCR).c
|
$(lpfx)$(FREER).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_FREE -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(REALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(REALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(CALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(CALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(CFREER).o: $(MALLOCR).c
|
$(lpfx)$(CFREER).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_CFREE -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALIGNR).o: $(MALLOCR).c
|
$(lpfx)$(MALIGNR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(VALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(VALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(PVALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(PVALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALLINFOR).o: $(MALLOCR).c
|
$(lpfx)$(MALLINFOR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALLSTATSR).o: $(MALLOCR).c
|
$(lpfx)$(MALLSTATSR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MSIZER).o: $(MALLOCR).c
|
$(lpfx)$(MSIZER).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALLOPTR).o: $(MALLOCR).c
|
$(lpfx)$(MALLOPTR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)dtoa.o: dtoa.c mprec.h
|
$(lpfx)dtoa.o: dtoa.c mprec.h
|
||||||
$(lpfx)ldtoa.o: ldtoa.c mprec.h gdtoa.h
|
$(lpfx)ldtoa.o: ldtoa.c mprec.h gdtoa.h
|
||||||
|
@ -513,7 +513,6 @@ lib_a_LIBADD = $(LIBADD_OBJS) $(ELIX_OBJS)
|
|||||||
lib_a_CFLAGS = $(AM_CFLAGS)
|
lib_a_CFLAGS = $(AM_CFLAGS)
|
||||||
lib_a_DEPENDENCIES = $(LIBADD_OBJS) $(ELIX_OBJS)
|
lib_a_DEPENDENCIES = $(LIBADD_OBJS) $(ELIX_OBJS)
|
||||||
LIB_COMPILE = $(AM_V_CC)$(COMPILE)
|
LIB_COMPILE = $(AM_V_CC)$(COMPILE)
|
||||||
MALLOC_COMPILE = $(LIB_COMPILE) -DINTERNAL_NEWLIB
|
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
@ -1501,40 +1500,40 @@ uninstall-am:
|
|||||||
|
|
||||||
|
|
||||||
$(lpfx)$(MALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(MALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(FREER).o: $(MALLOCR).c
|
$(lpfx)$(FREER).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_FREE -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_FREE -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(REALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(REALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_REALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(CALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(CALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_CALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(CFREER).o: $(MALLOCR).c
|
$(lpfx)$(CFREER).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_CFREE -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_CFREE -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALIGNR).o: $(MALLOCR).c
|
$(lpfx)$(MALIGNR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MEMALIGN -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(VALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(VALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_VALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(PVALLOCR).o: $(MALLOCR).c
|
$(lpfx)$(PVALLOCR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALLINFOR).o: $(MALLOCR).c
|
$(lpfx)$(MALLINFOR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALLSTATSR).o: $(MALLOCR).c
|
$(lpfx)$(MALLSTATSR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MSIZER).o: $(MALLOCR).c
|
$(lpfx)$(MSIZER).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)$(MALLOPTR).o: $(MALLOCR).c
|
$(lpfx)$(MALLOPTR).o: $(MALLOCR).c
|
||||||
$(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
|
$(LIB_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/$(MALLOCR).c -o $@
|
||||||
|
|
||||||
$(lpfx)dtoa.o: dtoa.c mprec.h
|
$(lpfx)dtoa.o: dtoa.c mprec.h
|
||||||
$(lpfx)ldtoa.o: ldtoa.c mprec.h gdtoa.h
|
$(lpfx)ldtoa.o: ldtoa.c mprec.h gdtoa.h
|
||||||
|
@ -209,7 +209,7 @@ int _dummy_mallocr = 1;
|
|||||||
(for example, internally, `malloc' is named `mALLOc') needed
|
(for example, internally, `malloc' is named `mALLOc') needed
|
||||||
when compiling in this case. These look funny but don't otherwise
|
when compiling in this case. These look funny but don't otherwise
|
||||||
affect anything.
|
affect anything.
|
||||||
INTERNAL_NEWLIB (default: NOT defined)
|
_LIBC (default: NOT defined)
|
||||||
Defined only when compiled as part of the Cygnus newlib
|
Defined only when compiled as part of the Cygnus newlib
|
||||||
distribution.
|
distribution.
|
||||||
WIN32 (default: undefined)
|
WIN32 (default: undefined)
|
||||||
@ -291,7 +291,7 @@ extern "C" {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef INTERNAL_NEWLIB
|
#ifdef _LIBC
|
||||||
|
|
||||||
#include <sys/config.h>
|
#include <sys/config.h>
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ extern void __malloc_unlock();
|
|||||||
#define RCALL reent_ptr,
|
#define RCALL reent_ptr,
|
||||||
#define RONECALL reent_ptr
|
#define RONECALL reent_ptr
|
||||||
|
|
||||||
#else /* ! INTERNAL_NEWLIB */
|
#else /* ! _LIBC */
|
||||||
|
|
||||||
#define POINTER_UINT unsigned long
|
#define POINTER_UINT unsigned long
|
||||||
#define RARG
|
#define RARG
|
||||||
@ -355,7 +355,7 @@ extern void __malloc_unlock();
|
|||||||
#define RCALL
|
#define RCALL
|
||||||
#define RONECALL
|
#define RONECALL
|
||||||
|
|
||||||
#endif /* ! INTERNAL_NEWLIB */
|
#endif /* ! _LIBC */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Debugging:
|
Debugging:
|
||||||
@ -953,7 +953,7 @@ Void_t *(*__morecore)() = __default_morecore_init;
|
|||||||
|
|
||||||
#else /* INTERNAL_LINUX_C_LIB */
|
#else /* INTERNAL_LINUX_C_LIB */
|
||||||
|
|
||||||
#ifndef INTERNAL_NEWLIB
|
#ifndef _LIBC
|
||||||
#if __STD_C
|
#if __STD_C
|
||||||
extern Void_t* sbrk(ptrdiff_t);
|
extern Void_t* sbrk(ptrdiff_t);
|
||||||
#else
|
#else
|
||||||
@ -1000,7 +1000,7 @@ extern Void_t* sbrk();
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef INTERNAL_NEWLIB
|
#ifdef _LIBC
|
||||||
|
|
||||||
#define cALLOc _calloc_r
|
#define cALLOc _calloc_r
|
||||||
#define fREe _free_r
|
#define fREe _free_r
|
||||||
@ -1026,7 +1026,7 @@ extern Void_t* sbrk();
|
|||||||
#define malloc_top_pad __malloc_top_pad
|
#define malloc_top_pad __malloc_top_pad
|
||||||
#define malloc_trim_threshold __malloc_trim_threshold
|
#define malloc_trim_threshold __malloc_trim_threshold
|
||||||
|
|
||||||
#else /* ! INTERNAL_NEWLIB */
|
#else /* ! _LIBC */
|
||||||
|
|
||||||
#define cALLOc calloc
|
#define cALLOc calloc
|
||||||
#define fREe free
|
#define fREe free
|
||||||
@ -1038,7 +1038,7 @@ extern Void_t* sbrk();
|
|||||||
#define mALLINFo mallinfo
|
#define mALLINFo mallinfo
|
||||||
#define mALLOPt mallopt
|
#define mALLOPt mallopt
|
||||||
|
|
||||||
#endif /* ! INTERNAL_NEWLIB */
|
#endif /* ! _LIBC */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Public routines */
|
/* Public routines */
|
||||||
@ -3274,14 +3274,14 @@ Void_t* cALLOc(RARG n, elem_size) RDECL size_t n; size_t elem_size;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(INTERNAL_LINUX_C_LIB) || !defined(__ELF__)
|
#if !defined(INTERNAL_LINUX_C_LIB) || !defined(__ELF__)
|
||||||
#if !defined(INTERNAL_NEWLIB) || !defined(_REENT_ONLY)
|
#if !defined(_LIBC) || !defined(_REENT_ONLY)
|
||||||
#if __STD_C
|
#if __STD_C
|
||||||
void cfree(Void_t *mem)
|
void cfree(Void_t *mem)
|
||||||
#else
|
#else
|
||||||
void cfree(mem) Void_t *mem;
|
void cfree(mem) Void_t *mem;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef INTERNAL_NEWLIB
|
#ifdef _LIBC
|
||||||
fREe(_REENT, mem);
|
fREe(_REENT, mem);
|
||||||
#else
|
#else
|
||||||
fREe(mem);
|
fREe(mem);
|
||||||
@ -3522,7 +3522,7 @@ void malloc_stats(RONEARG) RDECL
|
|||||||
#endif
|
#endif
|
||||||
MALLOC_UNLOCK;
|
MALLOC_UNLOCK;
|
||||||
|
|
||||||
#ifdef INTERNAL_NEWLIB
|
#ifdef _LIBC
|
||||||
_REENT_SMALL_CHECK_INIT(reent_ptr);
|
_REENT_SMALL_CHECK_INIT(reent_ptr);
|
||||||
fp = _stderr_r(reent_ptr);
|
fp = _stderr_r(reent_ptr);
|
||||||
#define fprintf fiprintf
|
#define fprintf fiprintf
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
#define _SBRK_R(X) _sbrk_r(X)
|
#define _SBRK_R(X) _sbrk_r(X)
|
||||||
|
|
||||||
#ifdef INTERNAL_NEWLIB
|
#ifdef _LIBC
|
||||||
|
|
||||||
#include <sys/config.h>
|
#include <sys/config.h>
|
||||||
#include <reent.h>
|
#include <reent.h>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
#define nano_mallinfo _mallinfo_r
|
#define nano_mallinfo _mallinfo_r
|
||||||
#define nano_mallopt _mallopt_r
|
#define nano_mallopt _mallopt_r
|
||||||
|
|
||||||
#else /* ! INTERNAL_NEWLIB */
|
#else /* ! _LIBC */
|
||||||
|
|
||||||
#define RARG
|
#define RARG
|
||||||
#define RONEARG
|
#define RONEARG
|
||||||
@ -100,7 +100,7 @@
|
|||||||
#define nano_malloc_stats malloc_stats
|
#define nano_malloc_stats malloc_stats
|
||||||
#define nano_mallinfo mallinfo
|
#define nano_mallinfo mallinfo
|
||||||
#define nano_mallopt mallopt
|
#define nano_mallopt mallopt
|
||||||
#endif /* ! INTERNAL_NEWLIB */
|
#endif /* ! _LIBC */
|
||||||
|
|
||||||
/* Redefine names to avoid conflict with user names */
|
/* Redefine names to avoid conflict with user names */
|
||||||
#define free_list __malloc_free_list
|
#define free_list __malloc_free_list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user