aboutsummaryrefslogtreecommitdiff
path: root/standalone
diff options
context:
space:
mode:
Diffstat (limited to 'standalone')
-rw-r--r--standalone/build.gradle.kts10
-rw-r--r--standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java16
2 files changed, 20 insertions, 6 deletions
diff --git a/standalone/build.gradle.kts b/standalone/build.gradle.kts
index 9f645fe..e1113e9 100644
--- a/standalone/build.gradle.kts
+++ b/standalone/build.gradle.kts
@@ -20,10 +20,12 @@ application {
}
tasks.withType<JavaCompile> {
- options.compilerArgs.addAll(arrayOf(
- "--add-modules", "jdk.crypto.ec",
- "--add-exports", "jdk.crypto.ec/sun.security.ec=ALL-UNNAMED"
- ))
+ if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
+ options.compilerArgs.addAll(arrayOf(
+ "--add-modules", "jdk.crypto.ec",
+ "--add-exports", "jdk.crypto.ec/sun.security.ec=ALL-UNNAMED"
+ ))
+ }
}
tasks.register<Exec>("libs") {
diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java
index db85b02..2f469aa 100644
--- a/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java
+++ b/standalone/src/main/java/cz/crcs/ectester/standalone/libs/NativeECLibrary.java
@@ -34,7 +34,11 @@ public abstract class NativeECLibrary extends ProviderECLibrary {
Path libPath = libDir.resolve(resource + "." + suffix);
/* Write the shim. */
- FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + resource + "." + suffix, libPath);
+ boolean found = FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + resource + "." + suffix, libPath);
+ if (!found) {
+ //System.err.printf("Resource %s not found.\n", resource);
+ return false;
+ }
/* Load the requirements, if they are bundled, write them in and load them. */
try {
@@ -42,13 +46,19 @@ public abstract class NativeECLibrary extends ProviderECLibrary {
if (requirement.endsWith(suffix)) {
/* The requirement is bundled, write it */
Path reqPath = libReqDir.resolve(requirement);
- FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + requirement, reqPath);
+ found = FileUtil.writeNewer(ECTesterStandalone.LIB_RESOURCE_DIR + requirement, reqPath);
+ if (!found) {
+ //System.err.printf("Requirement %s not found for %s.\n", requirement, resource);
+ return false;
+ }
System.load(reqPath.toString());
} else {
System.loadLibrary(requirement);
}
}
} catch (UnsatisfiedLinkError ule) {
+ System.err.println(resource);
+ ule.printStackTrace();
return false;
}
@@ -57,6 +67,8 @@ public abstract class NativeECLibrary extends ProviderECLibrary {
provider = createProvider();
return super.initialize();
} catch (IOException | UnsatisfiedLinkError ignored) {
+ System.err.println(resource);
+ ignored.printStackTrace();
}
return false;
}