Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-03-01 08:58:55 +0300
committerMike Frysinger <vapier@gentoo.org>2022-03-14 00:12:03 +0300
commit5cd957ff66a9bbd5532a2b00f31e9aace99bdf3a (patch)
treef5e387c57b78bf26b79a46bbf493ec36b2a27f4f /newlib/libc/machine
parentb1743c94e25cd7bb5edbd77f694b1a3e5d90c297 (diff)
newlib: xstormy16: fix mallopt definition & mstats handling
The mallopt symbol is defined in tiny-malloc.c, not mallocr.c, but the Makefile in here tries to compile it out of the latter. This leads to mallopt never being defined. The build also creates mallinfo.o & mallopt.o & mallstats.o objects to override common ones, but the common dir doesn't use these names. Instead, it places these all in mstats.o. So move the build define logic to a dedicated file and compile it directly to make things a bit simpler while fixing the missing func and aligning objects with the cmomon code.
Diffstat (limited to 'newlib/libc/machine')
-rw-r--r--newlib/libc/machine/xstormy16/Makefile.am15
-rw-r--r--newlib/libc/machine/xstormy16/Makefile.in36
-rw-r--r--newlib/libc/machine/xstormy16/mstats.c6
3 files changed, 29 insertions, 28 deletions
diff --git a/newlib/libc/machine/xstormy16/Makefile.am b/newlib/libc/machine/xstormy16/Makefile.am
index faaac8941..f5237dce3 100644
--- a/newlib/libc/machine/xstormy16/Makefile.am
+++ b/newlib/libc/machine/xstormy16/Makefile.am
@@ -6,7 +6,8 @@ AM_CCASFLAGS = $(AM_CPPFLAGS)
noinst_LIBRARIES = lib.a
-lib_a_SOURCES = setjmp.S
+lib_a_SOURCES = setjmp.S \
+ mstats.c
lib_a_CFLAGS = $(AM_CFLAGS)
lib_a_LIBADD = $(lpfx)malloc.o \
@@ -17,10 +18,7 @@ lib_a_LIBADD = $(lpfx)malloc.o \
$(lpfx)malign.o \
$(lpfx)valloc.o \
$(lpfx)pvalloc.o \
- $(lpfx)mallinfo.o \
- $(lpfx)mallstats.o \
$(lpfx)msize.o \
- $(lpfx)mallopt.o \
$(lpfx)mallocr.o \
$(lpfx)freer.o \
$(lpfx)reallocr.o \
@@ -54,18 +52,9 @@ $(lpfx)valloc.o: tiny-malloc.c
$(lpfx)pvalloc.o: tiny-malloc.c
$(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/tiny-malloc.c -o $@
-$(lpfx)mallinfo.o: tiny-malloc.c
- $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/tiny-malloc.c -o $@
-
-$(lpfx)mallstats.o: tiny-malloc.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/tiny-malloc.c -o $@
-
$(lpfx)msize.o: tiny-malloc.c
$(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/tiny-malloc.c -o $@
-$(lpfx)mallopt.o: mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@
-
$(lpfx)mallocr.o: mallocr.c
$(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@
diff --git a/newlib/libc/machine/xstormy16/Makefile.in b/newlib/libc/machine/xstormy16/Makefile.in
index 5a63ea2e4..eeaec12f3 100644
--- a/newlib/libc/machine/xstormy16/Makefile.in
+++ b/newlib/libc/machine/xstormy16/Makefile.in
@@ -117,7 +117,7 @@ am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
lib_a_AR = $(AR) $(ARFLAGS)
-am_lib_a_OBJECTS = setjmp.$(OBJEXT)
+am_lib_a_OBJECTS = setjmp.$(OBJEXT) lib_a-mstats.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -140,6 +140,10 @@ AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
am__v_CPPAS_0 = @echo " CPPAS " $@;
am__v_CPPAS_1 =
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
@@ -309,7 +313,9 @@ top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(TARGET_CFLAGS)
AM_CCASFLAGS = $(AM_CPPFLAGS)
noinst_LIBRARIES = lib.a
-lib_a_SOURCES = setjmp.S
+lib_a_SOURCES = setjmp.S \
+ mstats.c
+
lib_a_CFLAGS = $(AM_CFLAGS)
lib_a_LIBADD = $(lpfx)malloc.o \
$(lpfx)free.o \
@@ -319,10 +325,7 @@ lib_a_LIBADD = $(lpfx)malloc.o \
$(lpfx)malign.o \
$(lpfx)valloc.o \
$(lpfx)pvalloc.o \
- $(lpfx)mallinfo.o \
- $(lpfx)mallstats.o \
$(lpfx)msize.o \
- $(lpfx)mallopt.o \
$(lpfx)mallocr.o \
$(lpfx)freer.o \
$(lpfx)reallocr.o \
@@ -333,7 +336,7 @@ MALLOC_COMPILE = $(COMPILE)
all: all-am
.SUFFIXES:
-.SUFFIXES: .S .o .obj
+.SUFFIXES: .S .c .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@@ -384,6 +387,18 @@ distclean-compile:
.S.obj:
$(AM_V_CPPAS)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+.c.o:
+ $(AM_V_CC)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+lib_a-mstats.o: mstats.c
+ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mstats.o `test -f 'mstats.c' || echo '$(srcdir)/'`mstats.c
+
+lib_a-mstats.obj: mstats.c
+ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mstats.obj `if test -f 'mstats.c'; then $(CYGPATH_W) 'mstats.c'; else $(CYGPATH_W) '$(srcdir)/mstats.c'; fi`
+
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
@@ -578,18 +593,9 @@ $(lpfx)valloc.o: tiny-malloc.c
$(lpfx)pvalloc.o: tiny-malloc.c
$(MALLOC_COMPILE) -DDEFINE_PVALLOC -c $(srcdir)/tiny-malloc.c -o $@
-$(lpfx)mallinfo.o: tiny-malloc.c
- $(MALLOC_COMPILE) -DDEFINE_MALLINFO -c $(srcdir)/tiny-malloc.c -o $@
-
-$(lpfx)mallstats.o: tiny-malloc.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOC_STATS -c $(srcdir)/tiny-malloc.c -o $@
-
$(lpfx)msize.o: tiny-malloc.c
$(MALLOC_COMPILE) -DDEFINE_MALLOC_USABLE_SIZE -c $(srcdir)/tiny-malloc.c -o $@
-$(lpfx)mallopt.o: mallocr.c
- $(MALLOC_COMPILE) -DDEFINE_MALLOPT -c $(srcdir)/mallocr.c -o $@
-
$(lpfx)mallocr.o: mallocr.c
$(MALLOC_COMPILE) -DDEFINE_MALLOC -c $(srcdir)/mallocr.c -o $@
diff --git a/newlib/libc/machine/xstormy16/mstats.c b/newlib/libc/machine/xstormy16/mstats.c
new file mode 100644
index 000000000..1bd24da55
--- /dev/null
+++ b/newlib/libc/machine/xstormy16/mstats.c
@@ -0,0 +1,6 @@
+/* stdlib/mstats.c defines all these symbols in this file.
+ TODO: Missing mstats function. */
+#define DEFINE_MALLINFO
+#define DEFINE_MALLOC_STATS
+#define DEFINE_MALLOPT
+#include "tiny-malloc.c"