We incorrectly use $target instead of $host

RESOLVED FIXED

Status

Firefox Build System
General
RESOLVED FIXED
8 years ago
4 months ago

People

(Reporter: Paul Biggar, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
From my reading of the autotools book [http://sources.redhat.com/autobook/autobook/autobook_258.html] (which I imagine is stull current because we use autoconf 2.13), we should be cross-compiling using $host, not $target. $target is for tools that generate code, like a compiler, which Mozilla is not. $host is for the system that the compiled binary will run on, which is what we want.

So for example, in configure.in, we check $host != $target, which should always be false if we used the tools correctly. Instead, we set |./configure --target|, and luck out that it works out OK.

By contrast, when configuring js/src/libffi (from js/src/configure.in) we set $build and $host (ie we do it correctly). It seems this hasn't caused us trouble, but I'm not positive why since it shares the config.cache with higher-level build steps.

Comment 1

8 years ago
We misuse $host to mean $build and $target to mean $host. But we've done this for so long that changing it now would be pretty confusing to people. We've talked about adding a set of shims so that when people set --target=foo they actually mean --host=foo and changing the HOST_*FLAGS to be BUILD_*FLAGS, but the risk is high and the win is fairly low.

We should probably refactor the configure script first, at least.
(Reporter)

Comment 3

8 years ago
Created attachment 491591 [details] [diff] [review]
Comment describing the $host/$target weirdness

OK, how do we feel about this patch? (I'll backport it to configure.in fomr js/src/configure.in if the tree ever opens again).
Attachment #491591 - Flags: review?(ted.mielczarek)
I don't think a comment in configure is going to be all that useful, is it?
(Reporter)

Comment 5

8 years ago
(In reply to comment #4)
> I don't think a comment in configure is going to be all that useful, is it?

Better than no comment about this.

Unless you mean that it should go in the |configure --help| output?
Comment on attachment 491591 [details] [diff] [review]
Comment describing the $host/$target weirdness

It's harmless, so I don't oppose it, I just don't think anyone is going to read our configure.in to find it if they actually hit this confusion.
Attachment #491591 - Flags: review?(ted.mielczarek) → review+
(Reporter)

Comment 7

8 years ago
http://hg.mozilla.org/tracemonkey/rev/870bb8ee43e6
Whiteboard: [fixed-in-tracemonkey]

Comment 8

8 years ago
http://hg.mozilla.org/mozilla-central/rev/870bb8ee43e6
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Updated

4 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.