From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 4B2F4389EC53; Sun, 13 Mar 2022 21:15:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B2F4389EC53 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] newlib: xstormy16: fix mallopt definition & mstats handling X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: b1743c94e25cd7bb5edbd77f694b1a3e5d90c297 X-Git-Newrev: 5cd957ff66a9bbd5532a2b00f31e9aace99bdf3a Message-Id: <20220313211513.4B2F4389EC53@sourceware.org> Date: Sun, 13 Mar 2022 21:15:13 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2022 21:15:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D5cd957ff66a= 9bbd5532a2b00f31e9aace99bdf3a commit 5cd957ff66a9bbd5532a2b00f31e9aace99bdf3a Author: Mike Frysinger Date: Tue Mar 1 00:58:55 2022 -0500 newlib: xstormy16: fix mallopt definition & mstats handling =20 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. =20 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. =20 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. Diff: --- newlib/libc/machine/xstormy16/Makefile.am | 15 ++----------- newlib/libc/machine/xstormy16/Makefile.in | 36 ++++++++++++++++++---------= ---- newlib/libc/machine/xstormy16/mstats.c | 6 ++++++ 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/newlib/libc/machine/xstormy16/Makefile.am b/newlib/libc/machin= e/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 =3D $(AM_CPPFLAGS) =20 noinst_LIBRARIES =3D lib.a =20 -lib_a_SOURCES =3D setjmp.S +lib_a_SOURCES =3D setjmp.S \ + mstats.c lib_a_CFLAGS =3D $(AM_CFLAGS) =20 lib_a_LIBADD =3D $(lpfx)malloc.o \ @@ -17,10 +18,7 @@ lib_a_LIBADD =3D $(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 $@ =20 -$(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 $@ =20 -$(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 $@ =20 diff --git a/newlib/libc/machine/xstormy16/Makefile.in b/newlib/libc/machin= e/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_ =3D $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 =3D @echo " AR " $@; am__v_AR_1 =3D=20 lib_a_AR =3D $(AR) $(ARFLAGS) -am_lib_a_OBJECTS =3D setjmp.$(OBJEXT) +am_lib_a_OBJECTS =3D setjmp.$(OBJEXT) lib_a-mstats.$(OBJEXT) lib_a_OBJECTS =3D $(am_lib_a_OBJECTS) AM_V_P =3D $(am__v_P_@AM_V@) am__v_P_ =3D $(am__v_P_@AM_DEFAULT_V@) @@ -140,6 +140,10 @@ AM_V_CPPAS =3D $(am__v_CPPAS_@AM_V@) am__v_CPPAS_ =3D $(am__v_CPPAS_@AM_DEFAULT_V@) am__v_CPPAS_0 =3D @echo " CPPAS " $@; am__v_CPPAS_1 =3D=20 +AM_V_lt =3D $(am__v_lt_@AM_V@) +am__v_lt_ =3D $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 =3D --silent +am__v_lt_1 =3D=20 COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC =3D $(am__v_CC_@AM_V@) @@ -309,7 +313,9 @@ top_srcdir =3D @top_srcdir@ AM_CPPFLAGS =3D $(NEWLIB_CFLAGS) $(TARGET_CFLAGS) AM_CCASFLAGS =3D $(AM_CPPFLAGS) noinst_LIBRARIES =3D lib.a -lib_a_SOURCES =3D setjmp.S +lib_a_SOURCES =3D setjmp.S \ + mstats.c + lib_a_CFLAGS =3D $(AM_CFLAGS) lib_a_LIBADD =3D $(lpfx)malloc.o \ $(lpfx)free.o \ @@ -319,10 +325,7 @@ lib_a_LIBADD =3D $(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 =3D $(COMPILE) all: all-am =20 .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) '$<'` =20 +.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 'mst= ats.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 $@ =20 -$(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 $@ =20 -$(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 $@ =20 diff --git a/newlib/libc/machine/xstormy16/mstats.c b/newlib/libc/machine/x= stormy16/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"