php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53338 DTrace build config broken by Rev 305329
Submitted: 2010-11-18 06:30 UTC Modified: 2010-11-18 17:03 UTC
From: mike at harschsystems dot com Assigned: jani (profile)
Status: Closed Package: Compile Failure
PHP Version: trunk-SVN-2010-11-18 (snap) OS: Solaris and OS X
Private report: No CVE-ID: None
 [2010-11-18 06:30 UTC] mike at harschsystems dot com
Description:
------------
The changes made in Rev 305329 break the --enable-dtrace configuration option on 
both Solaris and OS X.  

The main problems I was able to identify are:

1.) The steps required to build DTrace-enabled binaries are different on Solaris 
and OS X (see references below).  305329 removed the platform check that allowed 
OS X to bypass the extra linking step required by Solaris (dtrace -G -s ...).

2.) The generation of the DTrace header file (zend_dtrace_gen.h via 'dtrace -h 
...') was moved to Makefile (from configure) - this broke various targets that 
depended on the header file prior to it's generation (late in the Makefile).

3.) A typo (I think) in the path variable used to generate the DTrace targets 
injected junk into the pathnames, breaking the build.

The included patch file "dtrace_build.patch" may be applied to Rev 305455 to 
resolve these issues.  It essentially re-enlists some of the functionality that 
existed prior to 305329.  This has been tested on both OS X and Solaris.

Examples of how to build DTrace USDT probes on Solaris, see:
http://dtrace.org/blogs/ahl/2006/05/08/user-land-tracing-gets-better-and-better/
and
http://blogs.sun.com/dap/entry/writing_a_dtrace_usdt_provider

For the relevant documentation on OS X, see the dtrace(1M) man page:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/
man1/dtrace.1.html



Expected result:
----------------
--enable-dtrace should configure and build on platforms that have DTrace (Solaris 
and OS X - maybe FreeBSD?)

Actual result:
--------------
--enable-dtrace fails on both platforms for the reasons mentioned in the 
Description section.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-18 06:39 UTC] mike at harschsystems dot com
I can't seem to upload the patch file.  Please refer to the patch file contents 
here:
    http://pastebin.com/SZnvz3L0
 [2010-11-18 09:44 UTC] jani@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jani
 [2010-11-18 09:44 UTC] jani@php.net
Me break, me fix. :)
 [2010-11-18 09:53 UTC] jani@php.net
1) So providerdesc.o is only build and linked with when under Solaris? 
2) What in Makefile did depend on the header file before it was created? 
3) I need the generated Makefile you got with current trunk (without your patch!)
 [2010-11-18 11:11 UTC] jani@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=305487
Log: - Fixed DTrace support in MacOSX (bug #53338)
 [2010-11-18 14:37 UTC] dsp@php.net
1) So providerdesc.o is only build and linked with when under Solaris?

yes because dtrace on Solaris generates stubs that need to be compiled in. On Mac 
OS the necessary switch to generate providerdesc.o doesn't exist on Mac OS.
 [2010-11-18 16:34 UTC] mike at harschsystems dot com
2.) I think it was main/main.c which includes zend_dtrace.h which includes 
zend_dtrace_gen.h, but this problem seems to be fixed by placing the 'dtrace -h' 
line earlier in the Makefile (which now seems to be the case as of 
201011181330).

3.) http://pastebin.com/33TJyLC2 - see line 498.  I was able to work around this 
problem by changing the following line in acinclude.m4:

dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 
's,PHP_,DTRACE_,g' \$[]@

to

dtrace -h -C -s $abs_srcdir/[$]ac_provsrc -o \$[]@ && \$(SED) -ibak 
's,PHP_,DTRACE_,g' \$[]@

Once this is fixed, the build appears to work on both Solaris and OS X using Rev 
305487.
 [2010-11-18 17:02 UTC] jani@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=305508
Log: - One more fix for bug #53338 (when copying stuff from other macros, do it all the way.. :)
 [2010-11-18 17:03 UTC] jani@php.net
-Status: Assigned +Status: Closed
 [2010-11-18 17:03 UTC] jani@php.net
Fixed now in SVN. Tested with OSX though, but should work the same on solaris.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC