From patchwork Mon Nov 11 12:15:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Nevill X-Patchwork-Id: 21439 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f72.google.com (mail-vb0-f72.google.com [209.85.212.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 14CF5244E4 for ; Mon, 11 Nov 2013 12:15:24 +0000 (UTC) Received: by mail-vb0-f72.google.com with SMTP id w8sf7375837vbj.11 for ; Mon, 11 Nov 2013 04:15:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:subject:from:reply-to:to :cc:date:organization:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=3pbzRMaO97KANZJ9bxX6nK9kqDSjk7M/c2zLJyPNb4A=; b=KZrx/aMrIAniV8+KZfvhA/laxUVeQ163wSeTXQuYdpPmn9Ri5byzg0PqyW+zX+XYuK Yq5pIfuVVSb6XG8r5ihU74RdybvcGSokwZJXF/kF/Fd2qxTdlZj9p8lRl9SfQiDK9xGv fwmQ7piF4JUrueOOdoR3LW+lM3W08+RuvDhp0Vm9aA10s3j4I8DpuQDYfbt1wDBICFvy SyabpC/1RNcEelkU4bFvCcTOC0EP9KX/G8dH4C1JOS2gL1pX8SiRCKCZxeKsUcolAM+y waSTFCwVc9AFyiu7GN7K/ZsKjwzan5B/cpO6+fAXQgeU6cllgEiuw3vrbsg5/KFAKlYm +NDw== X-Gm-Message-State: ALoCoQnxMWRrIzFMnA8BQq1N7FFuZB6fc5nLEXDEd3zfJjkMwzsGPoXDhZyTwQLb2WVDXMQZHSgx X-Received: by 10.236.115.198 with SMTP id e46mr357297yhh.33.1384172124207; Mon, 11 Nov 2013 04:15:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.53.2 with SMTP id x2ls2470937qeo.34.gmail; Mon, 11 Nov 2013 04:15:23 -0800 (PST) X-Received: by 10.52.118.73 with SMTP id kk9mr20047450vdb.13.1384172123946; Mon, 11 Nov 2013 04:15:23 -0800 (PST) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by mx.google.com with ESMTPS id ud10si9534807vcb.141.2013.11.11.04.15.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 04:15:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.41; Received: by mail-vb0-f41.google.com with SMTP id w8so3299461vbj.28 for ; Mon, 11 Nov 2013 04:15:23 -0800 (PST) X-Received: by 10.221.6.195 with SMTP id ol3mr88193vcb.34.1384172123800; Mon, 11 Nov 2013 04:15:23 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp86566vcz; Mon, 11 Nov 2013 04:15:23 -0800 (PST) X-Received: by 10.204.229.202 with SMTP id jj10mr13068bkb.141.1384172122437; Mon, 11 Nov 2013 04:15:22 -0800 (PST) Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by mx.google.com with ESMTPS id ri6si3667159bkb.162.2013.11.11.04.15.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Nov 2013 04:15:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.47 is neither permitted nor denied by best guess record for domain of edward.nevill@linaro.org) client-ip=209.85.214.47; Received: by mail-bk0-f47.google.com with SMTP id v11so1235063bkz.20 for ; Mon, 11 Nov 2013 04:15:21 -0800 (PST) X-Received: by 10.204.104.13 with SMTP id m13mr9299bko.155.1384172121377; Mon, 11 Nov 2013 04:15:21 -0800 (PST) Received: from [192.168.1.112] (validation.linaro.org. [88.98.47.97]) by mx.google.com with ESMTPSA id kk2sm14176274bkb.10.2013.11.11.04.15.19 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 11 Nov 2013 04:15:20 -0800 (PST) Message-ID: <1384172119.31661.27.camel@localhost.localdomain> Subject: Update to client/server configuration From: Edward Nevill Reply-To: edward.nevill@linaro.org To: "aarch64-port-dev@openjdk.java.net" Cc: patches@linaro.org Date: Mon, 11 Nov 2013 12:15:19 +0000 Organization: Linaro X-Mailer: Evolution 3.8.3 (3.8.3-2.fc19) Mime-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: edward.nevill@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.41 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, The following patch fixes the problems seen by Andrew Haley when doing a native server build. The first change is to update the jvm.cfg file which was broken in any case. The previous vsn read -client KNOWN -server IF_SERVER_CLASS KNOWN This is broken both syntactically and semantically. Syntactically from the description in jdk8/jdk/src/share/bin/java.c the syntax of a predicateLine is * predicateLine := flag "IF_SERVER_CLASS" flag EOL (where flag is a '-' followed by a vm name) The semantics of the predicateLine is as follows * - if the flag appears as the first flag on a predicateLine, and * the machine on which you are running passes the predicate indicated, * then the identifier of the second flag is used as the name of the JVM, * otherwise the identifier of the first flag is used as the name of the JVM. * If no flag is given on the command line, the first vmLine of the jvm.cfg * file determines the name of the JVM. * PredicateLines are only interpreted on first vmLine of a jvm.cfg file, * since they only make sense if someone hasn't specified the name of the * JVM on the command line. I have changed the jvm.cfg to read -client IF_SERVER_CLASS -server -server KNOWN -minimal KNOWN (this is simply copied from i586 jvm.cfg, which is the same as the arm and sparc jvm.cfg) >>>>>>>>>>> Note that this changes the default VM to be -server <<<<<<<<<<<<<<< However this does not fully fix the problems seen by Andrew Haley. It merely transfers the error from the server build to the client build. IE. Now, with the new jvm.cfg you will get the following error when doing a native client build. Error: missing 'server' JVM at ........... The remaining changes to java.c, java.h and java_md_solinux.c work around the problem as follows. If we selected a server VM based on the IF_SERVER_CLASS predicate and it turns out that in fact the server VM is missing, then we revert to using the client VM. Note that this only happens if no vm is specified on the command line. If a vm is specified on the command line and that vm does not exist an error will always be generated. This has to be a run time test rather than a compile time build option in order to allow for a new VM to be plugged in (IE. we cannot tell whether a server vm exists at compile time based on whether we are doing a client/server build because a server VM can always be added later to a client build). So why is this a problem for aarch64 but not for 64bit x86 (amd64). The jvm.cfg for amd64 specifies -server KNOWN -client IGNORE IE. If you specify -client on the command line, it ignores it and runs the server compiler anyway. I am assuming that we do not want this behaviour and that we do in fact want to be able to run the client compiler on aarch64. If this is not the case and we are happy to ignore the client compiler then we can simply copy the jvm.cfg file from amd64 and ignore the rest of the changes. OK to push? Ed. --- CUT HERE --- # HG changeset patch # User Edward Nevill edward.nevill@linaro.org # Date 1384170206 0 # Mon Nov 11 11:43:26 2013 +0000 # Node ID 2940c1ead99bd7635c767f4d585b67fcf7544076 # Parent 445cf19d4a9b534af22783c22cde8bb8274eecf2 Fixes to work around "missing 'client' JVM" error messages diff -r 445cf19d4a9b -r 2940c1ead99b src/share/bin/java.c --- a/src/share/bin/java.c Fri Oct 18 15:12:05 2013 +0100 +++ b/src/share/bin/java.c Mon Nov 11 11:43:26 2013 +0000 @@ -633,6 +633,22 @@ return jvmtype; } +/* + * This is called if the jvmtype returned by CheckJvmType above + * didn't exist. In this case if it was the default VM and we + * selected the server vm we will allow it to use the client vm + * instead. + */ +char * +GetAltJvmType(char *jvmtype) +{ + if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) && + (jvmtype == knownVMs[0].server_class+1)) { + return knownVMs[0].name+1; + } + return NULL; +} + /* copied from HotSpot function "atomll()" */ static int parse_size(const char *s, jlong *result) { diff -r 445cf19d4a9b -r 2940c1ead99b src/share/bin/java.h --- a/src/share/bin/java.h Fri Oct 18 15:12:05 2013 +0100 +++ b/src/share/bin/java.h Mon Nov 11 11:43:26 2013 +0000 @@ -164,6 +164,7 @@ */ jint ReadKnownVMs(const char *jvmcfg, jboolean speculative); char *CheckJvmType(int *argc, char ***argv, jboolean speculative); +char *GetAltJvmType(char *jvmtype); void AddOption(char *str, void *info); enum ergo_policy { diff -r 445cf19d4a9b -r 2940c1ead99b src/solaris/bin/aarch64/jvm.cfg --- a/src/solaris/bin/aarch64/jvm.cfg Fri Oct 18 15:12:05 2013 +0100 +++ b/src/solaris/bin/aarch64/jvm.cfg Mon Nov 11 11:43:26 2013 +0000 @@ -31,5 +31,6 @@ # "-XXaltjvm=" option, but that too is unsupported # and may not be available in a future release. # --client KNOWN --server IF_SERVER_CLASS KNOWN +-client IF_SERVER_CLASS -server +-server KNOWN +-minimal KNOWN diff -r 445cf19d4a9b -r 2940c1ead99b src/solaris/bin/java_md_solinux.c --- a/src/solaris/bin/java_md_solinux.c Fri Oct 18 15:12:05 2013 +0100 +++ b/src/solaris/bin/java_md_solinux.c Mon Nov 11 11:43:26 2013 +0000 @@ -465,8 +465,17 @@ } if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch, 0 )) { - JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath); - exit(4); + char *altjvmtype = GetAltJvmType(jvmtype); + jboolean found = JNI_FALSE; + if (altjvmtype) { + jvmtype = altjvmtype; + jvmpath[0] = '\0'; + found = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch, 0) != NULL; + } + if (!found) { + JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath); + exit(4); + } } /* * we seem to have everything we need, so without further ado --- CUT HERE ---