1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-18 03:46:03 +00:00

lang/pypy and lang/pypy3: Fix rvmprof build on FreeBSD

Originally pypy did not build on FreeBSD due to build failure in rvmprof. In order to build it on FreeBSD (and OpenBSD) you have to disable rvmprof during build process. This is what a previous patch [1][2] did to enable building on FreeBSD.

This is a patch obtained from upstream [3] that actually solves the rvmprof build problem which enables building pypy/pypy3 on FreeBSD with rvmprof enabled.

[1] https://svnweb.freebsd.org/changeset/ports/473994
[2] https://reviews.freebsd.org/D16138
[3] https://bitbucket.org/pypy/pypy/issues/2853/build-fails-on-freebsd-11x-x64#comment-46813575

Reviewed by:	koobs, miwi, dbn
Approved by:	miwi, dbn
Differential Revision:	https://reviews.freebsd.org/D16378
This commit is contained in:
Babak Farrokhi 2018-07-28 05:26:21 +00:00
parent 1aaf650393
commit 2e73e982c5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=475489
8 changed files with 49 additions and 23 deletions

View File

@ -105,7 +105,7 @@ PLIST= ${.CURDIR}/pkg-plist
.include "${MASTERDIR}/bsd.pypy.mk"
.include <bsd.port.pre.mk>
.if ${OPSYS} == FreeBSD && (${OSVERSION} < 1100000 || (${ARCH} != i386 && ${ARCH} != amd64))
.if ${OPSYS} == FreeBSD && ${ARCH} != i386 && ${ARCH} != amd64
PYPY_ARGS= --withoutmod-_vmprof
.else
LIB_DEPENDS+= libunwind.so:devel/libunwind

View File

@ -13,8 +13,10 @@ PLIST_SUB+= PYPY_DIR=${PYPY_DIR} PYPY_CFFI_VER=${PYPY_CFFI_VER}
.if ${PYTHON_IMPL} == pypy
DISTVERSION= 6.0.0
PORTREVISION= 1
PYPY_CFFI_VER= ${PYTHON_IMPL}-41
.else # ${PYTHON_IMPL} == pypy3
DISTVERSION= 6.0.0
PORTREVISION= 1
PYPY_CFFI_VER= ${PYTHON_IMPL}-${DISTVERSION:S|.||:C|\..*||}-${OPSYS:tl}${OSREL:C|\..*||}
.endif

View File

@ -1,11 +0,0 @@
--- pypy/config/pypyoption.py.orig 2018-07-04 08:38:58 UTC
+++ pypy/config/pypyoption.py
@@ -42,7 +42,7 @@ working_modules.update([
from rpython.jit.backend import detect_cpu
try:
if detect_cpu.autodetect().startswith('x86'):
- if not sys.platform.startswith('openbsd'):
+ if not (sys.platform.startswith('openbsd') or sys.platform.startswith('freebsd')):
working_modules.add('_vmprof')
working_modules.add('faulthandler')
except detect_cpu.ProcessorAutodetectError:

View File

@ -0,0 +1,11 @@
--- rpython/rlib/rvmprof/cintf.py.orig 2018-04-24 06:04:29 UTC
+++ rpython/rlib/rvmprof/cintf.py
@@ -17,7 +17,7 @@ class VMProfPlatformUnsupported(Exceptio
# vmprof works only on x86 for now
IS_SUPPORTED = False
-if sys.platform in ('darwin', 'linux', 'linux2'):
+if sys.platform in ('darwin', 'linux', 'linux2') or sys.platform.startswith('freebsd'):
try:
IS_SUPPORTED = detect_cpu.autodetect().startswith('x86')
except detect_cpu.ProcessorAutodetectError:

View File

@ -0,0 +1,12 @@
--- rpython/rlib/rvmprof/src/shared/vmprof_unix.h.orig 2018-07-19 09:03:21 UTC
+++ rpython/rlib/rvmprof/src/shared/vmprof_unix.h
@@ -24,6 +24,9 @@
#include "vmprof_mt.h"
+#ifdef __FreeBSD__
+#include <ucontext.h>
+#endif
#include <signal.h>
RPY_EXTERN void vmprof_ignore_signals(int ignored);

View File

@ -1,11 +0,0 @@
--- pypy/config/pypyoption.py.orig 2018-07-04 10:31:39 UTC
+++ pypy/config/pypyoption.py
@@ -46,7 +46,7 @@ working_modules.update([
from rpython.jit.backend import detect_cpu
try:
if detect_cpu.autodetect().startswith('x86'):
- if not sys.platform.startswith('openbsd'):
+ if not (sys.platform.startswith('openbsd') or sys.platform.startswith('freebsd')):
working_modules.add('_vmprof')
working_modules.add('faulthandler')
except detect_cpu.ProcessorAutodetectError:

View File

@ -0,0 +1,11 @@
--- rpython/rlib/rvmprof/cintf.py.orig 2018-04-24 06:04:29 UTC
+++ rpython/rlib/rvmprof/cintf.py
@@ -17,7 +17,7 @@ class VMProfPlatformUnsupported(Exceptio
# vmprof works only on x86 for now
IS_SUPPORTED = False
-if sys.platform in ('darwin', 'linux', 'linux2'):
+if sys.platform in ('darwin', 'linux', 'linux2') or sys.platform.startswith('freebsd'):
try:
IS_SUPPORTED = detect_cpu.autodetect().startswith('x86')
except detect_cpu.ProcessorAutodetectError:

View File

@ -0,0 +1,12 @@
--- rpython/rlib/rvmprof/src/shared/vmprof_unix.h.orig 2018-07-19 09:03:21 UTC
+++ rpython/rlib/rvmprof/src/shared/vmprof_unix.h
@@ -24,6 +24,9 @@
#include "vmprof_mt.h"
+#ifdef __FreeBSD__
+#include <ucontext.h>
+#endif
#include <signal.h>
RPY_EXTERN void vmprof_ignore_signals(int ignored);