Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update java code for RISC-V (src) #221

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update java code for RISC-V (src)
The changes are to modify the java code in the
src directory to avoid the timeout issue in the
native compilation on RISC-V.

Issue: #218

Signed-off-by: Cheng Jin <[email protected]>
Cheng Jin committed Oct 11, 2019
commit 69a94ea4c1c91b87bde8f3b87036d094e54bc9b0
Original file line number Diff line number Diff line change
@@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
* ===========================================================================
*/

package com.sun.tools.sjavac.client;

@@ -84,6 +89,8 @@ public class SjavacClient implements Sjavac {

// Store the server conf settings here.
private final String settings;

private boolean isRiscv = System.getProperty("os.arch").toLowerCase().contains("riscv");

public SjavacClient(Options options) {
String tmpServerConf = options.getServerConf();
@@ -183,10 +190,15 @@ private Socket tryConnect() throws IOException, InterruptedException {
try {
return makeConnectionAttempt();
} catch (IOException ex) {
Log.error("Connection attempt failed: " + ex.getMessage());
if (attempt >= MAX_CONNECT_ATTEMPTS) {
Log.error("Giving up");
throw new IOException("Could not connect to server", ex);
/* Keep trying to connect as the native compilation with a non-JIT cross build
* on Linux/RISCV is extremely slow.
*/
if (!isRiscv) {
Log.error("Connection attempt failed: " + ex.getMessage());
if (attempt >= MAX_CONNECT_ATTEMPTS) {
Log.error("Giving up");
throw new IOException("Could not connect to server", ex);
}
}
}
Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);
Original file line number Diff line number Diff line change
@@ -22,6 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
* ===========================================================================
*/

package com.sun.tools.sjavac.server;

@@ -76,6 +81,7 @@ public class PortFile {
private long serverCookie;
private int myServerPort;
private long myServerCookie;
private boolean isRiscv = System.getProperty("os.arch").toLowerCase().contains("riscv");

/**
* Create a new portfile.
@@ -247,7 +253,11 @@ public void waitForValidValues() throws IOException, InterruptedException {
Log.debug("Valid port file values found after " + (System.currentTimeMillis() - startTime) + " ms");
return;
}
if (System.currentTimeMillis() > timeout) {

/* Keep waiting for port file values as the native compilation with a non-JIT cross build
* on Linux/RISCV is extremely slow.
*/
if (!isRiscv && (System.currentTimeMillis() > timeout)) {
break;
}
Thread.sleep(MS_BETWEEN_ATTEMPTS);