8211740: [AOT] -XX:AOTLibrary doesn't accept windows path

Reviewed-by: kvn, iignatyev
This commit is contained in:
Bob Vandette 2018-10-16 09:54:28 -04:00
parent 497de20391
commit 6a7fdffe3b
2 changed files with 13 additions and 3 deletions

View File

@ -137,6 +137,12 @@ void AOTLoader::initialize() {
return;
}
#ifdef _WINDOWS
const char pathSep = ';';
#else
const char pathSep = ':';
#endif
// Scan the AOTLibrary option.
if (AOTLibrary != NULL) {
const int len = (int)strlen(AOTLibrary);
@ -147,7 +153,7 @@ void AOTLoader::initialize() {
char* end = cp + len;
while (cp < end) {
const char* name = cp;
while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != ':' && (*cp) != ';') cp++;
while ((*cp) != '\0' && (*cp) != '\n' && (*cp) != ',' && (*cp) != pathSep) cp++;
cp[0] = '\0'; // Terminate name
cp++;
load_library(name, true);

View File

@ -54,6 +54,7 @@
package compiler.aot.cli;
import compiler.aot.HelloWorldPrinter;
import java.io.File;
import java.util.Arrays;
import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest;
@ -75,8 +76,11 @@ public final class MultipleAOTLibraryTest {
boolean addTestVMOptions = true;
String[] allArgs = Arrays.copyOf(args, args.length + 4);
allArgs[args.length] = "-XX:AOTLibrary="
+ "./libMultipleAOTLibraryTest1.so:"
+ "./libMultipleAOTLibraryTest2.so";
+ "." + File.separator
+ "libMultipleAOTLibraryTest1.so"
+ File.pathSeparator
+ "." + File.separator
+ "libMultipleAOTLibraryTest2.so";
allArgs[args.length + 1] = "-XX:+PrintAOT";
allArgs[args.length + 2] = "-XX:+UseAOT";
allArgs[args.length + 3] = HelloWorldPrinter.class.getName();