RFR: 8295262: Build binutils out of source tree

Aleksey Shipilev shade at openjdk.org
Thu Oct 13 08:10:06 UTC 2022


On Thu, 13 Oct 2022 07:43:33 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

> Currently, when passing --with-binutils-src, binutils is built in the source tree. That leads to conflicting targets when compiling for different architectures (ex: amd64 on the host, and riscv64 or aarch64 for the target) from the same jdk source tree.
> 
> The simplest solution is to build binutils out-of-tree and into the build/<target>/binutils folder. These out-of-tree builds are already supported by binutils and only require some changes in the way we invoke the binutils/configure command.

This generally looks good. I stumbled upon this issue when cross-compiling hsdis too! But we need some cleanups, I think:

make/autoconf/lib-hsdis.m4 line 184:

> 182:     else
> 183:       binutils_cc="$CC $SYSROOT_CFLAGS"
> 184:       if test "x$COMPILE_TYPE" = xcross; then

I am surprised this PR does not have a merge conflict against current mainline which already has this block. Can you please merge the fresh master to your PR?

src/utils/hsdis/binutils/hsdis-binutils.c line 571:

> 569:   dinfo->disassembler_options =
> 570:     disassembler_options != NULL && disassembler_options[0] != '\0' ?
> 571:       disassembler_options : NULL;

This hunk looks irrelevant to the issue?

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

Changes requested by shade (Reviewer).

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



More information about the build-dev mailing list