aboutsummaryrefslogtreecommitdiffstats
path: root/devel/valgrind-snapshot
diff options
context:
space:
mode:
authorbarner <barner@FreeBSD.org>2005-09-20 08:40:08 +0800
committerbarner <barner@FreeBSD.org>2005-09-20 08:40:08 +0800
commit873e5251e05643c196f1e3d71a6012bb997e5f00 (patch)
treea668b5b36070bec078384d09e41c11195217c80a /devel/valgrind-snapshot
parent4942ed06ddfbe825ff9ba1e8a4733af1fe1036ef (diff)
downloadfreebsd-ports-gnome-873e5251e05643c196f1e3d71a6012bb997e5f00.tar.gz
freebsd-ports-gnome-873e5251e05643c196f1e3d71a6012bb997e5f00.tar.zst
freebsd-ports-gnome-873e5251e05643c196f1e3d71a6012bb997e5f00.zip
- Fix on FreeBSD 6 and above: [1] [2]
Valgrind did not handle the following sysarch calls, and thus crashed immediately o get_fsbase o set_fsbase o get_gsbase o set_fsbase - Valgrind no longer dumps core when its client application does. [2] Valgrind-snapshot does contain for safing the client's core dump, but it does not work (it resulted in a crash) and has therefore been disabled. - Fix crash with valgrind-snapshot when the application to debug does not exists or cannot be accessed. - Fix symlink farms for threading libraries. FreeBSD 4-7 are handled. [2] - Bump PORTREVISION Reported by: Ulrich Spoerlein <q@galgenberg.net> [1], Chris Gilbert <Chris@lainos.org> [2] PR: ports/86007 [1]
Diffstat (limited to 'devel/valgrind-snapshot')
-rw-r--r--devel/valgrind-snapshot/Makefile27
-rw-r--r--devel/valgrind-snapshot/files/patch-Makefile.am52
-rw-r--r--devel/valgrind-snapshot/files/patch-configure11
-rw-r--r--devel/valgrind-snapshot/files/patch-configure.in65
-rw-r--r--devel/valgrind-snapshot/files/patch-coregrind-vg_signals.c15
-rw-r--r--devel/valgrind-snapshot/files/patch-coregrind_Makefile.am51
-rw-r--r--devel/valgrind-snapshot/files/patch-coregrind_vg_main.c27
-rw-r--r--devel/valgrind-snapshot/files/patch-coregrind_vg_syscalls.c56
-rw-r--r--devel/valgrind-snapshot/pkg-plist9
9 files changed, 294 insertions, 19 deletions
diff --git a/devel/valgrind-snapshot/Makefile b/devel/valgrind-snapshot/Makefile
index 9e280c1ba946..0c4c79ecf686 100644
--- a/devel/valgrind-snapshot/Makefile
+++ b/devel/valgrind-snapshot/Makefile
@@ -7,7 +7,7 @@
PORTNAME= valgrind
PORTVERSION= 352
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= devel
MASTER_SITES= http://www.rabson.org/
PKGNAMESUFFIX= -snapshot
@@ -26,22 +26,41 @@ USE_GNOME= pkgconfig
USE_PERL5_BUILD=yes
USE_REINPLACE= yes
GNU_CONFIGURE= yes
+USE_AUTOTOOLS+= autoconf:259 aclocal:19 automake:19
CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
WRKSRC= ${WRKDIR}/${DISTNAME}
.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 500000
+.if ${OSVERSION} >= 700000
+PLIST_SUB+= RELENG_4="@comment "
+PLIST_SUB+= RELENG_5="@comment "
+PLIST_SUB+= RELENG_6="@comment "
+PLIST_SUB+= RELENG_7=""
+.else
+.if ${OSVERSION} >= 600000
+PLIST_SUB+= RELENG_4="@comment "
+PLIST_SUB+= RELENG_5="@comment "
+PLIST_SUB+= RELENG_6=""
+PLIST_SUB+= RELENG_7="@comment "
+.else
+.if ${OSVERSION} >= 500000
PLIST_SUB+= RELENG_4="@comment "
PLIST_SUB+= RELENG_5=""
+PLIST_SUB+= RELENG_6="@comment "
+PLIST_SUB+= RELENG_7="@comment "
.else
PLIST_SUB+= RELENG_4=""
PLIST_SUB+= RELENG_5="@comment "
+PLIST_SUB+= RELENG_6="@comment "
+PLIST_SUB+= RELENG_7="@comment "
+.endif
+.endif
.endif
.if ${PERL_LEVEL} < 500601
-IGNORE= "can\'t be built. Your Perl version is too old. Please use lang/perl5.8 port to upgrade your Perl"
+IGNORE= can\'t be built. Your Perl version is too old. Please use lang/perl5.8 port to upgrade your Perl
.endif
PROCFS!= /sbin/mount | ${GREP} '^procfs' | ${AWK} '{print $1}'
@@ -59,7 +78,7 @@ pre-everything::
#
.ifndef (PACKAGE_BUILDING)
ECHO_MSG=/usr/bin/printf
-IGNORE= needs a running procfs, which is not\n\
+IGNORE= needs a running procfs, which is not\n\
\ \ \ \ \ activated on your system. Please read the procfs\(5\)\n\
\ \ \ \ \ man page and add the following line to /etc/fstab:\n\
\n\
diff --git a/devel/valgrind-snapshot/files/patch-Makefile.am b/devel/valgrind-snapshot/files/patch-Makefile.am
new file mode 100644
index 000000000000..a1d24a03edb8
--- /dev/null
+++ b/devel/valgrind-snapshot/files/patch-Makefile.am
@@ -0,0 +1,52 @@
+--- Makefile.am.orig Sun May 9 13:00:57 2004
++++ Makefile.am Tue Sep 20 00:04:44 2005
+@@ -55,26 +55,44 @@
+ if !IS_LINUX
+ if IS_FREEBSD4
+ rm -f $(DESTDIR)$(valdir)/libc_r.so.4
+-else
++endif
++if IS_FREEBSD5
+ rm -f $(DESTDIR)$(valdir)/libc_r.so.5
+ rm -f $(DESTDIR)$(valdir)/libkse.so.1
+ rm -f $(DESTDIR)$(valdir)/libthr.so.1
+-if !IS_FREEBSD_LIBC_R
+ rm -f $(DESTDIR)$(valdir)/libpthread.so.1
+ endif
++if IS_FREEBSD6
++ rm -f $(DESTDIR)$(valdir)/libc_r.so.6
++ rm -f $(DESTDIR)$(valdir)/libthr.so.2
++ rm -f $(DESTDIR)$(valdir)/libpthread.so.2
++endif
++if IS_FREEBSD7
++ rm -f $(DESTDIR)$(valdir)/libc_r.so.6
++ rm -f $(DESTDIR)$(valdir)/libthr.so.2
++ rm -f $(DESTDIR)$(valdir)/libpthread.so.2
+ endif
+ endif
+- $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libpthread.so.0
+ if !IS_LINUX
+ if IS_FREEBSD4
+ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libc_r.so.4
+-else
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libpthread.so.0
++endif
++if IS_FREEBSD5
+ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libc_r.so.5
+ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libkse.so.1
+ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libthr.so.1
+-if !IS_FREEBSD_LIBC_R
+ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libpthread.so.1
+ endif
++if IS_FREEBSD6
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libc_r.so.6
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libthr.so.2
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libpthread.so.2
++endif
++if IS_FREEBSD7
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libc_r.so.6
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libthr.so.2
++ $(LN_S) libpthread.so $(DESTDIR)$(valdir)/libpthread.so.2
+ endif
+ endif
+
diff --git a/devel/valgrind-snapshot/files/patch-configure b/devel/valgrind-snapshot/files/patch-configure
deleted file mode 100644
index 9827b92dbace..000000000000
--- a/devel/valgrind-snapshot/files/patch-configure
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.orig Sat Aug 21 00:03:33 2004
-+++ configure Sat Aug 21 00:03:13 2004
-@@ -4020,7 +4020,7 @@
-
- ;;
-
-- *freebsd5*)
-+ *freebsd[567]*)
- echo "$as_me:$LINENO: result: ok (${host_os})" >&5
- echo "${ECHO_T}ok (${host_os})" >&6
- VG_PLATFORM="x86-freebsd"
diff --git a/devel/valgrind-snapshot/files/patch-configure.in b/devel/valgrind-snapshot/files/patch-configure.in
new file mode 100644
index 000000000000..9a081e014d92
--- /dev/null
+++ b/devel/valgrind-snapshot/files/patch-configure.in
@@ -0,0 +1,65 @@
+--- configure.in.orig Sun May 9 13:00:57 2004
++++ configure.in Tue Sep 20 00:12:06 2005
+@@ -132,23 +132,40 @@
+ ;;
+ esac
+ AM_CONDITIONAL(IS_FREEBSD4, false)
+- AM_CONDITIONAL(IS_FREEBSD_LIBC_R, false)
+
+ ;;
+
++ *freebsd7*)
++ AC_MSG_RESULT([ok (${host_os})])
++ VG_PLATFORM="x86-freebsd"
++ AM_CONDITIONAL(IS_LINUX, false)
++ AM_CONDITIONAL(IS_FREEBSD4, false)
++ AM_CONDITIONAL(IS_FREEBSD5, false)
++ AM_CONDITIONAL(IS_FREEBSD6, false)
++ AM_CONDITIONAL(IS_FREEBSD7, true)
++ AM_CONDITIONAL(IS_FREEBSD_LIBC_R, false)
++
++ ;;
++ *freebsd6*)
++ AC_MSG_RESULT([ok (${host_os})])
++ VG_PLATFORM="x86-freebsd"
++ AM_CONDITIONAL(IS_LINUX, false)
++ AM_CONDITIONAL(IS_FREEBSD4, false)
++ AM_CONDITIONAL(IS_FREEBSD5, false)
++ AM_CONDITIONAL(IS_FREEBSD6, true)
++ AM_CONDITIONAL(IS_FREEBSD7, false)
++ AM_CONDITIONAL(IS_FREEBSD_LIBC_R, false)
++
++ ;;
+ *freebsd5*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VG_PLATFORM="x86-freebsd"
+ AM_CONDITIONAL(IS_LINUX, false)
+ AM_CONDITIONAL(IS_FREEBSD4, false)
+-
+- osreldate=`sysctl -n kern.osreldate`
+- if test $osreldate -lt 502102; then
+- AM_CONDITIONAL(IS_FREEBSD_LIBC_R, true)
+- else
+- AM_CONDITIONAL(IS_FREEBSD_LIBC_R, false)
+- fi
+-
++ AM_CONDITIONAL(IS_FREEBSD5, true)
++ AM_CONDITIONAL(IS_FREEBSD6, false)
++ AM_CONDITIONAL(IS_FREEBSD7, false)
++ AM_CONDITIONAL(IS_FREEBSD_LIBC_R, false)
+ ;;
+
+ *freebsd4*)
+@@ -156,8 +173,10 @@
+ VG_PLATFORM="x86-freebsd"
+ AM_CONDITIONAL(IS_LINUX, false)
+ AM_CONDITIONAL(IS_FREEBSD4, true)
+- AM_CONDITIONAL(IS_FREEBSD_LIBC_R, true)
+-
++ AM_CONDITIONAL(IS_FREEBSD5, false)
++ AM_CONDITIONAL(IS_FREEBSD6, false)
++ AM_CONDITIONAL(IS_FREEBSD7, false)
++ AM_CONDITIONAL(IS_FREEBSD_LIBC_R, false)
+ ;;
+
+ *)
diff --git a/devel/valgrind-snapshot/files/patch-coregrind-vg_signals.c b/devel/valgrind-snapshot/files/patch-coregrind-vg_signals.c
index c8b593f43028..79d868695a22 100644
--- a/devel/valgrind-snapshot/files/patch-coregrind-vg_signals.c
+++ b/devel/valgrind-snapshot/files/patch-coregrind-vg_signals.c
@@ -1,5 +1,5 @@
---- coregrind/vg_signals.c.orig Tue Aug 31 22:39:50 2004
-+++ coregrind/vg_signals.c Tue Aug 31 22:41:36 2004
+--- coregrind/vg_signals.c.orig Sun May 9 13:00:57 2004
++++ coregrind/vg_signals.c Mon Sep 19 18:18:07 2005
@@ -1374,6 +1374,12 @@
#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
#endif /* NT_PRXFPREG */
@@ -13,3 +13,14 @@
/* If true, then this Segment may be mentioned in the core */
static Bool may_dump(const Segment *seg)
{
+@@ -1900,8 +1906,8 @@
+ if (core) {
+ static struct vki_rlimit zero = { 0, 0 };
+
+- make_coredump(tid, info, corelim.rlim_cur);
+-
++ // make_coredump(tid, info, corelim.rlim_cur);
++ VG_(message) (Vg_UserMsg, "Core dumping is broken on FreeBSD. Please re-run valgrind after fixing the crash.");
+ /* make sure we don't get a confusing kernel-generated coredump */
+ VG_(setrlimit)(VKI_RLIMIT_CORE, &zero);
+ }
diff --git a/devel/valgrind-snapshot/files/patch-coregrind_Makefile.am b/devel/valgrind-snapshot/files/patch-coregrind_Makefile.am
new file mode 100644
index 000000000000..1c0c3f0ad94b
--- /dev/null
+++ b/devel/valgrind-snapshot/files/patch-coregrind_Makefile.am
@@ -0,0 +1,51 @@
+--- coregrind/Makefile.am.orig Sun May 9 13:00:57 2004
++++ coregrind/Makefile.am Tue Sep 20 00:04:17 2005
+@@ -172,11 +172,23 @@
+ vg_unsafe.h
+
+ if !IS_LINUX
++if IS_FREEBSD5
+ MANUAL_DEPS_EXTRA = $(inplacedir)/libc_r.so.5 \
+ $(inplacedir)/libkse.so.1 \
+ $(inplacedir)/libthr.so.1 \
+ $(inplacedir)/libpthread.so.1
+ endif
++if IS_FREEBSD6
++MANUAL_DEPS_EXTRA = $(inplacedir)/libc_r.so.6 \
++ $(inplacedir)/libthr.so.2 \
++ $(inplacedir)/libpthread.so.2
++endif
++if IS_FREEBSD7
++MANUAL_DEPS_EXTRA = $(inplacedir)/libc_r.so.6 \
++ $(inplacedir)/libthr.so.2 \
++ $(inplacedir)/libpthread.so.2
++endif
++endif
+
+ MANUAL_DEPS = $(noinst_HEADERS) $(include_HEADERS) $(inplacedir)/libpthread.so.0 ${MANUAL_DEPS_EXTRA}
+
+@@ -190,9 +202,23 @@
+ ln -sf $(top_builddir)/$(subdir)/$$i $$to; \
+ done
+ if !IS_LINUX
+- ln -sf libpthread.so.0 $(inplacedir)/libc_r.so.5
++if IS_FREEBSD4
+ ln -sf libpthread.so.0 $(inplacedir)/libc_r.so.4
++endif
++if IS_FREEBSD5
++ ln -sf libpthread.so.0 $(inplacedir)/libc_r.so.5
+ ln -sf libpthread.so.0 $(inplacedir)/libkse.so.1
+ ln -sf libpthread.so.0 $(inplacedir)/libthr.so.1
+ ln -sf libpthread.so.0 $(inplacedir)/libpthread.so.1
++endif
++if IS_FREEBSD6
++ ln -sf libpthread.so.0 $(inplacedir)/libc_r.so.6
++ ln -sf libpthread.so.0 $(inplacedir)/libthr.so.2
++ ln -sf libpthread.so.0 $(inplacedir)/libpthread.so.2
++endif
++if IS_FREEBSD7
++ ln -sf libpthread.so.0 $(inplacedir)/libc_r.so.6
++ ln -sf libpthread.so.0 $(inplacedir)/libthr.so.2
++ ln -sf libpthread.so.0 $(inplacedir)/libpthread.so.2
++endif
+ endif
diff --git a/devel/valgrind-snapshot/files/patch-coregrind_vg_main.c b/devel/valgrind-snapshot/files/patch-coregrind_vg_main.c
new file mode 100644
index 000000000000..88220ecfb985
--- /dev/null
+++ b/devel/valgrind-snapshot/files/patch-coregrind_vg_main.c
@@ -0,0 +1,27 @@
+--- coregrind/vg_main.c.orig Tue Sep 20 02:21:16 2005
++++ coregrind/vg_main.c Tue Sep 20 02:22:29 2005
+@@ -1286,6 +1286,7 @@
+
+ static const char* find_executable(const char* exec)
+ {
++ int found=0;
+ vg_assert(NULL != exec);
+ if (strchr(exec, '/') == NULL) {
+ /* no '/' - we need to search the path */
+@@ -1304,12 +1305,16 @@
+ if (access(buf, R_OK|X_OK) == 0) {
+ exec = strdup(buf);
+ vg_assert(NULL != exec);
++ found=1;
+ return 1;
+ }
+ return 0;
+ }
+ scan_colsep(path, match_exe);
+ }
++ if (!found)
++ return 0;
++
+ return exec;
+ }
+
diff --git a/devel/valgrind-snapshot/files/patch-coregrind_vg_syscalls.c b/devel/valgrind-snapshot/files/patch-coregrind_vg_syscalls.c
new file mode 100644
index 000000000000..f18c56469461
--- /dev/null
+++ b/devel/valgrind-snapshot/files/patch-coregrind_vg_syscalls.c
@@ -0,0 +1,56 @@
+--- coregrind/vg_syscalls.c.orig Fri Jul 16 19:21:08 2004
++++ coregrind/vg_syscalls.c Wed Sep 14 22:13:44 2005
+@@ -1369,6 +1369,38 @@
+ &tst->m_eflags,
+ arg1, arg2);
+ break;
++ case 7:
++ SYSCALL_TRACK( pre_mem_write, tid,
++ "sysarch.get_fsbase(args)", arg2, sizeof(UInt));
++ tst->m_eax = VG_(do_syscall_err)(__NR_sysarch,
++ tst->m_edx,
++ &tst->m_eflags,
++ arg1, arg2);
++ break;
++ case 8:
++ SYSCALL_TRACK( pre_mem_read, tid,
++ "sysarch.set_fsbase(args)", arg2, sizeof(UInt));
++ tst->m_eax = VG_(do_syscall_err)(__NR_sysarch,
++ tst->m_edx,
++ &tst->m_eflags,
++ arg1, arg2);
++ break;
++ case 9:
++ SYSCALL_TRACK( pre_mem_read, tid,
++ "sysarch.get_gsbase(args)", arg2, sizeof(UInt));
++ tst->m_eax = VG_(do_syscall_err)(__NR_sysarch,
++ tst->m_edx,
++ &tst->m_eflags,
++ arg1, arg2);
++ break;
++ case 10:
++ SYSCALL_TRACK( pre_mem_read, tid,
++ "sysarch.set_gsbase(args)", arg2, sizeof(UInt));
++ tst->m_eax = VG_(do_syscall_err)(__NR_sysarch,
++ tst->m_edx,
++ &tst->m_eflags,
++ arg1, arg2);
++ break;
+ default:
+ VG_(core_panic)("Unhandled sysarch call");
+ }
+@@ -1392,6 +1424,14 @@
+ break;
+ case 6: /* vm86 */
+ break;
++ case 7: /* get_fsbase */
++ break;
++ case 8: /* set_fsbase */
++ break;
++ case 9: /* get_gsbase */
++ break;
++ case 10: /* set_gsbase */
++ break;
+ default:
+ VG_(core_panic)("Unhandled sysarch call");
+ }
diff --git a/devel/valgrind-snapshot/pkg-plist b/devel/valgrind-snapshot/pkg-plist
index 65cb439eb8d3..aa1453871c4b 100644
--- a/devel/valgrind-snapshot/pkg-plist
+++ b/devel/valgrind-snapshot/pkg-plist
@@ -16,10 +16,15 @@ lib/valgrind/hp2ps
%%RELENG_4%%lib/valgrind/libc_r.so.4
%%RELENG_5%%lib/valgrind/libc_r.so.5
%%RELENG_5%%lib/valgrind/libkse.so.1
-lib/valgrind/libpthread.so
-lib/valgrind/libpthread.so.0
%%RELENG_5%%lib/valgrind/libpthread.so.1
%%RELENG_5%%lib/valgrind/libthr.so.1
+%%RELENG_6%%lib/valgrind/libc_r.so.6
+%%RELENG_6%%lib/valgrind/libpthread.so.2
+%%RELENG_6%%lib/valgrind/libthr.so.2
+%%RELENG_7%%lib/valgrind/libc_r.so.6
+%%RELENG_7%%lib/valgrind/libpthread.so.2
+%%RELENG_7%%lib/valgrind/libthr.so.2
+lib/valgrind/libpthread.so
lib/valgrind/stage2
lib/valgrind/valgrind
lib/valgrind/vg_inject.so