RFR: 8318418: hsdis build fails with system binutils on Ubuntu

Daniel Jeliński djelinski at openjdk.org
Wed Oct 18 10:33:41 UTC 2023


On Wed, 18 Oct 2023 09:54:21 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> hsdis-binutils.c doesn't use any functions from libiberty.h. This header is absent on Ubuntu (installed separately, and under a different path), so removing the include fixes the hsdis compilation on Ubuntu.
>> 
>> Additionally, the static link library for libiberty is not needed on Ubuntu; I changed the autoconf check to make libiberty optional.
>> 
>> Verification (Ubuntu):
>> - build with-binutils=system works
>> - build with-binutils-src=binutils-2.30 continues to work
>> - build with-binutils-src=binutils-2.38 continues to work
>> 
>> Source builds with versions newer than 2.38 fail, see #15138
>
> make/autoconf/lib-hsdis.m4 line 239:
> 
>> 237:     AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ])
>> 238:     AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ])
>> 239:     # libiberty is not required on Ubuntu
> 
> Is libiberty required on anything?

yes, it's required by libbfd when compiling from source.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16238#discussion_r1363638908


More information about the build-dev mailing list