Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php/php-src
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: f4z4on/php-src
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix-dtrace-systemtap-cpp
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Aug 30, 2023

  1. Remove CPP when invoking dtrace utility

    We are experiencing an issue when building PHP with DTrace enabled with
    SystemTap (see GH-11847).† The issue is caused by inappropriate use C
    preprocessor detected by GNU Autoconf in our “configure” script. C
    preprocessor configuration found by AC_PROG_CPP macro is portable only
    to run on files with “.c” extension.‡ However, statically-defined tracing
    is described by D programs with “.d” extension which causes the issue.
    We experience this even on typical Linux distribution with GNU Compiler
    Collection (GCC) unless we override the defaults detected by our
    “configure” script.
    
    Many major Linux distributions use SystemTap to provide “dtrace”
    utility. It relies on both external C preprocessor and external C
    compiler. C preprocessor can be customized via CPP environment variable.
    Similarly, C compiler can be customized via CC environment variable. It
    also allows customization of C compiler flags via CFLAGS environment
    variable. We have recently aligned both CPP and CC environment variable
    with C preprocessor and C compiler we use to build regular C source code
    as provided by our “configure” script (see GH-11643).* We wanted to
    allow cross-compilation on Linux for which this was the only blocker. 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 had modified all “dtrace” invocations in the same way to make it look
    consistent. However, only the C compiler (CC environment variable) is
    necessary to for cross-compilation. There have never been any reported
    issue with the C preprocessor. We acknowledge it would be great to allow
    C preprocessor customization as well. However, the implementation would
    require a lot of effort to do correctly given the limitations of
    AC_PROG_CPP macro from GNU Autoconf. This would be further complicated
    by the fact that all DTrace implementations, not just SystemTap, allow C
    preprocessor customization but Oracle DTrace, Open DTrace, and their
    forks do it differently. Nevertheless, they all default to “cpp” utility
    and they all have or had been working fine. Therefore, we believe simply
    removing CPP stabilizes “dtrace” invocation on Linux systems with
    SystemTap and aligns it with other system configurations on other
    platforms, until someone comes with complete solution with custom “m4”
    and “make” macros, while our build system on Linux with SystemTap
    supports cross-compilation.
    
    Fixes GH-11847#11847https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#index-AC_005fPROG_005fCPP-1
    * #11643
    f4z4on committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    8463cc8 View commit details
    Browse the repository at this point in the history
Loading