Skip to content

Commit

Permalink
jdk11_headless: fix the build on amd64
Browse files Browse the repository at this point in the history
The configure flags were being incorrectly concatenated.
This converts 11.nix to use a configureFlags array like 8.nix.

This fixes:

checking user specified JVM feature list...
configure: error: Cannot continue
configure: Unknown JVM features specified: "zgc--enable-headless-only"
configure: The available JVM features are: "aot cds cmsgc compiler1 compiler2 dtrace epsilongc g1gc graal jfr jni-check jvmci jvmti link-time-opt management minimal nmt parallelgc serialgc services static-build vm-structs zero zgc"
configure exiting with result code 1
builder for '/nix/store/1awwzd98crcgxad3srdkv8smhxgiz2qp-openjdk-11.0.1-b13.drv' failed with exit code 1
  • Loading branch information
ivan committed Dec 13, 2018
1 parent 2232135 commit f97a095
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions pkgs/development/compilers/openjdk/11.nix
Expand Up @@ -51,37 +51,36 @@ let
preConfigure = ''
chmod +x configure
substituteInPlace configure --replace /bin/bash "${bash}/bin/bash"
configureFlagsArray=(
"--with-boot-jdk=${bootjdk.home}"
"--with-update-version=${major}${update}"
"--with-build-number=${build}"
"--with-milestone=fcs"
"--enable-unlimited-crypto"
"--disable-debug-symbols"
"--with-zlib=system"
"--with-giflib=system"
"--with-stdc++lib=dynamic"
# glibc 2.24 deprecated readdir_r so we need this
# See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html
"--with-extra-cflags=-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result"
''
+ lib.optionalString (architecture == "amd64") "\"--with-jvm-features=zgc\""
+ lib.optionalString minimal "\"--enable-headless-only\""
+ ");"
# https://bugzilla.redhat.com/show_bug.cgi?id=1306558
# https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716
+ stdenv.lib.optionalString stdenv.cc.isGNU ''
+ lib.optionalString stdenv.cc.isGNU ''
NIX_CFLAGS_COMPILE+=" -fno-lifetime-dse -fno-delete-null-pointer-checks -std=gnu++98 -Wno-error"
'';

NIX_LDFLAGS= lib.optionals (!minimal) [
NIX_LDFLAGS = lib.optionals (!minimal) [
"-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic"
] ++ lib.optionals (!minimal && enableGnome2) [
"-lgtk-3" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2"
];

configureFlags = [
"--with-boot-jdk=${bootjdk.home}"
"--with-update-version=${major}${update}"
"--with-build-number=${build}"
"--with-milestone=fcs"
"--enable-unlimited-crypto"
"--disable-debug-symbols"
"--with-zlib=system"
"--with-giflib=system"
"--with-stdc++lib=dynamic"

# glibc 2.24 deprecated readdir_r so we need this
# See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html
"--with-extra-cflags=\"-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result\""
] ++ lib.optional (architecture == "amd64") "--with-jvm-features=zgc"
++ lib.optional minimal "--enable-headless-only";

buildFlags = [ "all" ];

installPhase = ''
Expand Down

0 comments on commit f97a095

Please sign in to comment.