RFR: 8285630: Fix a configure error in RISC-V cross build

Fei Yang fyang at openjdk.java.net
Thu Apr 28 08:16:43 UTC 2022


On Thu, 28 Apr 2022 01:31:07 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> We are trying to cross build a RISC-V version of OpenJDK. We specified
>> `--openjdk-target=riscv64-linux-gnu` after `bash configure` but got an
>> error message.
>> 
>> 
>> configure: error: /usr/bin/bash /home/ent-user/jdk_src/make/autoconf/build-aux/config.sub riscv64-linux-gnu failed
>> configure exiting with result code 1
>> 
>> 
>> It shows the processing of `riscv64-linux-gnu` in script `config.sub`
>> fails. We see `config.sub` calls another script `autoconf-config.sub`
>> to validate and canonicalize a configuration type. The validation fails
>> here because `autoconf-config.sub` is a quite old version and has no
>> RISC-V support inside. Comments in those scripts tell us patching the
>> autoconf script is not a good idea so we add a fix in `config.sub` in
>> this patch.
>> 
>> We have verified RISC-V cross build succeeds after this change. As we
>> are not quite familiar with the build system, please let us know if this
>> is the best way to fix.
>
> This also works when doing a native build. 
> Do you know why this issue is not there for other cpus likes aarch64? Just curious. 
> BTW: I noticed there is an unnecessary new line at the end of file config.sub. Maybe we should remove it.

> Hi @RealFYang
> 
> > This also works when doing a native build.
> > Do you know why this issue is not there for other cpus likes aarch64? Just curious.
> 
> Old version of `autoconf-config.sub` can handle `arm`. For AArch64, arch name `aarch64` is firstly replaced by `arm` and then replaced back after the canonicalization in `autoconf-config.sub`.
> 
> > BTW: I noticed there is an unnecessary new line at the end of file config.sub. Maybe we should remove it.
> 
> Done, thanks.

Thanks for explaining that. Looks good to me.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8420



More information about the build-dev mailing list