Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl2/libmalloc merge changes, add build glue.
details: https://anonhg.NetBSD.org/src/rev/d194381994a5
branches: trunk
changeset: 342901:d194381994a5
user: christos <christos%NetBSD.org@localhost>
date: Wed Jan 13 21:56:38 2016 +0000
description:
merge changes, add build glue.
diffstat:
external/gpl2/libmalloc/Makefile | 3 +
external/gpl2/libmalloc/Makefile.inc | 3 +
external/gpl2/libmalloc/dist/getpagesize.h | 3 +-
external/gpl2/libmalloc/dist/malloc.h | 6 +-
external/gpl2/libmalloc/dist/mcheck.c | 3 +-
external/gpl2/libmalloc/dist/mem-limits.h | 7 +-
external/gpl2/libmalloc/dist/morecore.c | 3 +-
external/gpl2/libmalloc/dist/mtrace.c | 9 +-
external/gpl2/libmalloc/dist/ralloc.c | 5 +-
external/gpl2/libmalloc/dist/valloc.c | 3 +-
external/gpl2/libmalloc/lib/Makefile | 19 ++++
external/gpl2/libmalloc/lib/combined.c | 12 ++
external/gpl2/libmalloc/lib/shlib_version | 5 +
external/gpl2/libmalloc/libmalloc2netbsd | 134 +++++++++++++++++++++++++++++
14 files changed, 199 insertions(+), 16 deletions(-)
diffs (truncated from 367 to 300 lines):
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/libmalloc/Makefile Wed Jan 13 21:56:38 2016 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile,v 1.1 2016/01/13 21:56:38 christos Exp $
+SUBDIR = lib
+.include <bsd.subdir.mk>
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/libmalloc/Makefile.inc Wed Jan 13 21:56:38 2016 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.1 2016/01/13 21:56:38 christos Exp $
+
+DIST=${NETBSDSRCDIR}/external/gpl2/libmalloc/dist
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/getpagesize.h
--- a/external/gpl2/libmalloc/dist/getpagesize.h Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/getpagesize.h Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,5 @@
-/* $NetBSD: getpagesize.h,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+#include <sys/param.h>
+/* $NetBSD: getpagesize.h,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Emulate getpagesize on systems that lack it. */
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/malloc.h
--- a/external/gpl2/libmalloc/dist/malloc.h Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/malloc.h Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: malloc.h,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: malloc.h,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Declarations for `malloc' and friends.
Copyright 1990, 1991, 1992, 1993, 1995 Free Software Foundation, Inc.
@@ -64,8 +64,12 @@
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#ifndef __NetBSD__
#undef __P
#define __P(args) args
+#else
+#include <sys/cdefs.h>
+#endif
#undef __ptr_t
#define __ptr_t void *
#else /* Not C++ or ANSI C. */
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/mcheck.c
--- a/external/gpl2/libmalloc/dist/mcheck.c Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/mcheck.c Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcheck.c,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: mcheck.c,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Standard debugging hooks for `malloc'.
Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
@@ -25,6 +25,7 @@
#ifndef _MALLOC_INTERNAL
#define _MALLOC_INTERNAL
#include <malloc.h>
+#include <stdlib.h>
#include <stdio.h>
#endif
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/mem-limits.h
--- a/external/gpl2/libmalloc/dist/mem-limits.h Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/mem-limits.h Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem-limits.h,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: mem-limits.h,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Includes for memory limit warnings.
Copyright (C) 1990, 1993, 1994 Free Software Foundation, Inc.
@@ -41,7 +41,7 @@
#include <sys/resource.h>
#endif
-#ifdef __bsdi__
+#if defined(__bsdi__) || defined(__NetBSD__)
#define BSD4_2
#endif
@@ -173,7 +173,8 @@
{
struct rlimit XXrlimit;
- getrlimit (RLIMIT_DATA, &XXrlimit);
+ if (getrlimit (RLIMIT_DATA, &XXrlimit) == -1)
+ XXrlimit.rlim_cur = -1;
#ifdef RLIM_INFINITY
lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
#else
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/morecore.c
--- a/external/gpl2/libmalloc/dist/morecore.c Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/morecore.c Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: morecore.c,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: morecore.c,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -20,6 +20,7 @@
#ifndef _MALLOC_INTERNAL
#define _MALLOC_INTERNAL
#include <malloc.h>
+#include <unistd.h>
#endif
#ifndef __GNU_LIBRARY__
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/mtrace.c
--- a/external/gpl2/libmalloc/dist/mtrace.c Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/mtrace.c Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mtrace.c,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: mtrace.c,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* More debugging hooks for `malloc'.
Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
@@ -91,8 +91,7 @@
static __ptr_t tr_mallochook __P ((__malloc_size_t));
static __ptr_t
-tr_mallochook (size)
- __malloc_size_t size;
+tr_mallochook (__malloc_size_t size)
{
__ptr_t hdr;
@@ -112,9 +111,7 @@
static __ptr_t tr_reallochook __P ((__ptr_t, __malloc_size_t));
static __ptr_t
-tr_reallochook (ptr, size)
- __ptr_t ptr;
- __malloc_size_t size;
+tr_reallochook (__ptr_t ptr, __malloc_size_t size)
{
__ptr_t hdr;
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/ralloc.c
--- a/external/gpl2/libmalloc/dist/ralloc.c Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/ralloc.c Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ralloc.c,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: ralloc.c,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Block-relocating memory allocator.
Copyright (C) 1993, 1995 Free Software Foundation, Inc.
@@ -71,6 +71,7 @@
typedef void *POINTER;
#include <unistd.h>
+#include <stdlib.h>
#include <malloc.h>
#include <string.h>
@@ -1002,7 +1003,7 @@
#ifdef DEBUG
#include <assert.h>
-int
+void
r_alloc_check ()
{
int found = 0;
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/dist/valloc.c
--- a/external/gpl2/libmalloc/dist/valloc.c Wed Jan 13 21:42:18 2016 +0000
+++ b/external/gpl2/libmalloc/dist/valloc.c Wed Jan 13 21:56:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: valloc.c,v 1.1.1.1 2016/01/13 21:42:18 christos Exp $ */
+/* $NetBSD: valloc.c,v 1.2 2016/01/13 21:56:38 christos Exp $ */
/* Allocate memory on a page boundary.
Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
@@ -23,6 +23,7 @@
#if defined (__GNU_LIBRARY__) || defined (_LIBC)
#include <stddef.h>
+#include <unistd.h>
#include <sys/cdefs.h>
extern size_t __getpagesize __P ((void));
#else
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/lib/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/libmalloc/lib/Makefile Wed Jan 13 21:56:38 2016 +0000
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1 2016/01/13 21:56:38 christos Exp $
+
+NOLINT=
+NOMAN= # defined
+.include <bsd.init.mk>
+
+LIB= gnumalloc
+SRCS+= combined.c
+#SRCS+= malloc.c free.c realloc.c
+SRCS+= cfree.c calloc.c morecore.c
+SRCS+= memalign.c valloc.c mcheck.c mtrace.c mstats.c vm-limit.c
+SRCS+= ralloc.c
+
+
+CPPFLAGS+= -I${DIST} -I${.CURDIR} -DSTDC_HEADERS -DHAVE_STDLIB_H
+
+.PATH: ${DIST}
+
+.include <bsd.lib.mk>
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/lib/combined.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/libmalloc/lib/combined.c Wed Jan 13 21:56:38 2016 +0000
@@ -0,0 +1,12 @@
+/*
+ * this file (combined.c) is malloc.c, free.c, and realloc.c, combined into
+ * one file, because the malloc.o in libc defined malloc, realloc, and free,
+ * and libc sometimes invokes realloc, which can greatly confuse things
+ * in the linking process...
+ *
+ * $Id: combined.c,v 1.1 2016/01/13 21:56:38 christos Exp $
+ */
+
+#include "malloc.c"
+#include "free.c"
+#include "realloc.c"
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/lib/shlib_version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/libmalloc/lib/shlib_version Wed Jan 13 21:56:38 2016 +0000
@@ -0,0 +1,5 @@
+# $NetBSD: shlib_version,v 1.1 2016/01/13 21:56:38 christos Exp $
+# Remember to update distrib/sets/lists/base/shl.* when changing
+#
+major=1
+minor=0
diff -r 7cde07874b04 -r d194381994a5 external/gpl2/libmalloc/libmalloc2netbsd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/libmalloc/libmalloc2netbsd Wed Jan 13 21:56:38 2016 +0000
@@ -0,0 +1,134 @@
+#! /bin/sh
+#
+# $NetBSD: libmalloc2netbsd,v 1.1 2016/01/13 21:56:38 christos Exp $
+#
+# Copyright (c) 2016 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# libmalloc2netbsd: convert an glibc source tree into a
+# netbsd libmalloc source tree,
+#
+# Rough instructions for importing new libmalloc release:
+#
+# $ cd /some/where/temporary
+# $ tar xpfz /malloc/release/tar/file
+# $ sh /usr/src/external/gpl2/libmalloc/libmalloc2netbsd malloc `pwd`
+# $ cd `pwd`/src/external/gpl2/libmalloc/dist
+# $ cvs import -m "Import libmalloc YYYY-MM-DD" src/external/gpl2/libmalloc/dist FSF malloc-YYYY-MM-DD
+# merge sources according to instructions given
+# e.g. cvs -d cvs.netbsd.org:/cvsroot checkout -jlibmalloc-1-19 -jlibmalloc-1-19-1 src/gnu/dist/libmalloc
+
+if [ $# -ne 2 ]; then echo "libmalloc2netbsd src dest"; exit 1; fi
+
+r=$1
+d=$2/src/external/gpl2/libmalloc/dist
+
+case "$d" in
+ /*)
+ ;;
+ *)
+ d=`/bin/pwd`/$d
+ ;;
+esac
+
+case "$r" in
+ /*)
+ ;;
+ *)
+ r=`/bin/pwd`/$r
+ ;;
+esac
+
+echo preparing directory $d
+rm -rf $d
+mkdir -p $d
+
+### Copy the files and directories
Home |
Main Index |
Thread Index |
Old Index