You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are experiencing an issue when building PHP with DTrace enabled with
SystemTap (see GH-11847).† SystemTap, unlike Oracle DTrace, Open DTrace
or their forks, relies on both external C compiler and external
preprocessor. We have recently aligned both of these with compiler and
preprocessor we use to build regular C source code (see GH-11643).‡ We
set CPP environment variable to the value of our CPP macro which
defaults to C preprocessor detected by configure script. Similarly, we
set CC environment variable to the value of our CC macro which defaults
to C compiler detected by configure script. C compiler flags from
CFLAGS_CLEAN macro have already been in place since versions 5.4.20 and
5.5.4 from 2013-09-18.
We have modified all dtrace invocations in the same way to make it look
consistent. However, SystemTap dtrace needs C preprocessor only when it
generates header files (-h option) with preprocessing (-C option).
Similarly, it needs C compiler only when it generates object files with
probe definitions (-G option). External C preprocessor use via the -C
option is actually common to dtrace implementations other than SystemTap
even for actions other than generating header files. However,
customization of C preprocessor differs widely between SystemTap and the
rest of DTrace ecosystem (for example, no other implementation uses
environment variables).
Before, we fix the issue itself, we stop setting all these environment
variables when invoking dtrace. We set only those necessary for
particular action:
1. When generating headers file (-h option) with the help of C
preprocessor (-C option), we pass the C processor the user chose or
configure detected (CPP). No CC nor CFLAGS environment variables.
2. When generating object files with probes (-G option), we pass the C
compiler and its flags the user chose or configure detected (CC and
CFLAGS). No CPP environment variable.
We hope this code style inconsistency in dtrace invocation will actually
be useful in that it allows simpler fix to the issue we are experiencing
when building PHP with DTrace enabled with SystemTap. We believe this
also makes clearer the fact this is a strange area of PHP build process
and vendor-independent invocation of dtrace is tricky. Hopefully, if
there is some future need to change how we define and build
statically-defined traces, people will notice differences between uses
for dtrace. Properly solving this would require implementing non-trivial
m4 macros, which is probably not warranted given this affects 8 lines of
make commands… Moreover, such macros probably belong to a project like
GNU Autoconf rather than to PHP. Therefore, intentional code seems like
the best next option.
Please note, all this is specific to SystemTap which is itself available
only on Linux. Oracle DTrace, Open DTrace or their forks do not use
environment variables (they ignore them).
† #11847
‡ #11643
0 commit comments