[Midnightbsd-cvs] mports: mports/devel: add valgrind (i386 only).
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Jun 27 12:01:41 EDT 2008
Log Message:
-----------
add valgrind (i386 only). Based on FreeBSD port.
Modified Files:
--------------
mports/devel:
Makefile (r1.226 -> r1.227)
Added Files:
-----------
mports/devel/valgrind:
Makefile (r1.1)
distinfo (r1.1)
pkg-descr (r1.1)
pkg-message (r1.1)
pkg-plist (r1.1)
mports/devel/valgrind/files:
patch-Makefile.am (r1.1)
patch-configure.in (r1.1)
patch-coregrind-vg_proxylwp.c (r1.1)
patch-coregrind_Makefile.am (r1.1)
patch-coregrind_vg_signals.c (r1.1)
patch-coregrind_vg_syscalls.c (r1.1)
patch-coregrind_vg_unistd.h (r1.1)
patch-coregrind_vg_unsafe.h (r1.1)
patch-helgrind_hg_main.c (r1.1)
patch-include_vg_kerneliface.h (r1.1)
patch-memcheck_mc_include.h (r1.1)
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/devel/Makefile,v
retrieving revision 1.226
retrieving revision 1.227
diff -L devel/Makefile -L devel/Makefile -u -r1.226 -r1.227
--- devel/Makefile
+++ devel/Makefile
@@ -270,6 +270,7 @@
SUBDIR += tmake
SUBDIR += uclmmbase
SUBDIR += upnp
+ SUBDIR += valgrind
SUBDIR += viewvc
SUBDIR += wizardkit
SUBDIR += yasm
--- /dev/null
+++ devel/valgrind/pkg-message
@@ -0,0 +1,19 @@
+Note: This version of valgrind does not support some older processors,
+ e.g. AMD K6-III, some (?) Pentium II.
+
+ If valgrind crashes immediately after it was started with the error
+ message "Illegal hardware instruction", your processor is affected by
+ this problem.
+
+ As a workaround you can use the devel/valgrind-snapshot port, which is
+ based on a more recent snapshot.
+
+Note 2: A sample suppression file might have been installed to \
+ %%PREFIX%%/etc/freebsd-default.supp. It makes Valgrind hide warnings
+ caused by flawed code sequences - if any - in your system libraries,
+ so that you can concentrate on the warnings issued for your own code.
+
+ To use these suppressions, either pass
+ --suppressions=%%PREFIX%%/etc/freebsd-default.supp
+ to Valgrind on the commandline, or add that line to your
+ ~/.valgrindrc file, which is the recommended way.
--- /dev/null
+++ devel/valgrind/pkg-descr
@@ -0,0 +1,13 @@
+Valgrind is a system for debugging and profiling un*x programs. With the tools
+that come with Valgrind, you can automatically detect many memory management
+and threading bugs, avoiding hours of frustrating bug-hunting, making your
+programs more stable. You can also perform detailed profiling, to speed up and
+reduce memory use of your programs.
+
+The Valgrind distribution includes five tools: two memory error detectors, a
+thread error detector, a cache profiler and a heap profiler. Several other
+tools have been built with Valgrind.
+
+Valgrind was ported to FreeBSD by Doug Rabson (http://www.rabson.org/).
+
+WWW: http://valgrind.kde.org/
--- /dev/null
+++ devel/valgrind/pkg-plist
@@ -0,0 +1,59 @@
+bin/cg_annotate
+bin/valgrind
+bin/valgrind-listener
+include/valgrind/helgrind.h
+include/valgrind/memcheck.h
+include/valgrind/valgrind.h
+include/valgrind/vg_constants_skin.h
+include/valgrind/vg_kerneliface.h
+include/valgrind/vg_skin.h
+include/valgrind/vg_unistd.h
+lib/valgrind/default.supp
+lib/valgrind/glibc-2.1.supp
+lib/valgrind/glibc-2.2.supp
+lib/valgrind/glibc-2.3.supp
+%%RELENG_5%%lib/valgrind/libc_r.so.5
+%%RELENG_5%%lib/valgrind/libkse.so.1
+%%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
+lib/valgrind/vg_symtabd
+lib/valgrind/vgpreload_addrcheck.so
+lib/valgrind/vgpreload_helgrind.so
+lib/valgrind/vgpreload_memcheck.so
+lib/valgrind/vgskin_addrcheck.so
+lib/valgrind/vgskin_cachegrind.so
+lib/valgrind/vgskin_corecheck.so
+lib/valgrind/vgskin_helgrind.so
+lib/valgrind/vgskin_lackey.so
+lib/valgrind/vgskin_memcheck.so
+lib/valgrind/vgskin_none.so
+lib/valgrind/xfree-3.supp
+lib/valgrind/xfree-4.supp
+libdata/pkgconfig/valgrind.pc
+%%VALGRIND_SUPPFILE%%etc/freebsd-default.supp
+%%PORTDOCS%%%%DOCSDIR%%/ac_main.html
+%%PORTDOCS%%%%DOCSDIR%%/cc_main.html
+%%PORTDOCS%%%%DOCSDIR%%/cg_main.html
+%%PORTDOCS%%%%DOCSDIR%%/cg_techdocs.html
+%%PORTDOCS%%%%DOCSDIR%%/coregrind_core.html
+%%PORTDOCS%%%%DOCSDIR%%/coregrind_intro.html
+%%PORTDOCS%%%%DOCSDIR%%/coregrind_tools.html
+%%PORTDOCS%%%%DOCSDIR%%/hg_main.html
+%%PORTDOCS%%%%DOCSDIR%%/lk_main.html
+%%PORTDOCS%%%%DOCSDIR%%/manual.html
+%%PORTDOCS%%%%DOCSDIR%%/mc_main.html
+%%PORTDOCS%%%%DOCSDIR%%/mc_techdocs.html
+%%PORTDOCS%%%%DOCSDIR%%/nl_main.html
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+ at dirrm lib/valgrind
+ at dirrm include/valgrind
--- /dev/null
+++ devel/valgrind/Makefile
@@ -0,0 +1,86 @@
+# Ports collection makefile for: valgrind
+# Date created: June 27, 2008
+# Whom: Lucas Holt <luke at midnightbsd.org>
+#
+# $MidnightBSD: mports/devel/valgrind/Makefile,v 1.1 2008/06/27 16:01:39 laffer1 Exp $
+#
+
+PORTNAME= valgrind
+PORTVERSION= 352
+PORTREVISION= 0
+CATEGORIES= devel
+MASTER_SITES= http://www.rabson.org/
+DISTNAME= ${PORTNAME}-stable-${PORTVERSION}
+
+MAINTAINER= luke at MidnightBSD.org
+COMMENT= A (memory) debugging and profiling tool
+
+ONLY_FOR_ARCHS= i386
+CONFLICTS= valgrind-snapshot-[0-9]*
+WRKSRC= ${WRKDIR}/${DISTNAME}
+USE_GMAKE= yes
+USE_GNOME= pkgconfig
+GNU_CONFIGURE= yes
+USE_AUTOTOOLS+= autoconf:261 aclocal:19 automake:19
+CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd6.0
+CONFIGURE_ARGS+=--enable-maintainer-mode
+USE_PERL5_BUILD=yes
+USE_GCC= 3.4
+
+.include <bsd.port.pre.mk>
+
+PLIST_SUB+= RELENG_5="@comment "
+PLIST_SUB+= RELENG_6=""
+PLIST_SUB+= RELENG_7="@comment "
+
+PROCFS!= /sbin/mount | ${GREP} '^procfs' | ${AWK} '{print $1}'
+
+pre-everything::
+
+.if ${PROCFS}
+ @${ECHO_CMD} ""
+ @${ECHO_CMD} "Check if procfs is running: YES"
+.else
+#
+# /proc is not mounted on the machine in the package building cluster that
+# that builds the list of IGNOREd ports (but it is on the build machines),
+# so we need to make an exception here.
+#
+.ifndef (PACKAGE_BUILDING)
+ECHO_MSG=/usr/bin/printf
+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\
+\ \ \ \ \ proc /proc procfs rw 0 0\n\
+\n\n
+.endif
+.endif
+
+pre-patch:
+.ifdef(NOPORTDOCS)
+ ${FIND} ${WRKSRC} -name "Makefile.in" -exec \
+ ${REINPLACE_CMD} -e "s/docs//g" {} \;
+.endif
+
+post-install:
+ @${INSTALL_DATA} ${WRKSRC}/coregrind/vg_unistd.h \
+ ${PREFIX}/include/valgrind
+
+.ifndef (PACKAGE_BUILDING)
+ @yes | ${PREFIX}/bin/valgrind --tool=memcheck --gen-suppressions=yes true 2>&1 \
+ | ${SED} -e 's,.*{$$,{,' \
+ | ${GREP} -v '^=' \
+ > ${WRKDIR}/freebsd-default.supp || \
+ ${RM} ${WRKDIR}/freebsd-default.supp
+.endif
+
+.if exists(${WRKDIR}/freebsd-default.supp)
+ @${INSTALL_DATA} ${WRKDIR}/freebsd-default.supp \
+ ${PREFIX}/lib/valgrind
+PLIST_SUB+= VALGRIND_SUPPFILE=""
+.else
+PLIST_SUB+= VALGRIND_SUPPFILE="@comment "
+.endif
+
+.include <bsd.port.post.mk>
--- /dev/null
+++ devel/valgrind/distinfo
@@ -0,0 +1,3 @@
+MD5 (valgrind-stable-352.tar.gz) = dcf8f9d7d9f8092d2215362c169fd0ab
+SHA256 (valgrind-stable-352.tar.gz) = e2fa532f48157e4f48e4dd8a411d4a2b3ef03b7e5c51587535478e3711ed2d9d
+SIZE (valgrind-stable-352.tar.gz) = 1228052
--- /dev/null
+++ devel/valgrind/files/patch-include_vg_kerneliface.h
@@ -0,0 +1,22 @@
+--- include/vg_kerneliface.h.orig Fri Jul 16 19:35:22 2004
++++ include/vg_kerneliface.h Wed Feb 15 18:24:26 2006
+@@ -177,6 +177,10 @@
+
+ #ifdef __FreeBSD__
+
++#ifdef si_band
++#undef si_band
++#endif
++
+ typedef
+ struct {
+ Int si_signo;
+@@ -975,6 +979,8 @@
+ unsigned long long rlim_max;
+ } vki_rlimit;
+
++#define VKI_RLIMIT_DATA 2
++#define VKI_RLIMIT_CORE 4
+ #define VKI_RLIMIT_NOFILE 8
+ #endif
+
--- /dev/null
+++ devel/valgrind/files/patch-coregrind_vg_syscalls.c
@@ -0,0 +1,98 @@
+--- coregrind/vg_syscalls.c.orig Fri Jul 16 10:22:32 2004
++++ coregrind/vg_syscalls.c Sun Jan 1 15:07:25 2006
+@@ -1284,6 +1284,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");
+ }
+@@ -1307,6 +1339,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");
+ }
+@@ -1489,6 +1529,21 @@
+ VG_TRACK( post_mem_write, arg1, arg2 );
+ }
+
++#if __FreeBSD__ >= 5
++PRE(uuidgen)
++{
++ /* int uuidgen(struct uuid *store, int count); */
++ MAYBE_PRINTF("uuidgen ( %p, %d )\n", arg1, arg2);
++ SYSCALL_TRACK( pre_mem_write, tid, "uuidgen(store, count)", arg1, arg2);
++}
++
++POST(uuidgen)
++{
++ VG_TRACK( post_mem_write, arg1, arg2 );
++}
++
++#endif
++
+ #endif
+
+ PRE(setresgid)
+@@ -3249,8 +3304,7 @@
+ arg3, sizeof(struct shmid_ds) );
+ break;
+ case IPC_SET:
+- case IPC_RMID:
+- SYSCALL_TRACK( pre_mem_read, tid, "shmctl(IPC_SET or IPC_RMID,buf)",
++ SYSCALL_TRACK( pre_mem_read, tid, "shmctl(IPC_SET,buf)",
+ arg3, sizeof(struct shmid_ds) );
+ break;
+ }
+@@ -6498,6 +6552,9 @@
+ SYSBA(kldstat, False),
+ SYSB_(kldfirstmod, False),
+ SYSBA(__getcwd, False),
++#if __FreeBSD__ >= 5
++ SYSBA(uuidgen, False),
++#endif
+ };
+ #define MAX_SYS_INFO (sizeof(sys_info)/sizeof(sys_info[0]))
+
--- /dev/null
+++ devel/valgrind/files/patch-coregrind_vg_unsafe.h
@@ -0,0 +1,11 @@
+--- coregrind/vg_unsafe.h.orig Sun Feb 4 20:04:39 2007
++++ coregrind/vg_unsafe.h Sun Feb 4 20:05:29 2007
+@@ -124,7 +124,7 @@
+ #include <sys/times.h>
+ #include <sys/timex.h>
+ #include <sys/event.h>
+-#include <posix4/sched.h>
++#include <sched.h>
+ #include <net/if.h>
+ #include <net/route.h>
+ #include <netinet/in.h>
--- /dev/null
+++ devel/valgrind/files/patch-Makefile.am
@@ -0,0 +1,54 @@
+--- Makefile.am.orig Thu Apr 8 21:05:08 2004
++++ Makefile.am Tue Sep 20 00:01:29 2005
+@@ -50,26 +50,46 @@
+
+ install-exec-hook:
+ $(mkinstalldirs) $(DESTDIR)$(valdir)
+- rm -f $(DESTDIR)$(valdir)/libpthread.so.0
++
+ 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
+- 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
++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
+ $(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
+
--- /dev/null
+++ devel/valgrind/files/patch-coregrind_vg_unistd.h
@@ -0,0 +1,29 @@
+--- coregrind/vg_unistd.h.orig Mon Nov 7 20:07:03 2005
++++ coregrind/vg_unistd.h Mon Nov 7 20:07:28 2005
+@@ -630,7 +630,7 @@
+ #define __NR_uuidgen 392
+ #define __NR_sendfile 393
+ #define __NR_mac_syscall 394
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ #define __NR_getfsstat 395
+ #define __NR_statfs 396
+ #define __NR_fstatfs 397
+@@ -652,7 +652,7 @@
+ #define __NR_extattr_get_link 413
+ #define __NR_extattr_delete_link 414
+ #define __NR___mac_execve 415
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ #define __NR_sigaction 416
+ #define __NR_sigreturn 417
+ #endif
+@@ -665,7 +665,7 @@
+ #define __NR___acl_delete_link 427
+ #define __NR___acl_aclcheck_link 428
+ #define __NR_sigwait 429
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ #define __NR_thr_create 430
+ #define __NR_thr_exit 431
+ #define __NR_thr_self 432
--- /dev/null
+++ devel/valgrind/files/patch-memcheck_mc_include.h
@@ -0,0 +1,32 @@
+===================================================================
+RCS file: /home2/webcvs/mirror/valgrind/memcheck/mc_include.h,v
+retrieving revision 1.16
+retrieving revision 1.16.2.1
+diff -u -p -r1.16 -r1.16.2.1
+--- memcheck/mc_include.h 2003/07/24 08:45:32 1.16
++++ memcheck/mc_include.h 2004/02/29 15:53:40 1.16.2.1
+@@ -121,16 +121,16 @@ extern void MC_(helper_value_check0_fail
+
+
+ /* Functions defined in mc_main.c */
+-extern void MC_(helperc_STOREV4) ( Addr, UInt );
+-extern void MC_(helperc_STOREV2) ( Addr, UInt );
+-extern void MC_(helperc_STOREV1) ( Addr, UInt );
++extern __attribute__ ((regparm(2))) void MC_(helperc_STOREV4) ( Addr, UInt );
++extern __attribute__ ((regparm(2))) void MC_(helperc_STOREV2) ( Addr, UInt );
++extern __attribute__ ((regparm(2))) void MC_(helperc_STOREV1) ( Addr, UInt );
+
+-extern UInt MC_(helperc_LOADV1) ( Addr );
+-extern UInt MC_(helperc_LOADV2) ( Addr );
+-extern UInt MC_(helperc_LOADV4) ( Addr );
++extern __attribute__ ((regparm(1))) UInt MC_(helperc_LOADV1) ( Addr );
++extern __attribute__ ((regparm(1))) UInt MC_(helperc_LOADV2) ( Addr );
++extern __attribute__ ((regparm(1))) UInt MC_(helperc_LOADV4) ( Addr );
+
+-extern void MC_(fpu_write_check) ( Addr addr, Int size );
+-extern void MC_(fpu_read_check) ( Addr addr, Int size );
++extern __attribute__ ((regparm(2))) void MC_(fpu_write_check) ( Addr addr, Int size );
++extern __attribute__ ((regparm(2))) void MC_(fpu_read_check) ( Addr addr, Int size );
+
+
+ /* For client requests */
--- /dev/null
+++ devel/valgrind/files/patch-coregrind_vg_signals.c
@@ -0,0 +1,18 @@
+--- coregrind/vg_signals.c.orig Mon Sep 19 21:16:07 2005
++++ coregrind/vg_signals.c Mon Sep 19 21:28:05 2005
+@@ -1488,6 +1488,15 @@
+ VG_(start_GDB)( tid );
+ }
+
++ if (core) {
++ static struct vki_rlimit zero = { 0, 0 };
++
++ VG_(message) (Vg_UserMsg, "Core dumping not implemented. 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);
++ }
++
+ if (VG_(fatal_signal_set)) {
+ VG_(fatal_sigNo) = sigNo;
+ __builtin_longjmp(VG_(fatal_signal_jmpbuf), 1);
--- /dev/null
+++ devel/valgrind/files/patch-helgrind_hg_main.c
@@ -0,0 +1,58 @@
+===================================================================
+RCS file: /home2/webcvs/mirror/valgrind/helgrind/hg_main.c,v
+retrieving revision 1.60.2.3
+retrieving revision 1.60.2.4
+diff -u -p -r1.60.2.3 -r1.60.2.4
+--- helgrind/hg_main.c 2003/12/01 13:11:15 1.60.2.3
++++ helgrind/hg_main.c 2004/02/29 15:53:40 1.60.2.4
+@@ -3101,42 +3101,42 @@ static void eraser_mem_write(Addr a, UIn
+
+ #undef DEBUG_STATE
+
+-static void eraser_mem_help_read_1(Addr a)
++REGPARM(1) static void eraser_mem_help_read_1(Addr a)
+ {
+ eraser_mem_read(a, 1, VG_(get_current_tid)());
+ }
+
+-static void eraser_mem_help_read_2(Addr a)
++REGPARM(1) static void eraser_mem_help_read_2(Addr a)
+ {
+ eraser_mem_read(a, 2, VG_(get_current_tid)());
+ }
+
+-static void eraser_mem_help_read_4(Addr a)
++REGPARM(1) static void eraser_mem_help_read_4(Addr a)
+ {
+ eraser_mem_read(a, 4, VG_(get_current_tid)());
+ }
+
+-static void eraser_mem_help_read_N(Addr a, UInt size)
++REGPARM(2) static void eraser_mem_help_read_N(Addr a, UInt size)
+ {
+ eraser_mem_read(a, size, VG_(get_current_tid)());
+ }
+
+-static void eraser_mem_help_write_1(Addr a, UInt val)
++REGPARM(2) static void eraser_mem_help_write_1(Addr a, UInt val)
+ {
+ if (*(UChar *)a != val)
+ eraser_mem_write(a, 1, VG_(get_current_tid)());
+ }
+-static void eraser_mem_help_write_2(Addr a, UInt val)
++REGPARM(2) static void eraser_mem_help_write_2(Addr a, UInt val)
+ {
+ if (*(UShort *)a != val)
+ eraser_mem_write(a, 2, VG_(get_current_tid)());
+ }
+-static void eraser_mem_help_write_4(Addr a, UInt val)
++REGPARM(2) static void eraser_mem_help_write_4(Addr a, UInt val)
+ {
+ if (*(UInt *)a != val)
+ eraser_mem_write(a, 4, VG_(get_current_tid)());
+ }
+-static void eraser_mem_help_write_N(Addr a, UInt size)
++REGPARM(2) static void eraser_mem_help_write_N(Addr a, UInt size)
+ {
+ eraser_mem_write(a, size, VG_(get_current_tid)());
+ }
--- /dev/null
+++ devel/valgrind/files/patch-coregrind-vg_proxylwp.c
@@ -0,0 +1,54 @@
+--- coregrind/vg_proxylwp.c.orig Sat Jul 17 13:48:25 2004
++++ coregrind/vg_proxylwp.c Mon Nov 7 20:06:46 2005
+@@ -30,6 +30,7 @@
+
+
+ #include "vg_include.h"
++#include "vg_unsafe.h"
+
+ #ifndef UMTX_CONTESTED
+ # if __FreeBSD_version < 502120
+@@ -595,7 +596,7 @@
+ Int ret = 1000;
+ static const vki_kstack_t ss = { .ss_flags = VKI_SS_DISABLE };
+
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ VG_(do_syscall)(__NR__umtx_lock, &px->mutex);
+ px->mutex.u_owner |= UMTX_CONTESTED;
+ VG_(do_syscall)(__NR_thr_self, &px->lwp);
+@@ -942,7 +943,7 @@
+
+ px->exitcode = ret;
+
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ ret = VG_(do_syscall)(__NR__umtx_unlock, &px->mutex);
+ if (use_rfork)
+ VG_(do_syscall)(__NR_exit, 0);
+@@ -1097,14 +1098,14 @@
+ extern Int VG_(rfork_thread)(Int, void*, void*, void*);
+ ret = VG_(rfork_thread)(VKI_RFPROC | VKI_RFMEM | VKI_RFSIGSHARE
+ | VKI_RFTHREAD
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ | VKI_RFNOWAIT
+ #endif
+ ,
+ LWP_stack(proxy), proxylwp, proxy);
+ VG_(do_signal_routing) = True;
+ } else {
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ vki_ucontext_t ctx;
+ extern void makecontext(vki_ucontext_t*, ...);
+
+@@ -1168,7 +1169,7 @@
+ }
+ }
+ #endif
+-#if __FreeBSD__ == 5
++#if __FreeBSD__ >= 5
+ if (block) {
+ if(proxy->lwp != 0)
+ VG_(do_syscall)(__NR__umtx_lock, &proxy->mutex);
--- /dev/null
+++ devel/valgrind/files/patch-coregrind_Makefile.am
@@ -0,0 +1,54 @@
+--- coregrind/Makefile.am.orig Sun Mar 14 13:52:47 2004
++++ coregrind/Makefile.am Tue Sep 20 12:00:42 2005
+@@ -162,11 +162,26 @@
+ vg_unsafe.h
+
+ if !IS_LINUX
++if IS_FREEBSD4
++MANUAL_DEPS_EXTRA = $(inplacedir)/libc_r.so.4
++endif
++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}
+
+@@ -180,9 +195,23 @@
+ ln -sf $(top_srcdir)/$(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
--- /dev/null
+++ devel/valgrind/files/patch-configure.in
@@ -0,0 +1,49 @@
+--- configure.in.orig Sun Mar 14 13:52:47 2004
++++ configure.in Mon Sep 19 23:58:01 2005
+@@ -135,11 +135,35 @@
+
+ ;;
+
++ *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)
++
++ ;;
++ *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)
++
++ ;;
++
+ *freebsd5*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VG_PLATFORM="x86-freebsd"
+ AM_CONDITIONAL(IS_LINUX, false)
+ AM_CONDITIONAL(IS_FREEBSD4, false)
++ AM_CONDITIONAL(IS_FREEBSD5, true)
++ AM_CONDITIONAL(IS_FREEBSD6, false)
++ AM_CONDITIONAL(IS_FREEBSD7, false)
+
+ ;;
+
+@@ -148,7 +172,9 @@
+ VG_PLATFORM="x86-freebsd"
+ AM_CONDITIONAL(IS_LINUX, false)
+ AM_CONDITIONAL(IS_FREEBSD4, true)
+-
++ AM_CONDITIONAL(IS_FREEBSD5, false)
++ AM_CONDITIONAL(IS_FREEBSD6, false)
++ AM_CONDITIONAL(IS_FREEBSD7, false)
+ ;;
+
+ *)
More information about the Midnightbsd-cvs
mailing list