Skip to content

8388811: [8u] VS2010 build broken by JDK-8374058 - #843

Closed
gnu-andrew wants to merge 1 commit into
openjdk:masterfrom
gnu-andrew:JDK-8388811
Closed

8388811: [8u] VS2010 build broken by JDK-8374058#843
gnu-andrew wants to merge 1 commit into
openjdk:masterfrom
gnu-andrew:JDK-8388811

Conversation

@gnu-andrew

@gnu-andrew gnu-andrew commented Jul 23, 2026

Copy link
Copy Markdown
Member

JDK-8374058, part of the 8u502 security changes, broke the build on Visual Studio 2010 by introducing a variable declaration in the middle of the function.

Moving it to the top of the function fixes the issue. I've confirmed this locally with gcc using -Werror=declaration-after-statement.

diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index dc140de77f..177a734594 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -741,7 +741,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
     OPTIMIZATION := HIGHEST, \
     CFLAGS := $(CFLAGS_JDKLIB) \
         $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
-        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
+        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
+    	-Werror=declaration-after-statement, \
     MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \

As a follow-on, I intend to look at whether we can introduce -Werror=declaration-after-statement to gcc builds so we can catch instances in shared code without requiring a Visual Studio 2010 build. This is at least the third instance of such breakage.



Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8388811 needs maintainer approval

Issue

  • JDK-8388811: [8u] VS2010 build broken by JDK-8374058 (Bug - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/843/head:pull/843
$ git checkout pull/843

Update a local copy of the PR:
$ git checkout pull/843
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/843/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 843

View PR using the GUI difftool:
$ git pr show -t 843

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/843.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 23, 2026

Copy link
Copy Markdown

👋 Welcome back andrew! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jul 23, 2026

Copy link
Copy Markdown

@gnu-andrew This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8388811: [8u] VS2010 build broken by JDK-8374058

Reviewed-by: fitzsim, clanger

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 3 new commits pushed to the master branch:

  • aa3f9de: 8388142: [8u] Path to PreferredKey.java exclusion is wrong
  • e076e19: 8369032: Add test to ensure serialized ICC_Profile stores only necessary optional data
  • ca6d5fd: 8385390: Update FreeType to 2.14.3

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 23, 2026
@mlbridge

mlbridge Bot commented Jul 23, 2026

Copy link
Copy Markdown

Webrevs

@fitzsim fitzsim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a Reviewer.

This is the exact same fix I did in the context of #835 before looking for and immediately finding this pull request:

https://github.com/fitzsim/jdk8u-dev/actions/runs/30028355752/job/89278670891

fitzsim@7bfa66f

Fixing the compiler option would have eliminated the need for a similar patch on #835, so it seems like a nice thing to have, generally:

b30bea0

@openjdk

openjdk Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ @gnu-andrew This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@gnu-andrew

Copy link
Copy Markdown
Member Author

Thanks Christoph!
/approval request Simple fix of a case of declaration after statement in C code introduced in the 2026-07 security patches, which breaks the build on C90 (Visual Studio 2010) compilers. The patch was reviewed by Christoph Langer & Thomas Fitzsimmons and the GitHub Actions VS2010 build now succeeds.

@openjdk

openjdk Bot commented Aug 7, 2026

Copy link
Copy Markdown

@gnu-andrew
8388811: The approval request has been created successfully.

@openjdk openjdk Bot added the approval Requires approval; will be removed when approval is received label Aug 7, 2026
@jerboaa

jerboaa commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

/approve yes

@openjdk

openjdk Bot commented Aug 10, 2026

Copy link
Copy Markdown

@jerboaa
8388811: The approval request has been approved.

@openjdk openjdk Bot added ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Aug 10, 2026
@gnu-andrew

Copy link
Copy Markdown
Member Author

/integrate

@openjdk

openjdk Bot commented Aug 10, 2026

Copy link
Copy Markdown

Going to push as commit 0830f61.
Since your change was applied there have been 3 commits pushed to the master branch:

  • aa3f9de: 8388142: [8u] Path to PreferredKey.java exclusion is wrong
  • e076e19: 8369032: Add test to ensure serialized ICC_Profile stores only necessary optional data
  • ca6d5fd: 8385390: Update FreeType to 2.14.3

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Aug 10, 2026
@openjdk openjdk Bot closed this Aug 10, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 10, 2026
@openjdk

openjdk Bot commented Aug 10, 2026

Copy link
Copy Markdown

@gnu-andrew Pushed as commit 0830f61.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants