From 2f7665b8292cc09574d62fecc3e9619c488ac137 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Tue, 11 Jan 2022 00:21:20 +0000 Subject: [PATCH] 8279644: hsdis may not work when it was built with --with-binutils=system Reviewed-by: erikj --- make/autoconf/jdk-options.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index cc4a44d39c96a..0a7145c9116a4 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -847,6 +847,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_HSDIS], AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ]) AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ], [ binutils_system_error="libiberty not found" ]) AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ]) + HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB" elif test "x$BINUTILS_DIR" != x; then if test -e $BINUTILS_DIR/bfd/libbfd.a && \ test -e $BINUTILS_DIR/opcodes/libopcodes.a && \ @@ -864,7 +865,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_HSDIS], AC_MSG_ERROR([binutils on system is supported for Linux only]) elif test "x$binutils_system_error" = x; then AC_MSG_RESULT([system]) - HSDIS_CFLAGS="-DSYSTEM_BINUTILS" + HSDIS_CFLAGS="$HSDIS_CFLAGS -DSYSTEM_BINUTILS" else AC_MSG_RESULT([invalid]) AC_MSG_ERROR([$binutils_system_error])