[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Specify '--build' for cross compilation?
From: |
Greg Chicares |
Subject: |
[lmi] Specify '--build' for cross compilation? |
Date: |
Tue, 16 Aug 2016 22:06:54 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 |
Vadim--Although I'm on vacation, I was looking over some tentative
local changes to support cross-compiling lmi binaries for msw in a
GNU/Linux (debian 8.5) chroot, and it seems clear that I should use
--host=i686-w64-mingw32
but should '--build' be specified at all?
The likeliest candidate for '--build' seems to be:
/opt/lmi/src/lmi[0]$/usr/share/misc/config.guess
x86_64-unknown-linux-gnu
For libxml2 and libxslt, I've specified exactly that:
--build=x86_64-unknown-linux-gnu
and it works. But I've also omitted '--build' altogether, and that
seems to work just as well. Which of these is the recommended
practice? I would have guessed that omitting '--build' would be
better, because it would then default to `config.guess`, which
must be right while my manual override could be wrong (see below);
however:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Specifying-Target-Triplets.html
| If you mean to override the result of config.guess, use --build,
| not --host, since the latter enables cross-compilation. For
| historical reasons, whenever you specify --host, be sure to
| specify --build too; this will be fixed in the future.
I'm not sure whether to parse those consecutive sentences as an
indivisible unit--i.e., does the first clause qualify the entire
paragraph, or only its first sentence?
Interpretation 1: I don't mean to override `config.guess`, so I
should therefore ignore the whole paragraph.
Interpretation 2: The second sentence is independent. Even though
I don't mean to override `config.guess`, I must specify '--host',
so I should therefore specify '--build' explicitly.
This node:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Hosts-and-Cross_002dCompilation.html
discusses the "historical reasons", giving some advice with the
warning:
| Do not rely on it, as it will be completely disabled in a couple
| of releases (we cannot keep it, as it proves to cause more
| problems than it cures).
Still, I'm left with the impression that the most robust and
future-proof method is to specify both '--host' and '--build',
though it seems weird to override `config.guess` (because I can
do that incorrectly--see below). What would you recommend?
For wxWidgets, I've specified '--build' thus:
--build=x86_64-unknown-linux-gnu
but also (negligently, in a different chroot, months ago) thus:
--build=i686-pc-cygwin
and both seem to work just fine in my debian build system. It does
seem strange to read this in the debian log:
checking build system type... i686-pc-cygwin
checking host system type... i686-w64-mingw32
and I'm surprised that it didn't complain about "i686-pc-cygwin".
Maybe it just happens to work because cygwin tries to emulate
GNU/Linux. Anyway, "i686-pc-cygwin" is certainly wrong.
- [lmi] Specify '--build' for cross compilation?,
Greg Chicares <=