[pypy-commit] pypy default: fix a few freebsd issues

fijal noreply at buildbot.pypy.org
Wed Jul 8 12:33:16 CEST 2015


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r78493:f4196519dd86
Date: 2015-07-08 12:33 +0200
http://bitbucket.org/pypy/pypy/changeset/f4196519dd86/

Log:	fix a few freebsd issues

diff --git a/pypy/module/_vmprof/interp_vmprof.py b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -23,11 +23,16 @@
 # running make inside the src dir
 DYNAMIC_VMPROF = False
 
+if sys.platform.startswith('linux'):
+    libs = ['dl']
+else:
+    libs = []
+
 eci_kwds = dict(
     include_dirs = [SRC],
     includes = ['vmprof.h', 'trampoline.h'],
     separate_module_files = [SRC.join('trampoline.vmprof.s')],
-    libraries = ['dl'],
+    libraries = libs,
     
     post_include_bits=["""
         int pypy_vmprof_init(void);
diff --git a/pypy/module/_vmprof/src/config.h b/pypy/module/_vmprof/src/config.h
--- a/pypy/module/_vmprof/src/config.h
+++ b/pypy/module/_vmprof/src/config.h
@@ -1,2 +1,6 @@
 #define HAVE_SYS_UCONTEXT_H
+#if defined(__FreeBSD__) || defined(__APPLE__)
+#define PC_FROM_UCONTEXT uc_mcontext.mc_rip
+#else
 #define PC_FROM_UCONTEXT uc_mcontext.gregs[REG_RIP]
+#endif
diff --git a/pypy/module/_vmprof/src/vmprof.c b/pypy/module/_vmprof/src/vmprof.c
--- a/pypy/module/_vmprof/src/vmprof.c
+++ b/pypy/module/_vmprof/src/vmprof.c
@@ -33,6 +33,9 @@
 //#include <libunwind.h>
 
 #include "vmprof.h"
+#if defined(__FreeBSD__) || defined(__APPLE__)
+#define sighandler_t sig_t
+#endif
 
 #define _unused(x) ((void)x)
 


More information about the pypy-commit mailing list