From:
Operating system: solaris
PHP version: 5.4.0
Package: Compile Failure
Bug Type: Bug
Bug description:--enable-dtrace leads make to clobber Zend/zend_dtrace.d
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.
--
Edit bug report at https://bugs.php.net/bug.php?id=61268&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61268&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61268&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=61268&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61268&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=61268&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61268&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=61268&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=61268&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=61268&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=61268&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=61268&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=61268&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=61268&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61268&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=61268&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61268&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=61268&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=61268&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=61268&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=61268&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=61268&r=mysqlcfg