|
22 | 22 | * or visit www.oracle.com if you need additional information or have any
|
23 | 23 | * questions.
|
24 | 24 | */
|
| 25 | +/* |
| 26 | + * =========================================================================== |
| 27 | + * (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved |
| 28 | + * =========================================================================== |
| 29 | + */ |
25 | 30 |
|
26 | 31 | package com.sun.tools.sjavac.client;
|
27 | 32 |
|
@@ -84,6 +89,8 @@ public class SjavacClient implements Sjavac {
|
84 | 89 |
|
85 | 90 | // Store the server conf settings here.
|
86 | 91 | private final String settings;
|
| 92 | + |
| 93 | + private boolean isRiscv = System.getProperty("os.arch").toLowerCase().contains("riscv"); |
87 | 94 |
|
88 | 95 | public SjavacClient(Options options) {
|
89 | 96 | String tmpServerConf = options.getServerConf();
|
@@ -183,10 +190,15 @@ private Socket tryConnect() throws IOException, InterruptedException {
|
183 | 190 | try {
|
184 | 191 | return makeConnectionAttempt();
|
185 | 192 | } catch (IOException ex) {
|
186 |
| - Log.error("Connection attempt failed: " + ex.getMessage()); |
187 |
| - if (attempt >= MAX_CONNECT_ATTEMPTS) { |
188 |
| - Log.error("Giving up"); |
189 |
| - throw new IOException("Could not connect to server", ex); |
| 193 | + /* Keep trying to connect as the native compilation with a non-JIT cross build |
| 194 | + * on Linux/RISCV is extremely slow. |
| 195 | + */ |
| 196 | + if (!isRiscv) { |
| 197 | + Log.error("Connection attempt failed: " + ex.getMessage()); |
| 198 | + if (attempt >= MAX_CONNECT_ATTEMPTS) { |
| 199 | + Log.error("Giving up"); |
| 200 | + throw new IOException("Could not connect to server", ex); |
| 201 | + } |
190 | 202 | }
|
191 | 203 | }
|
192 | 204 | Thread.sleep(WAIT_BETWEEN_CONNECT_ATTEMPTS);
|
|
0 commit comments