New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTrace support broken on OS X #14808
Comments
From @sevanMac OS X uses MACH-O rather than ELF as a binary format. Inline Patch--- Makefile.SH.orig 2015-07-18 19:06:10.000000000 +0100
+++ Makefile.SH 2015-07-18 19:07:37.000000000 +0100
@@ -226,7 +226,7 @@
case "$usedtrace" in
define|true)
dtrace_h='perldtrace.h'
- $dtrace -G -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \
+ $dtrace -arch i386 -s perldtrace.d -o perldtrace.tmp >/dev/null 2>&1 \
&& rm -f perldtrace.tmp && dtrace_o='perldtrace$(OBJ_EXT)' \
&& minidtrace_o='miniperldtrace$(OBJ_EXT)'
;;
@@ -814,10 +814,10 @@
?*)
$spitshell >>$Makefile <<'!NO!SUBS!'
$(DTRACE_O): perldtrace.d $(ndt_obj)
- $(DTRACE) -G -s perldtrace.d -o $(DTRACE_O) $(ndt_obj)
+ $(DTRACE) -arch i386 -s perldtrace.d -o $(DTRACE_O) $(ndt_obj)
$(MINIDTRACE_O): perldtrace.d $(minindt_obj) perlmini$(OBJ_EXT)
- $(DTRACE) -G -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj) perlmini$(OBJ_EXT)
+ $(DTRACE) -arch i386 -s perldtrace.d -o $(MINIDTRACE_O) $(minindt_obj) perlmini$(OBJ_EXT)
!NO!SUBS!
Ofcourse this change has now broken support for Solaris & FreeBSD or any OS in the future that may have DTrace support or OS X on x86_64. |
From @jkeenanOn Sat Jul 18 11:23:57 2015, venture37@geeklan.co.uk wrote:
Let me make sure I understand the intent of your patch. The revisions you made to Makefile.SH were made in order to build perl with dtrace support on Mac OSX on the i386 architecture -- correct? Without these revisions, you were *not* able to build perl with dtrace support on Mac OSX/i386 -- correct? If so, then while this patch wouldn't be suitable for other architectures, it might provide some guidance toward a patch that would cover this OS/architecture as well as others. Do you happen to know what, if anything, has to be done to build perl with dtrace support on Mac OS X/x86_64? (I'm assuming Darwin/PPC is too old to support dtrace at all, and I suspect that x86_64 is more common than i386 these days.) Thank you for advancing the discussion. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @sevanOn 18/07/2015 19:59, James E Keenan via RT wrote:
Correct
Correct
Correct, this is not a proposed fix, just demonstrating the changes
So here's the confusing part. The mac I ran this on is a 2012 MacBook uname -a reports arch(1) reports
Actually, 10.5 which runs on both intel & powerpc systems comes with
|
From @tonycozOn Sat Jul 18 23:10:48 2015, venture37@geeklan.co.uk wrote:
What does: perl -V:ptrsize produce? On my Mac, running 10.10.4, for a default build of bleadperl I see: pallas:perl tony$ ./perl -Ilib -V:ptrsize It also builds a dtrace enabled perl successfully, *without* your patch. pallas:perl tony$ sudo dtrace -ln 'perl$target:::sub-entry, perl$target:::sub-return { printf("%s %s (%s:%d)\n", probename == "sub-entry" ? "->" : "<-", copyinstr(arg0), copyinstr(arg1), arg2); }' -c /Users/tony/dev/perl/git/perl/perl I'm testing on a Mac mini server (Mid 2011) (which has a Core i7), and a iMac (20-inch, Early 2008) (Core 2 Duo). Both built a -Dusedtrace build or bleadperl without errors. Tony |
From @sevanOn 21/07/2015 08:01, Tony Cook via RT wrote:
ptrsize='4';
What does sudo dtrace --h say, on 10.9.5 there is no -G option. Usage: dtrace [-aACeFHlqSvVwZ] [-arch i386|x86_64] [-b bufsz] [-c cmd] [-P provider [[ predicate ] action ]] predicate -> '/' D-expression '/' -arch Generate programs and Mach-O files for the specified architecture -a claim anonymous tracing state |
From @tonycozOn Tue Jul 21 05:13:36 2015, venture37@geeklan.co.uk wrote:
Is that the Apple supplied system perl, or from a separate packaged perl? What bit-ness are your system processes running at? You can see it in Activity Monitor, you may need to use View, Columns, Kind to add a column to display it, but I recall older OS X displayed the bitness as part of the process name.
I get: pallas:~ tony$ dtrace --h [-P provider [[ predicate ] action ]] predicate -> '/' D-expression '/' -arch Generate programs and Mach-O files for the specified architecture -a claim anonymous tracing state There are actually four platforms with dtrace support of some sort: - Solaris To handle the OS X alternate generate option, I think we'd add a new config variable, say dtrace_generate, which defaults to "-G", and hints/darwin.sh can modify it to suit the current architecture, we just need a way to work out the correct architecture. From your previous messages we can't use arch to detect the architecture to supply to dtrace, since arch on my 64-bit systems produces "i386". Tony |
From @craigberryOn Tue, Jul 21, 2015 at 6:51 PM, Tony Cook via RT
That's just the architecture family. uname -m will give you x86_64 if |
From @sevanPlease close this bug report, issue turned out to related to pkgsrc which is now fixed. Perl 5 with dtrace support works without issue on Leopard & newer (personally tested on 10.5.8 & 10.9.5 (powerpc & x86_64)). |
From @jkeenanOn Thu Jul 21 06:56:13 2016, venture37@geeklan.co.uk wrote:
Closing per request from original poster. -- |
@jkeenan - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#125639 (status was 'rejected')
Searchable as RT125639$
The text was updated successfully, but these errors were encountered: