C++ sources of intl and pdo_firebird are built without optimization when CXXFLAGS isn't set
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 62/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 领域
- build-system
调研方向
这些标志来自 configure.ac,其中 -DNDEBUG 在 AC_PROG_CXX 运行之前被添加到 CXXFLAGS,因此 AC_PROG_CXX 会跳过其默认的 -g -O2。请先阅读 configure.ac 中的这一顺序,并比较 PHP-8.4 和 master 的 Makefile 中生成的 CXXFLAGS_CLEAN。当普通的 ./configure --disable-all --enable-intl 能生成经过优化的 C++ 标志集,且不改变 phpize 或用户提供的 CXXFLAGS 的行为时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Description
Since 8.5, ./configure without CXXFLAGS builds the C++ sources of ext/intl and pdo_firebird with no -O flag, so they run unoptimized. On 8.4 they get -g -O2.
./configure --disable-all --enable-intl
grep '^CXXFLAGS_CLEAN' Makefile
PHP-8.4 gives CXXFLAGS_CLEAN = -g -O2. PHP-8.5 and master give CXXFLAGS_CLEAN = -DNDEBUG.
It comes from #16511. configure.ac now adds -DNDEBUG to CXXFLAGS before AC_PROG_CXX runs, and AC_PROG_CXX only adds its default -g -O2 when CXXFLAGS isn't set. C files aren't affected, since AC_PROG_CC runs earlier. Builds with phpize and builds that set CXXFLAGS aren't affected either.
I built PHP-8.5 with and without -g -O2 for C++ and measured on a Ryzen 9 5950X with GCC 15. MessageFormatter::format() and IntlBreakIterator take 9–11% fewer cycles with -g -O2.
PHP Version
PHP 8.5.14-dev (PHP-8.5 c97689312d)
Operating System
Ubuntu 26.04
- 主要语言
- C
- 星标
- 41.9k
- 派生
- 8.5k
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 106
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
php/php-src 的其他 Issue
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
Bug Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ext/openssl: 8.2.31+/8.3.31+ fail to build against OpenSSL 1.0.2 (ASN1_STRING_get0_data in xp_ssl.c)未关闭Extension: openssl Status: Needs Triage
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 84/100
Life-Framework/Life-Framework#5378 ·
维护者通常 1 天内回复
-
bug status: planned ui
难度 2/5 1-3 小时 新手友好度 70/100
ChupathingyCE/chupathingyce#2126 ·
维护者通常 1 天内回复
-
good first issue simulation
难度 1/5 1-3 小时 新手友好度 92/100
MarcosAsh/Lattice_Fluid_Dynamics#270 ·
维护者通常 1 天内回复
-
needs-kind
难度 1/5 1 小时以内 新手友好度 82/100
falcosecurity/libs#3173 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
vincentarelbundock/xtx#11 ·