php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78614 Does not compile with DTRACE anymore
Submitted: 2019-09-30 21:20 UTC Modified: 2019-10-04 07:13 UTC
From: tz at FreeBSD dot org Assigned: dmitry (profile)
Status: Closed Package: Compile Failure
PHP Version: 7.4.0RC2 OS: FreeBSD 11.2
Private report: No CVE-ID: None
 [2019-09-30 21:20 UTC] tz at FreeBSD dot org
Description:
------------
While RC1 compiles fine, RC2 does not compile anymore with the same configuration. There are a bunch of undefined references. For example:

=== start ===
--- sapi/fpm/php-fpm ---
Zend/zend_dtrace.d.o:(.SUNW_dof+0x1e0): undefined reference to `$dtrace1723905.zend_error_va_list'
--- sapi/phpdbg/phpdbg ---
Zend/zend_dtrace.d.o:(.SUNW_dof+0x1e0): undefined reference to `$dtrace1723905.zend_error_va_list'
--- sapi/cli/php ---
Zend/zend_dtrace.d.o:(.SUNW_dof+0x1e0): undefined reference to `$dtrace1723905.zend_error_va_list'
--- sapi/fpm/php-fpm ---
Zend/zend_dtrace.d.o:(.SUNW_dof+0x210): undefined reference to `$dtrace1723894.ZEND_CATCH_SPEC_CONST_HANDLER'
--- sapi/phpdbg/phpdbg ---
Zend/zend_dtrace.d.o:(.SUNW_dof+0x210): undefined reference to `$dtrace1723894.ZEND_CATCH_SPEC_CONST_HANDLER'
--- sapi/cli/php ---
Zend/zend_dtrace.d.o:(.SUNW_dof+0x210): undefined reference to `$dtrace1723894.ZEND_CATCH_SPEC_CONST_HANDLER'
--- sapi/fpm/php-fpm ---
main/main.o: In function `php_request_startup':
main.c:(.text+0x1052): undefined reference to `__dtrace_php___request__startup'
=== end ===

You can find a full log with all error messages here:
http://www.meisterderspiele.de/freebsd/php74-7.4.0.r2.log

Greetings,
Torsten


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-02 19:15 UTC] tz at FreeBSD dot org
Same error for RC 3. You can find a full log of error messages here:
http://www.meisterderspiele.de/freebsd/php74-7.4.0.r3.log
 [2019-10-02 19:38 UTC] nikic@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: dmitry
 [2019-10-02 19:38 UTC] nikic@php.net
@dmitry: Possibly related to PIC changes?
 [2019-10-03 10:08 UTC] dmitry@php.net
The problem occurs, only if executable (CLI, CGI, FPM) and shared (Apache) SAPIs are built together. In this case shared SPAI influences build system to use PIC object files for DTRACE for all SAPIs. 

Te problem doesn't exist on Linux and Solaris, because both PIC and non-PIC DTRACE objects are created. See https://github.com/php/php-src/commit/0ebef462ceb

For workaround add "--with-pic" to configure arguments or build Apache and other SAPIs separately.
 [2019-10-03 21:22 UTC] tz at FreeBSD dot org
Adding --with-pic does not work. Porting the patch you mentioned works. Here the patch:

--- build/php.m4.orig	2019-10-03 20:45:52 UTC
+++ build/php.m4
@@ -2326,7 +2326,7 @@ dnl header-file.
 dnl Add providerdesc.o or .lo into global objects when needed.
   case $host_alias in
   *freebsd*)
-    PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
+    PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
     PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
     ;;
   *solaris*)
@@ -2374,7 +2374,7 @@ $ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_pr
 EOF
 
   case $host_alias in
-  *solaris*|*linux*)
+  *solaris*|*linux*|*freebsd*)
     dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
     dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
     dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
 [2019-10-04 07:10 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3ded328bea54442308590473a259bdc008a2d3c0
Log: Fixed bug #78614 (Does not compile with DTRACE anymore)
 [2019-10-04 07:10 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2019-10-04 07:11 UTC] dmitry@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3ded328bea54442308590473a259bdc008a2d3c0
Log: Fixed bug #78614 (Does not compile with DTRACE anymore)
 [2019-10-04 07:13 UTC] dmitry@php.net
I've committed this patch.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 04:01:25 2019 UTC