8162354: Unable to build JDK 9 on a Sparc T7-1 with default boot-jdk 8.0
authorerikj
Thu, 04 Aug 2016 10:00:54 +0200
changeset 39927 d83934a74ff9
parent 39926 7a6d5289e7b0
child 39928 8448cfeb0f1d
8162354: Unable to build JDK 9 on a Sparc T7-1 with default boot-jdk 8.0 Reviewed-by: tbell, dholmes
common/conf/jib-profiles.js
--- a/common/conf/jib-profiles.js	Wed Aug 03 10:38:53 2016 +0200
+++ b/common/conf/jib-profiles.js	Thu Aug 04 10:00:54 2016 +0200
@@ -357,6 +357,18 @@
     var boot_jdk_platform = input.build_os + "-"
         + (input.build_cpu == "x86" ? "i586" : input.build_cpu);
 
+    var boot_jdk_revision = "8";
+    var boot_jdk_subdirpart = "1.8.0";
+    // JDK 8 does not work on sparc M7 cpus, need a newer update when building
+    // on such hardware.
+    if (input.build_cpu == "sparcv9") {
+       var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
+       if (cpu_brand.trim() == 'SPARC-M7') {
+           boot_jdk_revision = "8u20";
+           boot_jdk_subdirpart = "1.8.0_20";
+       }
+    }
+
     var devkit_platform_revisions = {
         linux_x64: "gcc4.9.2-OEL6.4+1.0",
         macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
@@ -374,12 +386,12 @@
         boot_jdk: {
             server: "javare",
             module: "jdk",
-            revision: "8",
+            revision: boot_jdk_revision,
             checksum_file: boot_jdk_platform + "/MD5_VALUES",
-            file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz",
+            file: boot_jdk_platform + "/jdk-" + boot_jdk_revision + "-" + boot_jdk_platform + ".tar.gz",
             configure_args: (input.build_os == "macosx"
-                ? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home"
-                : "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0")
+                ? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart + ".jdk/Contents/Home"
+                : "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart)
         },
 
         devkit: {