RFR: 8211740 - [AOT] -XX:AOTLibrary doesn't accept windows path
Vladimir Kozlov
vladimir.kozlov at oracle.com
Mon Oct 15 22:18:58 UTC 2018
+1
Thanks,
Vladimir
On 10/15/18 2:36 PM, Igor Ignatyev wrote:
> Hi Bob,
>
> the fix looks good to me.
>
> Thanks,
> -- Igor
>
>> On Oct 15, 2018, at 1:48 PM, Bob Vandette <bob.vandette at oracle.com> wrote:
>>
>> Please review this fix for accepting the option —XX:AOTLibrary on Windows that contains fully specified paths.
>>
>> Please note: The fact that we are using “.so” for windows libraries is a known, filed issue that
>> was deferred.
>>
>> Bob.
>>
>>
>> diff --git a/src/hotspot/share/aot/aotLoader.cpp b/src/hotspot/share/aot/aotLoader.cpp
>> --- a/src/hotspot/share/aot/aotLoader.cpp
>> +++ b/src/hotspot/share/aot/aotLoader.cpp
>> @@ -137,6 +137,12 @@
>> 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 @@
>> 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);
>>
>> diff --git a/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java b/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java
>> --- a/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java
>> +++ b/test/hotspot/jtreg/compiler/aot/cli/MultipleAOTLibraryTest.java
>> @@ -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 @@
>> 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();
>
More information about the hotspot-compiler-dev
mailing list