Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 113681 Details for
Bug 164656
sandbox: use own malloc
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
sandbox-use-own-malloc.patch
sandbox-use-own-malloc.patch (text/plain), 2.61 KB, created by
Ed Catmur
on 2007-03-18 19:13:55 UTC
(
hide
)
Description:
sandbox-use-own-malloc.patch
Filename:
MIME Type:
Creator:
Ed Catmur
Created:
2007-03-18 19:13:55 UTC
Size:
2.61 KB
patch
obsolete
>--- src/Makefile.am 2007/01/29 04:34:05 1.1 >+++ src/Makefile.am 2007/01/30 15:23:08 >@@ -2,6 +2,10 @@ AUTOMAKE_OPTIONS = foreign > > lib_LTLIBRARIES = libsandbox.la > bin_PROGRAMS = sandbox >+noinst_LTLIBRARIES = libptmalloc3.la \ >+ libmalloc.la >+ >+ptmalloc_srcdir=$(top_srcdir)/../ptmalloc3 > > AM_CPPFLAGS = \ > -DPIC -fPIC -D_REENTRANT \ >@@ -11,12 +15,33 @@ AM_CPPFLAGS = \ > > LOCAL_INCLUDES = $(top_srcdir)/localdecls.h > >+libmalloc_la_SOURCES = $(ptmalloc_srcdir)/malloc.c >+libmalloc_la_CPPFLAGS = -D_GNU_SOURCE \ >+ -DHAVE_MORECORE=0 \ >+ -DONLY_MSPACES -DUSE_LOCKS=0 >+libptmalloc3_la_SOURCES = $(ptmalloc_srcdir)/ptmalloc3.c \ >+ $(ptmalloc_srcdir)/malloc-2.8.3.h \ >+ $(ptmalloc_srcdir)/malloc-private.h \ >+ $(ptmalloc_srcdir)/sysdeps/pthread/malloc-machine.h \ >+ $(ptmalloc_srcdir)/sysdeps/pthread/thread-st.h \ >+ $(ptmalloc_srcdir)/sysdeps/generic/malloc-machine.h \ >+ $(ptmalloc_srcdir)/sysdeps/generic/atomic.h \ >+ $(ptmalloc_srcdir)/sysdeps/generic/thread-st.h >+libptmalloc3_la_CPPFLAGS = -D_GNU_SOURCE \ >+ -DMSPACES=1 \ >+ -DUSE_TSD_DATA_HACK -DTHREAD_STATS=1 \ >+ -I$(ptmalloc_srcdir) \ >+ -I$(ptmalloc_srcdir)/sysdeps/pthread -I$(ptmalloc_srcdir)/sysdeps/generic >+libptmalloc3_la_LIBADD = -lpthread \ >+ libmalloc.la >+ > # We need -fexceptions here, else we do not catch exceptions > # (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions). > libsandbox_la_CFLAGS = -fexceptions > # Do not add -nostdlib or -nostartfiles, as then our constructor > # and destructor will not be executed ... >-libsandbox_la_LIBADD = -lc $(LIBDL) >+libsandbox_la_LIBADD = libptmalloc3.la \ >+ -lc $(LIBDL) > libsandbox_la_LDFLAGS = \ > -nodefaultlibs \ > -Wl,--version-script,libsandbox.map >@@ -32,6 +57,7 @@ sandbox_SOURCES = \ > sandbox.h \ > sandbox_utils.c \ > $(LOCAL_INCLUDES) >+sandbox_LDADD = libptmalloc3.la > > libsandbox.c: libsandbox.map symbols.h > >--- src/sandbox_utils.c 2007/01/29 03:13:46 1.1 >+++ src/sandbox_utils.c 2007/01/30 16:13:45 >@@ -175,7 +175,7 @@ char * gstrndup (const char *str, size_t > return NULL; > > /* Check lenght of str without breaching the size limit */ >- for (len = 0; (len < size) && ('\0' != str[len]); len++); >+ for (len = 0; (size == -1 || len < size) && ('\0' != str[len]); len++); > > new_str = malloc (len + 1); > if (NULL == new_str) >--- src/sandbox.h 2007/01/30 16:12:19 1.1 >+++ src/sandbox.h 2007/01/30 16:14:39 >@@ -103,6 +103,10 @@ long file_length(int fd); > > /* Compat functions for GNU extensions */ > char *gstrndup (const char *str, size_t size); >+#ifdef strdup >+#undef strdup >+#endif >+#define strdup(s) gstrndup((s), -1) > /* Same as basename(3), but do not modify path */ > char *gbasename (const char *path); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 164656
:
108718
|
113681
|
113720
|
122973
|
132779
|
132845
|
134085