Skip to content

Conversation

@gnu-andrew
Copy link
Member

@gnu-andrew gnu-andrew commented Jan 9, 2026

There are a number of cases in flags.m4 where the toolchain is checked and clang (now the default on all supported versions of XCode on MacOS) is not handled. In particular, this means -std=gnu++98 is never added and attempts to build with MacOS 15 fail as it is trying to meet the demands of C++11.

This PR updates the file to handle clang with gcc in most places as there is more commonality between the two than difference. It doesn't attempt to remove the gcc on MacOS support and so some areas will differ from 11u and later where MacOS is assumed to be clang-only.

The changes are as follows:

  1. Handle linker flags under one shared gcc & clang block as there is mostly duplication between the two with the only difference being PICFLAG and PIEFLAG.
  2. Handle the -O flag for both gcc & clang together as they only differ by OS.
  3. Handle clang in FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK
  4. Move the Linux defines (-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE) to where the BSD, MacOS & AIX ones are added. This presumably means these were not previously being added for Linux on clang. This mirrors 11u handling.

The changes in #3 mean that clang builds will now run the compiler tests for -std=gnu++98, -Wformat-overflow and -ffp-contract as well as the warning & -fstack-protector flags added in this block. Some of this may need to be exempted depending on testing.

As MacOS GHA builds do not currently run, I will make #738 depend on this PR to test there.

This also adds LOG_LEVEL=debug to the remaining OpenJDK GHA builds where it was absent (x86 Linux, Windows & Mac). This will mean noisier logs, but more useful ones when there is actually a failure. The current failing Mac ones don't tell us the commands being passed to the compiler. The same option has been present for x86_64 and alt Linux builds for some time.


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-8374899 needs maintainer approval

Issue

  • JDK-8374899: [8u] Fully handle clang as the toolchain in flags.m4 (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 740

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 9, 2026

👋 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
Copy link

openjdk bot commented Jan 9, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@gnu-andrew
Copy link
Member Author

I think this may have to be a regular PR to generate the pr/740 branch.

@gnu-andrew gnu-andrew marked this pull request as ready for review January 9, 2026 16:05
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 9, 2026
@mlbridge
Copy link

mlbridge bot commented Jan 9, 2026

Webrevs

@openjdk openjdk bot mentioned this pull request Jan 9, 2026
4 tasks
@gnu-andrew gnu-andrew marked this pull request as draft January 9, 2026 17:11
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jan 9, 2026
@gnu-andrew gnu-andrew changed the base branch from master to pr/741 January 9, 2026 23:26
@openjdk-notifier openjdk-notifier bot changed the base branch from pr/741 to master January 12, 2026 18:24
@openjdk-notifier
Copy link

The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork:

git checkout JDK-8374899
git fetch https://git.openjdk.org/jdk8u-dev.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push

@gnu-andrew gnu-andrew marked this pull request as ready for review January 12, 2026 23:46
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 12, 2026
Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

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

This seems OK. Thanks!

@openjdk
Copy link

openjdk bot commented Jan 13, 2026

⚠️ @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.

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

Labels

rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants