From 1ca045e2ae731ab5aed6203f622bbafad1246fd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Jeli=C5=84ski?= Date: Wed, 22 Jan 2025 08:58:11 +0100 Subject: [PATCH] 8318418: hsdis build fails with system binutils on Ubuntu Origin: upstream, https://github.com/openjdk/jdk/commit/3c70f2c1e9fb91cd5d7a66ef1e2a39672230208c Bug: https://bugs.openjdk.org/browse/JDK-8318418 Last-Update: 2024-03-12 Ubuntu does not need libiberty.h include for the build. Gbp-Pq: Name jdk-8318418.patch --- make/autoconf/lib-hsdis.m4 | 5 +++-- src/utils/hsdis/binutils/hsdis-binutils.c | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/make/autoconf/lib-hsdis.m4 b/make/autoconf/lib-hsdis.m4 index 470a0ae83..974d0e8b7 100644 --- a/make/autoconf/lib-hsdis.m4 +++ b/make/autoconf/lib-hsdis.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2021, 2023, 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 @@ -236,7 +236,8 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS], if test "x$BINUTILS_DIR" = xsystem; then AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ]) 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" ]) + # libiberty is not required on Ubuntu + AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ]) 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 diff --git a/src/utils/hsdis/binutils/hsdis-binutils.c b/src/utils/hsdis/binutils/hsdis-binutils.c index 279ed53ba..28e374e05 100644 --- a/src/utils/hsdis/binutils/hsdis-binutils.c +++ b/src/utils/hsdis/binutils/hsdis-binutils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * The Universal Permissive License (UPL), Version 1.0 @@ -57,7 +57,6 @@ #include #include -#include #include #include -- 2.30.2