RFC: Support both Cross and Native compiler from configure

Tamar Christina Tamar.Christina@arm.com
Thu Jun 27 09:26:00 GMT 2019


Hi,

I guess what I'm asking is more at the conceptual level and not technical, I haven't looked into the how yet, though the explanation is useful!

Indeed GCC does this a lot, I was indeed going for a lightweight version of the md file processing mechanism.

What I was after is if people would be fine with such a change to the build system. Since unless I'm mistaken (and correct me if I am), this would now require when cross compiling both a compiler where --host=$build and --host=$host, whereas before you'd just require --host=$build.

Kind Regards,
Tamar

-----Original Message-----
From: binutils-owner@sourceware.org <binutils-owner@sourceware.org> On Behalf Of Simon Richter
Sent: Sunday, June 23, 2019 4:21 PM
To: binutils@sourceware.org
Subject: Re: RFC: Support both Cross and Native compiler from configure

Hi,

On Sun, Jun 23, 2019 at 01:32:12PM +0000, Tamar Christina wrote:

> For AArch64 we'd like to move the generation of some of our generated files from being a part of maintainer mode to just being an artefact of the normal build.

So you want to build things for the build arch as well?

The GNU system has "build", "host" and "target" architectures, and the toplevel coordinates between them. If you need to compile a program that should run during the build process, the toplevel creates a directory and calls

    .../tool/configure --build=$build --host=$build --target=$target

so the tool is built with the native compiler ($host == $build).

The programs that are part of the toolchain are configured normally, using

    .../tool/configure --build=$build --host=$host --target=$target

If $build == $host on the toplevel, then both of these configurations are identical, so the directory is shared.

The build system type (--build) is largely informational in autoconf, it is used in a check to determine if we are cross-compiling, but looking for a native compiler inside a configure script that also configures for cross compiling is not going to work, because there is only a single namespace.

GCC has lots of example code for this -- the DFA generator tool AFAIK uses libiberty, so it is built for the build system, and then again for the host system when building the cross compiler. Your problem is likely to be a simpler variant of what they do to build libgcc for the target when build and host system are different.

   Simon



More information about the Binutils mailing list