diff options
author | Tony Cook <tony@develop-help.com> | 2016-11-28 15:19:12 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2017-01-05 10:05:02 +1100 |
commit | 728ecd1a39982c980df9493fd4040692b931f2a0 (patch) | |
tree | a0e5a7d1c992ba4a4163ea60376cab31aedfe026 /Makefile.SH | |
parent | c345ac2ecadb636f02f27978602d82bc0dc444e7 (diff) | |
download | perl-728ecd1a39982c980df9493fd4040692b931f2a0.tar.gz |
(perl #130108) separate compiled objects from dtrace modified objects
When generating an object file with "dtrace -G", dtrace also modifies
the input object files.
This causes two problems:
1) Since the objects are modified, their modification times are updated
which may break dependency checks by make.
2) on FreeBSD at least, once the object has been processed it can't be
processed again by dtrace -G
Diffstat (limited to 'Makefile.SH')
-rwxr-xr-x | Makefile.SH | 65 |
1 files changed, 58 insertions, 7 deletions
diff --git a/Makefile.SH b/Makefile.SH index 6a283837a7..fce2928aff 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -518,10 +518,52 @@ main_only_objs = op$(OBJ_EXT) perl$(OBJ_EXT) 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/perl5259delta.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 @@ -834,13 +876,22 @@ 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 && \ @@ -850,7 +901,7 @@ $(DTRACE_MAIN_O): perldtrace.d perlmain$(OBJ_EXT) ;; esac $spitshell >>$Makefile <<'!NO!SUBS!' -$(LIBPERL): $& $(perllib_objs) $(DYNALOADER) $(LIBPERLEXPORT) +$(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLEXPORT) !NO!SUBS! case "$useshrplib" in true) @@ -951,7 +1002,7 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl *) 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) @@ -960,7 +1011,7 @@ lib/buildcustomize.pl: \$& \$(miniperl_objs) write_buildcustomize.pl !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) @@ -973,7 +1024,7 @@ lib/buildcustomize.pl: $& $(miniperl_objs) write_buildcustomize.pl $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! |