From 4f9f1955ab2737880158c57d4891d90e2fd2f5d7 Mon Sep 17 00:00:00 2001 From: Claes Redestad Date: Fri, 27 Oct 2023 14:40:30 +0000 Subject: [PATCH] 8318753: hsdis binutils may place libs in lib64 Reviewed-by: rehn, djelinski, ihse --- make/autoconf/lib-hsdis.m4 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/make/autoconf/lib-hsdis.m4 b/make/autoconf/lib-hsdis.m4 index 987658bc411..4414e54886c 100644 --- a/make/autoconf/lib-hsdis.m4 +++ b/make/autoconf/lib-hsdis.m4 @@ -255,16 +255,25 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS], disasm_header="\"$BINUTILS_INSTALL_DIR/include/dis-asm.h\"" if test -e $BINUTILS_INSTALL_DIR/lib/libbfd.a && \ test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \ - test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then + (test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a || test -e $BINUTILS_INSTALL_DIR/lib64/libiberty.a); then HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB -I$BINUTILS_INSTALL_DIR/include" - HSDIS_LIBS="$BINUTILS_INSTALL_DIR/lib/libbfd.a $BINUTILS_INSTALL_DIR/lib/libopcodes.a $BINUTILS_INSTALL_DIR/lib/libiberty.a" + + # libiberty ignores --libdir and may be installed in $BINUTILS_INSTALL_DIR/lib or $BINUTILS_INSTALL_DIR/lib64 + # depending on system setup + LIBIBERTY_LIB="" + if test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then + LIBIBERTY_LIB="$BINUTILS_INSTALL_DIR/lib/libiberty.a" + else + LIBIBERTY_LIB="$BINUTILS_INSTALL_DIR/lib64/libiberty.a" + fi + HSDIS_LIBS="$BINUTILS_INSTALL_DIR/lib/libbfd.a $BINUTILS_INSTALL_DIR/lib/libopcodes.a $LIBIBERTY_LIB" # If we have libsframe add it. if test -e $BINUTILS_INSTALL_DIR/lib/libsframe.a; then HSDIS_LIBS="$HSDIS_LIBS $BINUTILS_INSTALL_DIR/lib/libsframe.a" fi AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], AC_MSG_ERROR([libz not found])) else - AC_MSG_ERROR(["$BINUTILS_INSTALL_DIR/libs/ must contain libbfd.a, libopcodes.a, libiberty.a"]) + AC_MSG_ERROR(["$BINUTILS_INSTALL_DIR/lib[64] must contain libbfd.a, libopcodes.a and libiberty.a"]) fi fi