Repository navigation
Fix GH-25688: C++ sources of intl and pdo_firebird are built without optimization - #25690
Open
ArtUkrainskiy wants to merge 1 commit into
Open
ArtUkrainskiy wants to merge 1 commit into
ArtUkrainskiy wants to merge 1 commit into
Conversation
…ut optimization configure.ac appended -DNDEBUG or -UNDEBUG to CXXFLAGS before the extensions ran AC_PROG_CXX. AC_PROG_CXX then skipped its default -g -O2, so the C++ sources of intl and pdo_firebird were built without optimization when CXXFLAGS was not set. The NDEBUG flags for C++ are now collected and appended after the extensions are configured. C flags do not change. With -g -O2, MessageFormatter::format() and IntlBreakIterator take 9-11% fewer cycles (Ryzen 9 5950X, GCC 15).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes GH-25688
Since #16511 (PHP 8.5),
configure.acadds-DNDEBUGor-UNDEBUGtoCXXFLAGSbefore the extensions runAC_PROG_CXX.AC_PROG_CXXseesCXXFLAGSset and skips its default-g -O2. So the C++ sources of intl and pdo_firebird are built without optimization whenCXXFLAGSisn't set. Builds that setCXXFLAGS, andphpizebuilds, aren't affected.This collects the NDEBUG flags for C++ and appends them to
CXXFLAGSafter the extensions are configured, next to-Werror. C flags don't change.-g,-OandNDEBUGflags on the compile line of an intl C++ file:-DNDEBUG-g -O2 -DNDEBUG--enable-debug-UNDEBUG -g -O0-g -O0 -UNDEBUGCXXFLAGS=-O3-O3 -DNDEBUG-O3 -DNDEBUGCXXFLAGS=-UNDEBUG-UNDEBUG -DNDEBUG-UNDEBUG -DNDEBUG--enable-debug-assertions-DNDEBUG -UNDEBUG-g -O2 -DNDEBUG -UNDEBUGWith
--enable-zts, clang and--enable-address-sanitizerthe C++ file gets the same-g -O2 -DNDEBUGas with no flags.With
-g -O2,MessageFormatter::format()andIntlBreakIteratortake 9–11% fewer cycles on a Ryzen 9 5950X with GCC 15.IntlDateFormatter::format(), which is mostly C, doesn't change. ext/intl tests pass before and after, and also on ZTS with the fix. Debug builds keep Cassert(), also withCFLAGS=-DNDEBUG. Not tested: Windows, which uses its own build scripts, and pdo_firebird.