New package: libexecinfo-1.1
This commit is contained in:
parent
9759783c0e
commit
545137f387
|
@ -2909,3 +2909,4 @@ libopenglrecorder.so.0 libopenglrecorder-0.1.0_1
|
|||
libgpod.so.4 libgpod-0.8.3_1
|
||||
libi2c.so.0 i2c-tools-4.0_1
|
||||
libairspy.so.0 libairspy-1.0.9_1
|
||||
libexecinfo.so.1 libexecinfo-1.1_1
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
libexecinfo
|
|
@ -0,0 +1,65 @@
|
|||
--- execinfo.c.orig
|
||||
+++ execinfo.c
|
||||
@@ -69,7 +69,8 @@
|
||||
char **
|
||||
backtrace_symbols(void *const *buffer, int size)
|
||||
{
|
||||
- int i, clen, alen, offset;
|
||||
+ size_t clen, alen;
|
||||
+ int i, offset;
|
||||
char **rval;
|
||||
char *cp;
|
||||
Dl_info info;
|
||||
@@ -78,7 +79,6 @@
|
||||
rval = malloc(clen);
|
||||
if (rval == NULL)
|
||||
return NULL;
|
||||
- (char **)cp = &(rval[size]);
|
||||
for (i = 0; i < size; i++) {
|
||||
if (dladdr(buffer[i], &info) != 0) {
|
||||
if (info.dli_sname == NULL)
|
||||
@@ -92,14 +92,14 @@
|
||||
2 + /* " <" */
|
||||
strlen(info.dli_sname) + /* "function" */
|
||||
1 + /* "+" */
|
||||
- D10(offset) + /* "offset */
|
||||
+ 10 + /* "offset */
|
||||
5 + /* "> at " */
|
||||
strlen(info.dli_fname) + /* "filename" */
|
||||
1; /* "\0" */
|
||||
rval = realloc_safe(rval, clen + alen);
|
||||
if (rval == NULL)
|
||||
return NULL;
|
||||
- snprintf(cp, alen, "%p <%s+%d> at %s",
|
||||
+ snprintf((char *) rval + clen, alen, "%p <%s+%d> at %s",
|
||||
buffer[i], info.dli_sname, offset, info.dli_fname);
|
||||
} else {
|
||||
alen = 2 + /* "0x" */
|
||||
@@ -108,12 +108,15 @@
|
||||
rval = realloc_safe(rval, clen + alen);
|
||||
if (rval == NULL)
|
||||
return NULL;
|
||||
- snprintf(cp, alen, "%p", buffer[i]);
|
||||
+ snprintf((char *) rval + clen, alen, "%p", buffer[i]);
|
||||
}
|
||||
- rval[i] = cp;
|
||||
- cp += alen;
|
||||
+ rval[i] = (char *) clen;
|
||||
+ clen += alen;
|
||||
}
|
||||
|
||||
+ for (i = 0; i < size; i++)
|
||||
+ rval[i] += (long) rval;
|
||||
+
|
||||
return rval;
|
||||
}
|
||||
|
||||
@@ -155,6 +158,6 @@
|
||||
return;
|
||||
snprintf(buf, len, "%p\n", buffer[i]);
|
||||
}
|
||||
- write(fd, buf, len - 1);
|
||||
+ write(fd, buf, strlen(buf));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
--- Makefile.orig
|
||||
+++ Makefile
|
||||
@@ -23,24 +23,25 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# $Id: Makefile,v 1.3 2004/07/19 05:19:55 sobomax Exp $
|
||||
+#
|
||||
+# Linux Makefile by Matt Smith <mcs@darkregion.net>, 2011/01/04
|
||||
|
||||
-LIB= execinfo
|
||||
+CC=cc
|
||||
+AR=ar
|
||||
+EXECINFO_CFLAGS=$(CFLAGS) -std=gnu99 -c
|
||||
+EXECINFO_LDFLAGS=$(LDFLAGS)
|
||||
|
||||
-SRCS= stacktraverse.c stacktraverse.h execinfo.c execinfo.h
|
||||
+all: static dynamic
|
||||
|
||||
-INCS= execinfo.h
|
||||
+static:
|
||||
+ $(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c
|
||||
+ $(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c
|
||||
+ $(AR) rcs libexecinfo.a stacktraverse.o execinfo.o
|
||||
|
||||
-SHLIB_MAJOR= 1
|
||||
-SHLIB_MINOR= 0
|
||||
+dynamic:
|
||||
+ $(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c -o stacktraverse.So
|
||||
+ $(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c -o execinfo.So
|
||||
+ $(CC) -shared -Wl,-soname,libexecinfo.so.1 -o libexecinfo.so.1 stacktraverse.So execinfo.So
|
||||
|
||||
-NOPROFILE= yes
|
||||
-
|
||||
-DPADD= ${LIBM}
|
||||
-LDADD= -lm
|
||||
-
|
||||
-#WARNS?= 4
|
||||
-
|
||||
-#stacktraverse.c: gen.py
|
||||
-# ./gen.py > stacktraverse.c
|
||||
-
|
||||
-.include <bsd.lib.mk>
|
||||
+clean:
|
||||
+ rm -rf *.o *.So *.a *.so
|
|
@ -0,0 +1,24 @@
|
|||
--- execinfo.c.orig
|
||||
+++ execinfo.c
|
||||
@@ -26,6 +26,7 @@
|
||||
* $Id: execinfo.c,v 1.3 2004/07/19 05:21:09 sobomax Exp $
|
||||
*/
|
||||
|
||||
+#define _GNU_SOURCE
|
||||
#include <sys/types.h>
|
||||
#include <sys/uio.h>
|
||||
#include <dlfcn.h>
|
||||
--- stacktraverse.c.orig
|
||||
+++ stacktraverse.c
|
||||
@@ -1,3 +1,4 @@
|
||||
+#define _GNU_SOURCE
|
||||
#include <stddef.h>
|
||||
|
||||
#include "stacktraverse.h"
|
||||
--- test.c.orig
|
||||
+++ test.c
|
||||
@@ -1,3 +1,4 @@
|
||||
+#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# Template file for 'libexecinfo'
|
||||
pkgname=libexecinfo
|
||||
version=1.1
|
||||
revision=1
|
||||
build_style=gnu-makefile
|
||||
short_desc="A quick-n-dirty BSD licensed clone of the GNU libc backtrace facility"
|
||||
maintainer="John <johnz@posteo.net>"
|
||||
license="BSD-2"
|
||||
homepage="http://www.freshports.org/devel/libexecinfo"
|
||||
distfiles="http://distcache.freebsd.org/local-distfiles/itetcu/libexecinfo-${version}.tar.bz2"
|
||||
checksum=c9a21913e7fdac8ef6b33250b167aa1fc0a7b8a175145e26913a4c19d8a59b1f
|
||||
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
*-musl) ;;
|
||||
*) broken="Only for musl libc" ;;
|
||||
esac
|
||||
|
||||
do_install() {
|
||||
vinstall execinfo.h 644 usr/include
|
||||
vinstall stacktraverse.h 644 usr/include
|
||||
vinstall libexecinfo.a 755 usr/lib
|
||||
vinstall libexecinfo.so.1 755 usr/lib
|
||||
ln -s /usr/lib/libexecinfo.so.1 ${DESTDIR}/usr/lib/libexecinfo.so
|
||||
head -28 execinfo.c > LICENSE
|
||||
vlicense LICENSE
|
||||
}
|
||||
|
||||
libexecinfo-devel_package() {
|
||||
depends="${sourcepkg}>=${version}_${revision}"
|
||||
short_desc+=" - development files"
|
||||
pkg_install() {
|
||||
vmove usr/include
|
||||
vmove usr/lib/*.so
|
||||
vmove usr/lib/*.a
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue