Merge pull request #316300 from nessdoor/openjdk-clang

openjdk: enable Clang-based builds of jdk{11,17,19,20,21,22}
This commit is contained in:
Thiago Kenji Okada 2024-07-11 18:11:21 +01:00 committed by GitHub
commit a773e50715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 56 additions and 12 deletions

View File

@ -74,7 +74,17 @@ let
"--with-lcms=system"
"--with-stdc++lib=dynamic"
"--disable-warnings-as-errors"
] ++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc"
]
# Cannot be built by recent versions of Clang, as far as I can tell (see
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260319). Known to
# compile with LLVM 12.
++ lib.optionals stdenv.cc.isClang [
"--with-toolchain-type=clang"
# Explicitly tell Clang to compile C++ files as C++, see
# https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
"--with-extra-cxxflags=-xc++"
]
++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc"
++ lib.optional headless "--enable-headless-only"
++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";

View File

@ -98,7 +98,14 @@ let
"--with-zlib=system"
"--with-lcms=system"
"--with-stdc++lib=dynamic"
] ++ lib.optional headless "--enable-headless-only"
]
++ lib.optionals stdenv.cc.isClang [
"--with-toolchain-type=clang"
# Explicitly tell Clang to compile C++ files as C++, see
# https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
"--with-extra-cxxflags=-xc++"
]
++ lib.optional headless "--enable-headless-only"
++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";
separateDebugInfo = true;

View File

@ -100,7 +100,14 @@ let
"--with-zlib=system"
"--with-lcms=system"
"--with-stdc++lib=dynamic"
] ++ lib.optional headless "--enable-headless-only"
]
++ lib.optionals stdenv.cc.isClang [
"--with-toolchain-type=clang"
# Explicitly tell Clang to compile C++ files as C++, see
# https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
"--with-extra-cxxflags=-xc++"
]
++ lib.optional headless "--enable-headless-only"
++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";
separateDebugInfo = true;

View File

@ -98,7 +98,14 @@ let
"--with-zlib=system"
"--with-lcms=system"
"--with-stdc++lib=dynamic"
] ++ lib.optional headless "--enable-headless-only"
]
++ lib.optionals stdenv.cc.isClang [
"--with-toolchain-type=clang"
# Explicitly tell Clang to compile C++ files as C++, see
# https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
"--with-extra-cxxflags=-xc++"
]
++ lib.optional headless "--enable-headless-only"
++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";
separateDebugInfo = true;

View File

@ -91,7 +91,14 @@ let
"--with-zlib=system"
"--with-lcms=system"
"--with-stdc++lib=dynamic"
] ++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc"
]
++ lib.optionals stdenv.cc.isClang [
"--with-toolchain-type=clang"
# Explicitly tell Clang to compile C++ files as C++, see
# https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
"--with-extra-cxxflags=-xc++"
]
++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc"
++ lib.optional headless "--enable-headless-only"
++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";

View File

@ -156,6 +156,12 @@ stdenv.mkDerivation (finalAttrs: {
"--with-lcms=system"
"--with-stdc++lib=dynamic"
]
++ lib.optionals stdenv.cc.isClang [
"--with-toolchain-type=clang"
# Explicitly tell Clang to compile C++ files as C++, see
# https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
"--with-extra-cxxflags=-xc++"
]
++ lib.optional headless "--enable-headless-only"
++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";