RFR: 8352284: EXTRA_CFLAGS incorrectly applied to BUILD_LIBJVM src/hotspot C++ source files [v2]
Magnus Ihse Bursie
ihse at openjdk.org
Mon Mar 31 13:27:42 UTC 2025
On Tue, 25 Mar 2025 01:54:33 GMT, Patrick Zhang <qpzhang at openjdk.org> wrote:
>> make/common/native/Flags.gmk line 125:
>>
>>> 123: endif
>>> 124: ifeq ($(STATIC_LIBS), true)
>>> 125: $1_EXTRA_CXXFLAGS += -DSTATIC_BUILD=1
>>
>> This seems unrelated to the fix?
>
>> 3. Fixed `STATIC_LIB_CFLAGS` in `Flags.gmk` to `-DSTATIC_BUILD=1`, which was missed by [cbab40bc](https://github.com/openjdk/jdk/commit/cbab40bce45a2f58906be49c841178fa1dfd457e#diff-ab3ce05e795360030f19402fd0c2fad1dc1f7c5e7acc993cc4a2096cf31ccf40R114-R121) for the refactor of building static libs.
>
> Unrelated, after the fix got limited to `JvmFlags.gmk` only.
> However, it is a practical bug, and existing tests did not cover the corner case. As described in the No.3 bullet of this PR. The problem showed up when I tested applying `EXTRA_CXXFLAGS to `precompiled.hpp.gch`. It is a simple and tiny fix which may not require a separate PR I thought, does it?
>
> FYI, the failures on linux-x64-static and linux-x64-static-libs tests, captured by OpenJDK GHA Sanity Checks: https://github.com/cnqpzhang/jdk/actions/runs/13943096440.
You are correct that this is a bug, but the fix should not be sneaked in under the guise of another problem.
I created https://bugs.openjdk.org/browse/JDK-8353272 for this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24115#discussion_r2021042829
More information about the build-dev
mailing list