php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61268 --enable-dtrace leads make to clobber Zend/zend_dtrace.d
Submitted: 2012-03-03 20:19 UTC Modified: 2013-08-14 18:52 UTC
Votes:4
Avg. Score:4.5 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:3 (75.0%)
From: mike at harschsystems dot com Assigned: dsp (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.4.0 OS: solaris
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike at harschsystems dot com
New email:
PHP Version: OS:

 

 [2012-03-03 20:19 UTC] mike at harschsystems dot com
Description:
------------
5.4.0 bundle configured with only one option: --enable-dtrace

The configure script runs fine and the build finishes without error.  However, 
the next invocation of 
make (probably from trying to run 'make install') fails with the following 
error:


[jack@fjpe6maa ~/php-5.4.0]$ make install
gcc   /home/jack/php-5.4.0/Zend/zend_dtrace.d.o   -o /home/jack/php-
5.4.0/Zend/zend_dtrace.d
Undefined                       first referenced
 symbol                             in file
main                                /usr/lib/crt1.o
php_request_startup                 /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
dtrace_execute_internal             /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
dtrace_execute                      /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
php_request_shutdown                /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
zend_throw_exception_internal       /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
dtrace_compile_file                 /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
$dtrace185178.ZEND_CATCH_SPEC_CONST_CV_HANDLER /home/jack/php-
5.4.0/Zend/zend_dtrace.d.o
zend_error_noreturn                 /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
ld: fatal: symbol referencing errors. No output written to /home/jack/php-
5.4.0/Zend/zend_dtrace.d
collect2: ld returned 1 exit status
make: *** [/home/jack/php-5.4.0/Zend/zend_dtrace.d] Error 1

What's happening here is that make has determined that the file 
Zend/zend_dtrace.d is out of date and 
must be rebuilt.  It matches a built-in implicit rule that ends up running:
gcc   /home/jack/php-5.4.0/Zend/zend_dtrace.d.o   -o /home/jack/php-
5.4.0/Zend/zend_dtrace.d

This command fails with the error that you see, but it also clobbers 
zend_dtrace.d

Here's a bit more detail from 'make -d':
             <snip>
             Prerequisite `/home/jack/php-5.4.0/Zend/zend_dtrace.d.o' is newer 
than target 
`/home/jack/php-5.4.0/Zend/zend_dtrace.d'.
            Must remake target `/home/jack/php-5.4.0/Zend/zend_dtrace.d'.
Invoking builtin recipe to update target `/home/jack/php-
5.4.0/Zend/zend_dtrace.d'.
gcc   /home/jack/php-5.4.0/Zend/zend_dtrace.d.o   -o /home/jack/php-
5.4.0/Zend/zend_dtrace.d
Putting child 80bdaa0 (/home/jack/php-5.4.0/Zend/zend_dtrace.d) PID 5104 on the 
chain.
Live child 80bdaa0 (/home/jack/php-5.4.0/Zend/zend_dtrace.d) PID 5104
Undefined                       first referenced
 symbol                             in file
main                                /usr/lib/crt1.o
php_request_startup                 /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
dtrace_execute_internal             /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
dtrace_execute                      /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
$dtrace187054.ZEND_CATCH_SPEC_CONST_CV_HANDLER /home/jack/php-
5.4.0/Zend/zend_dtrace.d.o
php_request_shutdown                /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
zend_throw_exception_internal       /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
dtrace_compile_file                 /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
zend_error_noreturn                 /home/jack/php-5.4.0/Zend/zend_dtrace.d.o
ld: fatal: symbol referencing errors. No output written to /home/jack/php-
5.4.0/Zend/zend_dtrace.d
collect2: ld returned 1 exit status
Reaping losing child 80bdaa0 PID 5104
make: *** [/home/jack/php-5.4.0/Zend/zend_dtrace.d] Error 1


I was able to work-around this issue by disabling built-in implicit rules with 
'make -r'.  Obviously, I 
had to recover the clobbered file before this worked.

The offending Makefile may be seen here: http://harschsystems.com/bugs/php-
54_sol_dtrace/Makefile.txt

For reference:
On solaris (and solaris-derived) systems, the compilation of USDT dtrace probes 
goes something like this:

$ dtrace -h -o foo_provider.h -s foo_provider.d
>> Generates header file
$ gcc -c foo_src.c
$ dtrace -G -o foo_provider.o -s foo_provider.d foo_src.o
>> Generates object file 
$ gcc -o a.out foo_provider.o foo_src.o

For more detail, see: http://dtrace.org/blogs/dap/2011/12/13/usdt-providers-
redux/

This test system is running an Illumos variant (derived from OpenSolaris).
gmake 3.82

This bug deals with the same part of the build system as another bug I filed 
back in the 5.3 dev branch:
https://bugs.php.net/bug.php?id=53338

As these were the only 2 times I've tried compiling php with dtrace, I'd say 
there should be better test 
coverage of solaris + --enable-dtrace.

Expected result:
----------------
make shouldn't delete source files

Actual result:
--------------
make deletes a source file, rendering the build system inoperable.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-22 13:13 UTC] alasdairrr at gmail dot com
I can confirm I'm seeing this problem too on both Solaris 10 and SmartOS.
 [2012-05-08 04:35 UTC] mike at harschsystems dot com
I've seen the same failing behavior on 5.4.1 as well.  It's worth noting that 
gmake exhibits this failure mode while regular (non-GNU) make works fine.  So, the 
2 workarounds are:

1.) run gmake with the '-r' option
or
2.) run non-GNU make instead of gmake
 [2012-05-08 12:23 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dsp
 [2012-11-16 05:48 UTC] dsp@php.net
-Status: Assigned +Status: Feedback
 [2012-11-16 05:48 UTC] dsp@php.net
I see what the problem is but cannot reproduce it myself with 5.5.0alpha1. 
Please try the 5.5.0alpha snapshots from http://downloads.php.net/dsp and 
provide me with 'uname -a' and 'gmake --version'.

./configure && gmake works fine for me on

$ uname -a
SunOS foo 5.11 11.0 i86pc i386 i86pc Solaris

which is a Oracle Solaris 5.11.

$ gmake -- version
GNU Make 3.81
 [2012-12-09 16:57 UTC] mike at harschsystems dot com
This bug is still present in 5.5.0 alpha 1.  I just reproduced it on Oracle 
Solaris 11.1.

You must run the configure script with '--enable-dtrace' to trigger the failure 
(and be using gnu make as mentioned already).

mharsch@eleven:~/tmp/php-5.5.0alpha1$ uname -a
SunOS eleven 5.11 11.1 i86pc i386 i86pc
mharsch@eleven:~/tmp/php-5.5.0alpha1$ gmake --version
GNU Make 3.82
Built for i386-pc-solaris2.11
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 [2013-02-18 16:10 UTC] mike at harschsystems dot com
-Status: No Feedback +Status: Closed
 [2013-02-18 16:10 UTC] mike at harschsystems dot com
This bug should not be closed unless someone can confirm that the broken behavior 
has been corrected.  The issue is described in detail below.  The requested 
feedback was provided and the issue was reproduced by multiple people on several 
versions.
 [2013-02-18 16:11 UTC] mike at harschsystems dot com
Change from closed to assigned.
 [2013-02-18 16:11 UTC] mike at harschsystems dot com
-Status: Closed +Status: Assigned
 [2013-07-23 10:54 UTC] eugene at zhegan dot in
Still there on 5.5.1.
 [2013-08-03 01:14 UTC] sixd@php.net
After some investigation, I think the easiest patch is below.  This has only been tested on Linux in one install scenario.  I'll continuing testing after the weekend.

diff --git a/acinclude.m4 b/acinclude.m4
index 07b1f8e..01eabf2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2962,8 +2962,12 @@ dnl DTrace objects
   esac
 
 dnl Generate Makefile.objects entries
+dnl The empty $ac_provsrc command stops an implicit circular dependency
+dnl triggering which lead to the .d file being overwritten with GNU make (Bug 61268)
   cat>>Makefile.objects<<EOF
 
+$abs_srcdir/$ac_provsrc:;
+
 $ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
 	CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@ && cp \$[]@ \$[]@.bak && \$(SED) 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
 [2013-08-05 16:05 UTC] mike at harschsystems dot com
The suggested patch does appear to fix the clobber problem on illumos.

This clears the way to hit bug 62692 (which also breaks dtrace on solaris-based 
systems).

Let's fix the issue of not applying the 'dtrace -G' step to the files in 
Zend/.libs so that we can reach a working state for dtrace on solaris.
 [2013-08-05 22:50 UTC] sixd@php.net
-Status: Assigned +Status: Closed
 [2013-08-05 22:50 UTC] sixd@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-08-06 00:37 UTC] mike at harschsystems dot com
Building on solaris/illumos is still broken per the description in bug 62692.  I 
don't know how it reached 'verified' state but it needs to be re-opened and 
evaluated.
 [2013-08-14 18:52 UTC] sixd@php.net
"Verified" status is open and the problem confirmed to occur.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC