aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2016-12-21 00:33:55 +0800
committermat <mat@FreeBSD.org>2016-12-21 00:33:55 +0800
commit09a2afa42735230019a6ea5a8830fec04e82c4b7 (patch)
tree98c2b33637a1208193f413bed134cb721a420e94 /lang
parent249ea2a4dbb7704adf07b8f2d8e72a4002879ea5 (diff)
downloadfreebsd-ports-gnome-09a2afa42735230019a6ea5a8830fec04e82c4b7.tar.gz
freebsd-ports-gnome-09a2afa42735230019a6ea5a8830fec04e82c4b7.tar.zst
freebsd-ports-gnome-09a2afa42735230019a6ea5a8830fec04e82c4b7.zip
Get a DTRACE option for lang/perl5.24 and lang/perl5-devel.
Submitted by: swills Sponsored by: Absolight
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5-devel/Makefile13
-rw-r--r--lang/perl5-devel/files/patch-dtrace266
-rw-r--r--lang/perl5-devel/pkg-plist1
-rw-r--r--lang/perl5.24/Makefile13
-rw-r--r--lang/perl5.24/files/patch-dtrace266
-rw-r--r--lang/perl5.24/pkg-plist1
6 files changed, 554 insertions, 6 deletions
diff --git a/lang/perl5-devel/Makefile b/lang/perl5-devel/Makefile
index f1b52792f7ba..515ca8bb668c 100644
--- a/lang/perl5-devel/Makefile
+++ b/lang/perl5-devel/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= perl
-PORTREVISION= 0
+PORTREVISION= 1
# XXX Remove second line, uncomment first
#DISTVERSION= ${PERL_VERSION}
DISTVERSION= ${GH_TAGNAME:C/^v//:C/-g[0-9a-f]*$//}
@@ -35,8 +35,13 @@ GH_TAGNAME= v5.25.7-145-g54f6f37
MAKE_JOBS_UNSAFE= yes
OPTIONS_DEFINE= DEBUG GDBM PERL_64BITINT MULTIPLICITY SITECUSTOMIZE \
- THREADS PERL_MALLOC
-OPTIONS_DEFAULT= PERL_64BITINT THREADS MULTIPLICITY
+ THREADS PERL_MALLOC DTRACE
+OPTIONS_DEFAULT= PERL_64BITINT THREADS MULTIPLICITY DTRACE
+
+.if !exists(/usr/sbin/dtrace)
+OPTIONS_EXCLUDE+= DTRACE
+.endif
+OPTIONS_EXCLUDE_FreeBSD_9= DTRACE
EXCLUSIVE_DESC= Exclusive OPTIONS
GDBM_DESC= GDBM_File extension
@@ -49,6 +54,8 @@ SITECUSTOMIZE_DESC= Run-time customization of @INC
OPTIONS_SUB= yes
DEBUG_CONFIGURE_ON= -Doptimize="-g" -DDEBUGGING
DEBUG_CONFIGURE_OFF= -Doptimize="${CFLAGS}"
+DTRACE_CONFIGURE_ON= -Dusedtrace
+DTRACE_CONFIGURE_OFF= -Uusedtrace
GDBM_CONFIGURE_ON= -Di_gdbm
GDBM_CONFIGURE_OFF= -Ui_gdbm
GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm
diff --git a/lang/perl5-devel/files/patch-dtrace b/lang/perl5-devel/files/patch-dtrace
new file mode 100644
index 000000000000..7bae626907a7
--- /dev/null
+++ b/lang/perl5-devel/files/patch-dtrace
@@ -0,0 +1,266 @@
+--- Configure.orig 2016-07-14 15:08:07.000000000 -0400
++++ Configure 2016-11-24 08:13:04.507723000 -0500
+@@ -940,6 +940,7 @@
+ usedl=''
+ doublesize=''
+ dtraceobject=''
++dtracexnolibs=''
+ ebcdic=''
+ fflushNULL=''
+ fflushall=''
+@@ -8140,10 +8141,19 @@
+
+ if $test -f $dtrace
+ then
+- if $dtrace -h -s ../perldtrace.d \
++ if $dtrace -h -xnolibs -s ../perldtrace.d \
+ -o perldtrace.tmp >/dev/null 2>&1 \
+ && rm -f perldtrace.tmp
+ then
++ default_xnolibs=$define
++ echo " "
++ echo "Good: your $dtrace knows about the -h flag"
++ echo "and apparently the -xnolibs flag."
++ elif $dtrace -h -s ../perldtrace.d \
++ -o perldtrace.tmp >/dev/null 2>&1 \
++ && rm -f perldtrace.tmp
++ then
++ default_xnolibs=$undef
+ echo " "
+ echo "Good: your $dtrace knows about the -h flag."
+ else
+@@ -8157,6 +8167,17 @@
+ EOM
+ exit 1
+ fi
++ case "$dtracexnolibs" in
++ $define|true|[yY]*)
++ dtracxnolibs=$define
++ ;;
++ ''|' ')
++ dtracexnolibs=$default_xnolibs
++ ;;
++ *)
++ dtracexnolibs=$undef
++ ;;
++ esac
+ break;
+ fi
+
+@@ -20756,7 +20777,11 @@
+ dtraceobject=$define
+ ;;
+ ' '|'')
+- $dtrace -h -s ../perldtrace.d -o perldtrace.h
++ case "$dtracexnolibs" in
++ $define) xnolibs_option=-xnolibs ;;
++ *) xnolibs_option= ;;
++ esac
++ $dtrace -h $xnolibs_option -s ../perldtrace.d -o perldtrace.h
+ $cat >try.c <<EOM
+ #include "perldtrace.h"
+ int main(void) {
+@@ -20766,14 +20791,14 @@
+ EOM
+ dtraceobject=$undef
+ if $cc -c -o try.o $optimize $ccflags try.c \
+- && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
++ && $dtrace -G $xnolibs_option -s ../perldtrace.d try.o >/dev/null 2>&1; then
+ dtraceobject=$define
+ echo "Your dtrace builds an object file"
+ fi
+- $rm -f try.c try.o perldtrace.o
+ ;;
+ *) dtraceobject=$undef ;;
+ esac
++ $rm -f try.c try.o perldtrace.o perldtrace.h
+ esac
+
+ : Determine if this is an EBCDIC system
+@@ -24722,6 +24747,7 @@
+ drand48_r_proto='$drand48_r_proto'
+ dtrace='$dtrace'
+ dtraceobject='$dtraceobject'
++dtracexnolibs='$dtracexnolibs'
+ dynamic_ext='$dynamic_ext'
+ eagain='$eagain'
+ ebcdic='$ebcdic'
+--- Makefile.SH.orig 2016-11-24 15:10:33.097920000 +0100
++++ Makefile.SH 2016-11-24 15:12:04.276966000 +0100
+@@ -389,8 +389,13 @@
+ ;;
+ esac
+
++case "$dtracexnolibs" in
++define) xnolibs=-xnolibs ;;
++*) xnolibs= ;;
++esac
++
+ $spitshell >>$Makefile <<!GROK!THIS!
+-DTRACE = $dtrace
++DTRACE = $dtrace $xnolibs
+ DTRACE_H = $dtrace_h
+
+ DTRACE_PERLLIB_O = $dtrace_perllib_o # "dtrace -G" output for perllib_objs
+@@ -517,10 +522,53 @@
+ miniperl_objs_nodt = $(mini_only_objs) $(common_objs) miniperlmain$(OBJ_EXT)
+ perllib_objs_nodt = $(main_only_objs) $(common_objs)
+
++!NO!SUBS!
++
++# dtrace with -G modifies the source object files, which can cause
++# dependency issues, and can cause the dtrace -G to fail on FreeBSD
++# so separate the objects generated by $(CC) from those used to link
++# the executable when dtrace -G is involved.
++#
++# $(FOO:op%os=np%ns) isn't generally portable but is portable to
++# the makes on darwin, Solaris, FreeBSD and Linux, which is where we
++# use dtrace
++
++case "$usedtrace:$dtraceobject" in
++define:define)
++ $spitshell >>$Makefile <<'!NO!SUBS!'
++
++miniperl_dtrace_objs = $(miniperl_objs_nodt:%=mpdtrace/%)
++perllib_dtrace_objs = $(perllib_objs_nodt:%=libpdtrace/%)
++perlmain_dtrace_objs = maindtrace/perlmain$(OBJ_EXT)
++
++miniperl_objs = $(miniperl_dtrace_objs) $(DTRACE_MINI_O)
++perllib_objs = $(perllib_dtrace_objs) $(DTRACE_PERLLIB_O)
++perlmain_objs = $(perlmain_dtrace_objs) $(DTRACE_MAIN_O)
++
++miniperl_dep = $(DTRACE_MINI_O)
++perllib_dep = $(DTRACE_PERLLIB_O)
++perlmain_dep = $(DTRACE_MAIN_O)
++
++!NO!SUBS!
++ ;;
++ *)
++
++ $spitshell >>$Makefile <<'!NO!SUBS!'
++
+ miniperl_objs = $(miniperl_objs_nodt) $(DTRACE_MINI_O)
+ perllib_objs = $(perllib_objs_nodt) $(DTRACE_PERLLIB_O)
+ perlmain_objs = perlmain$(OBJ_EXT) $(DTRACE_MAIN_O)
+
++miniperl_dep = $(miniperl_objs)
++perllib_dep = $(perllib_objs)
++perlmain_dep = $(perlmain_objs)
++
++!NO!SUBS!
++ ;;
++esac
++
++$spitshell >>$Makefile <<'!NO!SUBS!'
++
+ perltoc_pod_prereqs = extra.pods pod/perl5258delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod
+ generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs)
+ generated_headers = uudmap.h bitcount.h mg_data.h
+@@ -859,19 +907,32 @@
+ define)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
+- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_objs_nodt)
++ -rm -rf mpdtrace
++ mkdir mpdtrace
++ cp $(miniperl_objs_nodt) mpdtrace/
++ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_dtrace_objs)
+
+ $(DTRACE_PERLLIB_O): perldtrace.d $(perllib_objs_nodt)
+- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_objs_nodt)
++ -rm -rf libpdtrace
++ mkdir libpdtrace
++ cp $(perllib_objs_nodt) libpdtrace/
++ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_dtrace_objs)
+
+ $(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
+- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) perlmain$(OBJ_EXT)
++ -rm -rf maindtrace
++ mkdir maindtrace
++ cp perlmain$(OBJ_EXT) maindtrace/
++ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) $(perlmain_dtrace_objs) || \
++ ( $(ECHO) "No probes in perlmain$(OBJ_EXT), generating a dummy $(DTRACE_MAIN_O)" && \
++ $(ECHO) >dtrace_main.c && \
++ `$(CCCMD)` $(PLDLFLAGS) dtrace_main.c && \
++ rm -f dtrace_main.c )
+
+ !NO!SUBS!
+ ;;
+ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-$(LIBPERL): $& $(perllib_objs) $(DYNALOADER) $(LIBPERLEXPORT)
++$(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT)
+ !NO!SUBS!
+ case "$useshrplib" in
+ true)
+@@ -972,7 +1033,7 @@
+ *)
+ if test "X$hostperl" != X; then
+ $spitshell >>$Makefile <<!GROK!THIS!
+-lib/buildcustomize.pl: \$& \$(miniperl_objs) write_buildcustomize.pl
++lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ -@rm \$(MINIPERL_EXE)
+ \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+@@ -981,7 +1042,7 @@
+ !GROK!THIS!
+ else
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
++lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(miniperl_objs) $(libs)
+@@ -994,7 +1055,7 @@
+
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+
+-$(PERL_EXE): $& $(perlmain_objs) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
++$(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ !NO!SUBS!
+
+--- Porting/Glossary.orig 2016-07-14 15:06:55.000000000 -0400
++++ Porting/Glossary 2016-11-24 08:13:04.511723000 -0500
+@@ -2949,6 +2949,11 @@
+ dtraceobject (dtraceobject.U):
+ Whether we need to build an object file with the dtrace tool.
+
++dtracexnolibs (dtraceobject.U):
++ Whether dtrace accepts -xnolibs. If available we call dtrace -h
++ and dtrace -G with -xnolibs to allow dtrace to run in a jail on
++ FreeBSD.
++
+ dynamic_ext (Extensions.U):
+ This variable holds a list of XS extension files we want to
+ link dynamically into the package. It is used by Makefile.
+--- ext/XS-APItest/Makefile.PL.orig 2016-07-14 15:08:07.000000000 -0400
++++ ext/XS-APItest/Makefile.PL 2016-11-24 08:13:04.512100000 -0500
+@@ -58,7 +58,8 @@
+ DTRACE_D = ../../perldtrace.d
+
+ dtrace\$(OBJ_EXT): \$(DTRACE_D) core\$(OBJ_EXT)
+- $Config{dtrace} -G -s \$(DTRACE_D) -o dtrace\$(OBJ_EXT) core\$(OBJ_EXT)
++ $Config{dtrace} -G -s \$(DTRACE_D) -o dtrace\$(OBJ_EXT) core\$(OBJ_EXT) || \\
++ ( \$(ECHO) >dtrace.c && \$(CCCMD) \$(CCCDLFLAGS) dtrace.c && rm -f dtrace.c )
+ POSTAMBLE
+
+ return $post;
+--- hints/freebsd.sh.orig 2016-07-14 15:07:39.000000000 -0400
++++ hints/freebsd.sh 2016-11-24 08:13:04.512583000 -0500
+@@ -105,6 +105,15 @@
+ ;;
+ esac
+
++case "$osvers" in
++10.*)
++ # dtrace on 10.x needs libelf symbols, but we don't know if the
++ # user is going to request usedtrace and there's no .cbu for usedtrace
++ libswanted="$libswanted elf"
++ echo "libswanted $libswanted" >&4
++ ;;
++esac
++
+ # Dynamic Loading flags have not changed much, so they are separated
+ # out here to avoid duplicating them everywhere.
+ case "$osvers" in
diff --git a/lang/perl5-devel/pkg-plist b/lang/perl5-devel/pkg-plist
index cb1f275c886f..bdc503f3f2fc 100644
--- a/lang/perl5-devel/pkg-plist
+++ b/lang/perl5-devel/pkg-plist
@@ -730,6 +730,7 @@ etc/man.d/perl%%PKGNAMESUFFIX%%.conf
%%ARCH_LIB%%/CORE/patchlevel.h
%%ARCH_LIB%%/CORE/perl.h
%%ARCH_LIB%%/CORE/perlapi.h
+%%DTRACE%%%%ARCH_LIB%%/CORE/perldtrace.h
%%ARCH_LIB%%/CORE/perlio.h
%%ARCH_LIB%%/CORE/perliol.h
%%ARCH_LIB%%/CORE/perlsdio.h
diff --git a/lang/perl5.24/Makefile b/lang/perl5.24/Makefile
index 54006f2aef45..b22890f43128 100644
--- a/lang/perl5.24/Makefile
+++ b/lang/perl5.24/Makefile
@@ -3,7 +3,7 @@
PORTNAME= perl
DISTVERSION= ${PERL_VERSION}-RC4
-PORTREVISION= 0
+PORTREVISION= 1
CATEGORIES= lang devel perl5
MASTER_SITES= CPAN/../../src/5.0 CPAN/../by-authors/id/S/SH/SHAY
DIST_SUBDIR= perl
@@ -21,11 +21,16 @@ TEST_ENV= ${MAKE_ENV} TEST_JOBS=${MAKE_JOBS_NUMBER} \
LD_LIBRARY_PATH=${WRKSRC}
OPTIONS_DEFINE= DEBUG GDBM PERL_64BITINT PTHREAD \
- MULTIPLICITY SITECUSTOMIZE
+ MULTIPLICITY SITECUSTOMIZE DTRACE
# it seems perl malloc has problems with threaded perl on FreeBSD
OPTIONS_RADIO= EXCLUSIVE
OPTIONS_RADIO_EXCLUSIVE= THREADS PERL_MALLOC
-OPTIONS_DEFAULT= PERL_64BITINT THREADS PTHREAD MULTIPLICITY
+OPTIONS_DEFAULT= PERL_64BITINT THREADS PTHREAD MULTIPLICITY DTRACE
+
+.if !exists(/usr/sbin/dtrace)
+OPTIONS_EXCLUDE+= DTRACE
+.endif
+OPTIONS_EXCLUDE_FreeBSD_9= DTRACE
EXCLUSIVE_DESC= Exclusive OPTIONS
GDBM_DESC= GDBM_File extension
@@ -39,6 +44,8 @@ SITECUSTOMIZE_DESC= Run-time customization of @INC
OPTIONS_SUB= yes
DEBUG_CONFIGURE_ON= -Doptimize="-g" -DDEBUGGING
DEBUG_CONFIGURE_OFF= -Doptimize="${CFLAGS}"
+DTRACE_CONFIGURE_ON= -Dusedtrace
+DTRACE_CONFIGURE_OFF= -Uusedtrace
GDBM_CONFIGURE_ON= -Di_gdbm
GDBM_CONFIGURE_OFF= -Ui_gdbm
GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm
diff --git a/lang/perl5.24/files/patch-dtrace b/lang/perl5.24/files/patch-dtrace
new file mode 100644
index 000000000000..3cc862e2678f
--- /dev/null
+++ b/lang/perl5.24/files/patch-dtrace
@@ -0,0 +1,266 @@
+--- Configure.orig 2016-07-14 15:08:07.000000000 -0400
++++ Configure 2016-11-24 08:13:04.507723000 -0500
+@@ -940,6 +940,7 @@
+ usedl=''
+ doublesize=''
+ dtraceobject=''
++dtracexnolibs=''
+ ebcdic=''
+ fflushNULL=''
+ fflushall=''
+@@ -8140,10 +8141,19 @@
+
+ if $test -f $dtrace
+ then
+- if $dtrace -h -s ../perldtrace.d \
++ if $dtrace -h -xnolibs -s ../perldtrace.d \
+ -o perldtrace.tmp >/dev/null 2>&1 \
+ && rm -f perldtrace.tmp
+ then
++ default_xnolibs=$define
++ echo " "
++ echo "Good: your $dtrace knows about the -h flag"
++ echo "and apparently the -xnolibs flag."
++ elif $dtrace -h -s ../perldtrace.d \
++ -o perldtrace.tmp >/dev/null 2>&1 \
++ && rm -f perldtrace.tmp
++ then
++ default_xnolibs=$undef
+ echo " "
+ echo "Good: your $dtrace knows about the -h flag."
+ else
+@@ -8157,6 +8167,17 @@
+ EOM
+ exit 1
+ fi
++ case "$dtracexnolibs" in
++ $define|true|[yY]*)
++ dtracxnolibs=$define
++ ;;
++ ''|' ')
++ dtracexnolibs=$default_xnolibs
++ ;;
++ *)
++ dtracexnolibs=$undef
++ ;;
++ esac
+ break;
+ fi
+
+@@ -20756,7 +20777,11 @@
+ dtraceobject=$define
+ ;;
+ ' '|'')
+- $dtrace -h -s ../perldtrace.d -o perldtrace.h
++ case "$dtracexnolibs" in
++ $define) xnolibs_option=-xnolibs ;;
++ *) xnolibs_option= ;;
++ esac
++ $dtrace -h $xnolibs_option -s ../perldtrace.d -o perldtrace.h
+ $cat >try.c <<EOM
+ #include "perldtrace.h"
+ int main(void) {
+@@ -20766,14 +20791,14 @@
+ EOM
+ dtraceobject=$undef
+ if $cc -c -o try.o $optimize $ccflags try.c \
+- && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
++ && $dtrace -G $xnolibs_option -s ../perldtrace.d try.o >/dev/null 2>&1; then
+ dtraceobject=$define
+ echo "Your dtrace builds an object file"
+ fi
+- $rm -f try.c try.o perldtrace.o
+ ;;
+ *) dtraceobject=$undef ;;
+ esac
++ $rm -f try.c try.o perldtrace.o perldtrace.h
+ esac
+
+ : Determine if this is an EBCDIC system
+@@ -24722,6 +24747,7 @@
+ drand48_r_proto='$drand48_r_proto'
+ dtrace='$dtrace'
+ dtraceobject='$dtraceobject'
++dtracexnolibs='$dtracexnolibs'
+ dynamic_ext='$dynamic_ext'
+ eagain='$eagain'
+ ebcdic='$ebcdic'
+--- Makefile.SH.orig 2016-07-16 06:52:42.000000000 -0400
++++ Makefile.SH 2016-11-24 08:13:04.508901000 -0500
+@@ -390,8 +390,13 @@
+ ;;
+ esac
+
++case "$dtracexnolibs" in
++define) xnolibs=-xnolibs ;;
++*) xnolibs= ;;
++esac
++
+ $spitshell >>$Makefile <<!GROK!THIS!
+-DTRACE = $dtrace
++DTRACE = $dtrace $xnolibs
+ DTRACE_H = $dtrace_h
+
+ DTRACE_PERLLIB_O = $dtrace_perllib_o # "dtrace -G" output for perllib_objs
+@@ -518,10 +523,53 @@
+ miniperl_objs_nodt = $(mini_only_objs) $(common_objs) miniperlmain$(OBJ_EXT)
+ perllib_objs_nodt = $(main_only_objs) $(common_objs)
+
++!NO!SUBS!
++
++# dtrace with -G modifies the source object files, which can cause
++# dependency issues, and can cause the dtrace -G to fail on FreeBSD
++# so separate the objects generated by $(CC) from those used to link
++# the executable when dtrace -G is involved.
++#
++# $(FOO:op%os=np%ns) isn't generally portable but is portable to
++# the makes on darwin, Solaris, FreeBSD and Linux, which is where we
++# use dtrace
++
++case "$usedtrace:$dtraceobject" in
++define:define)
++ $spitshell >>$Makefile <<'!NO!SUBS!'
++
++miniperl_dtrace_objs = $(miniperl_objs_nodt:%=mpdtrace/%)
++perllib_dtrace_objs = $(perllib_objs_nodt:%=libpdtrace/%)
++perlmain_dtrace_objs = maindtrace/perlmain$(OBJ_EXT)
++
++miniperl_objs = $(miniperl_dtrace_objs) $(DTRACE_MINI_O)
++perllib_objs = $(perllib_dtrace_objs) $(DTRACE_PERLLIB_O)
++perlmain_objs = $(perlmain_dtrace_objs) $(DTRACE_MAIN_O)
++
++miniperl_dep = $(DTRACE_MINI_O)
++perllib_dep = $(DTRACE_PERLLIB_O)
++perlmain_dep = $(DTRACE_MAIN_O)
++
++!NO!SUBS!
++ ;;
++ *)
++
++ $spitshell >>$Makefile <<'!NO!SUBS!'
++
+ miniperl_objs = $(miniperl_objs_nodt) $(DTRACE_MINI_O)
+ perllib_objs = $(perllib_objs_nodt) $(DTRACE_PERLLIB_O)
+ perlmain_objs = perlmain$(OBJ_EXT) $(DTRACE_MAIN_O)
+
++miniperl_dep = $(miniperl_objs)
++perllib_dep = $(perllib_objs)
++perlmain_dep = $(perlmain_objs)
++
++!NO!SUBS!
++ ;;
++esac
++
++$spitshell >>$Makefile <<'!NO!SUBS!'
++
+ perltoc_pod_prereqs = extra.pods pod/perl5241delta.pod pod/perlapi.pod pod/perlintern.pod pod/perlmodlib.pod pod/perluniprops.pod
+ generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs)
+ generated_headers = uudmap.h bitcount.h mg_data.h
+@@ -860,19 +908,32 @@
+ define)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ $(DTRACE_MINI_O): perldtrace.d $(miniperl_objs_nodt)
+- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_objs_nodt)
++ -rm -rf mpdtrace
++ mkdir mpdtrace
++ cp $(miniperl_objs_nodt) mpdtrace/
++ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MINI_O) $(miniperl_dtrace_objs)
+
+ $(DTRACE_PERLLIB_O): perldtrace.d $(perllib_objs_nodt)
+- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_objs_nodt)
++ -rm -rf libpdtrace
++ mkdir libpdtrace
++ cp $(perllib_objs_nodt) libpdtrace/
++ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_PERLLIB_O) $(perllib_dtrace_objs)
+
+ $(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT)
+- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) perlmain$(OBJ_EXT)
++ -rm -rf maindtrace
++ mkdir maindtrace
++ cp perlmain$(OBJ_EXT) maindtrace/
++ $(DTRACE) -G -s perldtrace.d -o $(DTRACE_MAIN_O) $(perlmain_dtrace_objs) || \
++ ( $(ECHO) "No probes in perlmain$(OBJ_EXT), generating a dummy $(DTRACE_MAIN_O)" && \
++ $(ECHO) >dtrace_main.c && \
++ `$(CCCMD)` $(PLDLFLAGS) dtrace_main.c && \
++ rm -f dtrace_main.c )
+
+ !NO!SUBS!
+ ;;
+ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-$(LIBPERL): $& $(perllib_objs) $(DYNALOADER) $(LIBPERLEXPORT)
++$(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT)
+ !NO!SUBS!
+ case "$useshrplib" in
+ true)
+@@ -973,7 +1034,7 @@
+ *)
+ if test "X$hostperl" != X; then
+ $spitshell >>$Makefile <<!GROK!THIS!
+-lib/buildcustomize.pl: \$& \$(miniperl_objs) write_buildcustomize.pl
++lib/buildcustomize.pl: \$& \$(miniperl_dep) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ -@rm \$(MINIPERL_EXE)
+ \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+@@ -982,7 +1043,7 @@
+ !GROK!THIS!
+ else
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl
++lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(miniperl_objs) $(libs)
+@@ -995,7 +1056,7 @@
+
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+
+-$(PERL_EXE): $& $(perlmain_objs) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
++$(PERL_EXE): $& $(perlmain_dep) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) write_buildcustomize.pl
+ -@rm -f miniperl.xok
+ !NO!SUBS!
+
+--- Porting/Glossary.orig 2016-07-14 15:06:55.000000000 -0400
++++ Porting/Glossary 2016-11-24 08:13:04.511723000 -0500
+@@ -2949,6 +2949,11 @@
+ dtraceobject (dtraceobject.U):
+ Whether we need to build an object file with the dtrace tool.
+
++dtracexnolibs (dtraceobject.U):
++ Whether dtrace accepts -xnolibs. If available we call dtrace -h
++ and dtrace -G with -xnolibs to allow dtrace to run in a jail on
++ FreeBSD.
++
+ dynamic_ext (Extensions.U):
+ This variable holds a list of XS extension files we want to
+ link dynamically into the package. It is used by Makefile.
+--- ext/XS-APItest/Makefile.PL.orig 2016-07-14 15:08:07.000000000 -0400
++++ ext/XS-APItest/Makefile.PL 2016-11-24 08:13:04.512100000 -0500
+@@ -58,7 +58,8 @@
+ DTRACE_D = ../../perldtrace.d
+
+ dtrace\$(OBJ_EXT): \$(DTRACE_D) core\$(OBJ_EXT)
+- $Config{dtrace} -G -s \$(DTRACE_D) -o dtrace\$(OBJ_EXT) core\$(OBJ_EXT)
++ $Config{dtrace} -G -s \$(DTRACE_D) -o dtrace\$(OBJ_EXT) core\$(OBJ_EXT) || \\
++ ( \$(ECHO) >dtrace.c && \$(CCCMD) \$(CCCDLFLAGS) dtrace.c && rm -f dtrace.c )
+ POSTAMBLE
+
+ return $post;
+--- hints/freebsd.sh.orig 2016-07-14 15:07:39.000000000 -0400
++++ hints/freebsd.sh 2016-11-24 08:13:04.512583000 -0500
+@@ -105,6 +105,15 @@
+ ;;
+ esac
+
++case "$osvers" in
++10.*)
++ # dtrace on 10.x needs libelf symbols, but we don't know if the
++ # user is going to request usedtrace and there's no .cbu for usedtrace
++ libswanted="$libswanted elf"
++ echo "libswanted $libswanted" >&4
++ ;;
++esac
++
+ # Dynamic Loading flags have not changed much, so they are separated
+ # out here to avoid duplicating them everywhere.
+ case "$osvers" in
diff --git a/lang/perl5.24/pkg-plist b/lang/perl5.24/pkg-plist
index d58152c5b0ca..94aaeae1d5be 100644
--- a/lang/perl5.24/pkg-plist
+++ b/lang/perl5.24/pkg-plist
@@ -689,6 +689,7 @@ etc/man.d/perl%%PKGNAMESUFFIX%%.conf
%%ARCH_LIB%%/CORE/patchlevel.h
%%ARCH_LIB%%/CORE/perl.h
%%ARCH_LIB%%/CORE/perlapi.h
+%%DTRACE%%%%ARCH_LIB%%/CORE/perldtrace.h
%%ARCH_LIB%%/CORE/perlio.h
%%ARCH_LIB%%/CORE/perliol.h
%%ARCH_LIB%%/CORE/perlsdio.h