diff --git a/devel/libexecinfo/Makefile b/devel/libexecinfo/Makefile index a17134458a9..811630353ac 100644 --- a/devel/libexecinfo/Makefile +++ b/devel/libexecinfo/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.3 2009/04/09 15:03:06 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.4 2009/10/09 15:10:13 jasper Exp $ COMMENT= clone of backtrace facility found in the GNU libc DISTNAME= libexecinfo-1.1 -PKGNAME= ${DISTNAME}p1 +PKGNAME= ${DISTNAME}p2 CATEGORIES= devel SHARED_LIBS= execinfo 0.0 @@ -22,6 +22,19 @@ EXTRACT_SUFX= .tar.bz2 WANTLIB= m +# Hack that allows this lib to build on mips64, although +# it essentially turns this lib into an empty shell... +# ...too many ports require it to mark it NOT_FOR_ARCHS +.if ${MACHINE_ARCH} == "mips64" +EXTRA_CFLAGS= -D__BUILTIN_HACK +# See bsd.lib.mk:162 +PKG_ARGS+= -Dno_mips64=0 +.else +PKG_ARGS+= -Dno_mips64=1 +.endif + +MAKE_FLAGS+= EXTRA_CFLAGS=${EXTRA_CFLAGS} + MAKE_ENV= LIBDIR=${PREFIX}/lib \ LIBexecinfo_MAJOR=${LIBexecinfo_VERSION:R} \ LIBexecinfo_MINOR=${LIBexecinfo_VERSION:E} diff --git a/devel/libexecinfo/patches/patch-Makefile b/devel/libexecinfo/patches/patch-Makefile index 56b8fab38f7..3d0559a93ab 100644 --- a/devel/libexecinfo/patches/patch-Makefile +++ b/devel/libexecinfo/patches/patch-Makefile @@ -1,7 +1,7 @@ -$OpenBSD: patch-Makefile,v 1.1.1.1 2008/10/21 17:01:24 ajacoutot Exp $ ---- Makefile.orig Mon Dec 10 22:07:49 2007 -+++ Makefile Mon Dec 10 22:08:07 2007 -@@ -30,8 +30,8 @@ SRCS= stacktraverse.c stacktraverse.h execinfo.c execi +$OpenBSD: patch-Makefile,v 1.2 2009/10/09 15:10:13 jasper Exp $ +--- Makefile.orig Mon Jul 19 07:19:55 2004 ++++ Makefile Tue Oct 6 23:12:02 2009 +@@ -30,13 +30,15 @@ SRCS= stacktraverse.c stacktraverse.h execinfo.c execi INCS= execinfo.h @@ -12,3 +12,10 @@ $OpenBSD: patch-Makefile,v 1.1.1.1 2008/10/21 17:01:24 ajacoutot Exp $ NOPROFILE= yes + DPADD= ${LIBM} + LDADD= -lm ++ ++CFLAGS+= ${EXTRA_CFLAGS} + + #WARNS?= 4 + diff --git a/devel/libexecinfo/patches/patch-stacktraverse_c b/devel/libexecinfo/patches/patch-stacktraverse_c new file mode 100644 index 00000000000..cc9c33514cf --- /dev/null +++ b/devel/libexecinfo/patches/patch-stacktraverse_c @@ -0,0 +1,43 @@ +$OpenBSD: patch-stacktraverse_c,v 1.1 2009/10/09 15:10:13 jasper Exp $ + +__builtin_return_address() and __builtin_frame_address() +can't have a !0 argument on mips. + +--- stacktraverse.c.orig Mon Jul 19 07:09:36 2004 ++++ stacktraverse.c Tue Oct 6 23:18:58 2009 +@@ -7,6 +7,9 @@ getreturnaddr(int level) + { + + switch(level) { ++#ifdef __BUILTIN_HACK ++ case 0: return __builtin_return_address(0); ++#else + case 0: return __builtin_return_address(1); + case 1: return __builtin_return_address(2); + case 2: return __builtin_return_address(3); +@@ -135,6 +138,7 @@ getreturnaddr(int level) + case 125: return __builtin_return_address(126); + case 126: return __builtin_return_address(127); + case 127: return __builtin_return_address(128); ++#endif + default: return NULL; + } + } +@@ -148,6 +152,9 @@ getframeaddr(int level) + { + + switch(level) { ++#ifdef __BUILTIN_HACK ++ case 0: return __builtin_frame_address(0); ++#else + case 0: return __builtin_frame_address(1); + case 1: return __builtin_frame_address(2); + case 2: return __builtin_frame_address(3); +@@ -276,6 +283,7 @@ getframeaddr(int level) + case 125: return __builtin_frame_address(126); + case 126: return __builtin_frame_address(127); + case 127: return __builtin_frame_address(128); ++#endif + default: return NULL; + } + } diff --git a/devel/libexecinfo/pkg/PFRAG.no_mips64 b/devel/libexecinfo/pkg/PFRAG.no_mips64 new file mode 100644 index 00000000000..7f229935dd2 --- /dev/null +++ b/devel/libexecinfo/pkg/PFRAG.no_mips64 @@ -0,0 +1,2 @@ +@comment $OpenBSD: PFRAG.no_mips64,v 1.1 2009/10/09 15:10:14 jasper Exp $ +lib/libexecinfo_pic.a diff --git a/devel/libexecinfo/pkg/PLIST b/devel/libexecinfo/pkg/PLIST index 6fcc393bd1e..f3ee242643a 100644 --- a/devel/libexecinfo/pkg/PLIST +++ b/devel/libexecinfo/pkg/PLIST @@ -1,8 +1,8 @@ -@comment $OpenBSD: PLIST,v 1.2 2009/04/09 15:03:06 ajacoutot Exp $ +@comment $OpenBSD: PLIST,v 1.3 2009/10/09 15:10:14 jasper Exp $ %%SHARED%% include/execinfo.h include/stacktraverse.h lib/libexecinfo.a -lib/libexecinfo_pic.a +%%no_mips64%% share/doc/libexecinfo/ share/doc/libexecinfo/README