RFR: 8295033: hsdis configure error when cross-compiling with --with-binutils-src

Dingli Zhang dzhang at openjdk.org
Wed Oct 12 01:29:36 UTC 2022


On Tue, 11 Oct 2022 12:57:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Ok, we already have an exported value for `$host`, which is `$OPENJDK_TARGET_AUTOCONF_NAME`. Also, `$conf_openjdk_target` is used in the wrapper configure script. It is probably leaking into the main generated autoconf script, but it is definitely not supposed to be used there. Instead, it should only be used to setup the `--host=` option to autoconf. So looking for `$host` is fine I suppose, but we should do it using the OPENJDK_TARGET_AUTOCONF_NAME variable.
>
>> Ok, we already have an exported value for `$host`, which is `$OPENJDK_TARGET_AUTOCONF_NAME`. Also, `$conf_openjdk_target` is used in the wrapper configure script. It is probably leaking into the main generated autoconf script, but it is definitely not supposed to be used there. Instead, it should only be used to setup the `--host=` option to autoconf. So looking for `$host` is fine I suppose, but we should do it using the OPENJDK_TARGET_AUTOCONF_NAME variable.
> 
> Quite!
> 
> Applying this patch over the PR:
> 
> 
> diff --git a/make/autoconf/lib-hsdis.m4 b/make/autoconf/lib-hsdis.m4
> index dddc1cf6a4d..72bd08c7108 100644
> --- a/make/autoconf/lib-hsdis.m4
> +++ b/make/autoconf/lib-hsdis.m4
> @@ -175,10 +175,10 @@ AC_DEFUN([LIB_BUILD_BINUTILS],
>        fi
>      else
>        binutils_cc="$CC $SYSROOT_CFLAGS"
> -      if test "x$host" = "x$build"; then
> -        binutils_target=""
> +      if test "x$COMPILE_TYPE" = xcross; then
> +        binutils_target="--host=$OPENJDK_TARGET_AUTOCONF_NAME"
>        else
> -        binutils_target="--host=$host"
> +        binutils_target=""
>        fi
>      fi
>      binutils_cflags="$binutils_cflags $MACHINE_FLAG $JVM_PICFLAG $C_O_FLAG_NORM"
> 
> 
> ...successfully produces the hsdis binaries on all these platforms:
> 
> 
> server-release-aarch64-linux-gnu-10
> server-release-arm-linux-gnueabihf-10
> server-release-i686-linux-gnu-10
> server-release-powerpc64le-linux-gnu-10
> server-release-powerpc64-linux-gnu-10
> server-release-riscv64-linux-gnu-10
> server-release-s390x-linux-gnu-10
> server-release-x86_64-linux-gnu-10
> zero-release-aarch64-linux-gnu-10
> zero-release-alpha-linux-gnu-10
> zero-release-arm-linux-gnueabi-10
> zero-release-arm-linux-gnueabihf-10
> zero-release-i686-linux-gnu-10
> zero-release-m68k-linux-gnu-10
> zero-release-mips64el-linux-gnuabi64-10
> zero-release-mipsel-linux-gnu-10
> zero-release-powerpc64le-linux-gnu-10
> zero-release-powerpc64-linux-gnu-10
> zero-release-powerpc-linux-gnu-10
> zero-release-riscv64-linux-gnu-10
> zero-release-s390x-linux-gnu-10
> zero-release-sh4-linux-gnu-10
> zero-release-sparc64-linux-gnu-10
> zero-release-x86_64-linux-gnu-10
> 
> 
> Therefore, I believe this is what we should do and then call it a day. (Then I also need to start building all these hsdis-es at [https://builds.shipilev.net/hsdis/](https://builds.shipilev.net/hsdis/))

@shipilev @magicus Thanks for the review!
I have skipped the demo Makefile changes from this PR and applied the patch from @shipilev.

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

PR: https://git.openjdk.org/jdk/pull/10628


More information about the hotspot-compiler-dev mailing list