Does CDS archive generation work for crossbuilds?

Ioi Lam ioi.lam at oracle.com
Thu Oct 28 20:56:04 UTC 2021


How reliable would it be to use qemu to run the cross-compiled binaries? 
Has anyone tried that recently?


On 10/23/21 5:48 AM, Thomas Stüfe wrote:
> Hi Alan,
>
> On Sat, Oct 23, 2021 at 9:58 AM Alan Bateman <Alan.Bateman at oracle.com>
> wrote:
>
>>
>> On 23/10/2021 07:57, Thomas Stüfe wrote:
>>> Hi,
>>>
>>> when I crossbuild (for linux aarch64, using a devkit, building on linux
>>> x64), for some reason I don't
>>> get the classes.jsa generated inside the images directory.
>>>
>>> My configure options:
>>>
>>>
>> --with-devkit=/shared/projects/openjdk/devkits/x86_64-linux-gnu-to-aarch64-linux-gnu
>>> --openjdk-target=aarch64-linux-gnu
>>> --with-boot-jdk=/shared/projects/openjdk/jdks/sapmachine17
>>>
>> --with-build-jdk=/shared/projects/openjdk/jdk-jdk/output-release/images/jdk
>>> --with-gtest=/shared/projects/openjdk/gtest/googletest
>>> --with-debug-level=fastdebug
>>>
>>> The build jdk is a freshly build x64 release VM from the same source
>> tree.
>>> Am I missing something obvious? Is CDS archive generation even supported
>>> for crossbuilds?
>> It needs the generate run-time to execute "java -Xshare:dump" so I don't
>> expect so. hotspot-runtime-dev is probably the place to discuss the
>> details. BTW: this came up recently in the context of the jlink plugin
>> that generates the CDS archive. The plugin needed a check to ensure that
>> the target platform matched the current platform as it could launch the
>> target VM to create the dump.
>>
>>
> Thinking for a second, probably it cannot work since we copy binary
> structures verbatim to the archive; I guess the chance that they are binary
> compatible between platforms is very small. But it should be easily
> rectified by calling Xshare:dump on the target platform.
>
> Thank you!
>
> ..Thomas
>
>
>> -Alan
>>




More information about the build-dev mailing list