--- Configure.orig 2016-07-14 19:08:07 UTC +++ Configure @@ -940,6 +940,7 @@ lddlflags='' usedl='' doublesize='' dtraceobject='' +dtracexnolibs='' ebcdic='' fflushNULL='' fflushall='' @@ -8140,10 +8141,19 @@ while $test 1 ; do 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 @@ while $test 1 ; do EOM exit 1 fi + case "$dtracexnolibs" in + $define|true|[yY]*) + dtracxnolibs=$define + ;; + ''|' ') + dtracexnolibs=$default_xnolibs + ;; + *) + dtracexnolibs=$undef + ;; + esac break; fi @@ -20756,7 +20777,11 @@ $define) 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 </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 @@ drand01='$drand01' 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 10:52:42 UTC +++ Makefile.SH @@ -390,8 +390,13 @@ VG_TEST ?= ./perl -e 1 2>/dev/null ;; esac +case "$dtracexnolibs" in +define) xnolibs=-xnolibs ;; +*) xnolibs= ;; +esac + $spitshell >>$Makefile <>$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/perl5242delta.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 @@ mydtrace.h: $(DTRACE_H) 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 @@ lib/buildcustomize.pl: $& $(miniperl_obj *) if test "X$hostperl" != X; then $spitshell >>$Makefile <>$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 @@ lib/buildcustomize.pl: $& $(miniperl_obj $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 19:06:55 UTC +++ Porting/Glossary @@ -2949,6 +2949,11 @@ dtrace (usedtrace.U): 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 19:08:07 UTC +++ ext/XS-APItest/Makefile.PL @@ -58,7 +58,8 @@ sub MY::postamble 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 19:07:39 UTC +++ hints/freebsd.sh @@ -105,6 +105,15 @@ case "$osvers" in ;; 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