[cfe-commits] [llvm-commits] Ping^2: Fix for bug 11060: configure --target does not work

Sebastian Pop spop at codeaurora.org
Wed Oct 26 11:33:38 PDT 2011


On Wed, Oct 26, 2011 at 11:54 AM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> On Wed, Oct 26, 2011 at 11:01:18AM -0500, Sebastian Pop wrote:
>> Eric, could you please commit the configure --target patches?
>> I have attached an updated version of the patches on top of
>> today's trunk.
>
> You are still introducing a redundant macro and associated code.

I disagree.  The code that I am adding is non redundant:
LLVM_DEFAULT_TARGET_TRIPLE is set from $target:
+AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
+                   [Default target triple to build for])

LLVM_HOSTTRIPLE is defined from $host:
AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
                   [Host triple we were built on])

(The comment here is confusing HOST and BUILD as well:
it should be modified to read "Host triple the compiler is running on".)

> Which part of "LLVM_HOSTTRIPLE controls the target" was unclear?

LLVM_HOSTTRIPLE should *not* control the target.
$host and $target are two different things (in the cross compilers world.)

How would you select the value set by configure in $target after you
have thrown away the information that configure has set in $target?

The only way "$host controls $target" is when --target is not specified.
That's exactly configure's job to set the value for $target according to
the options that you provide to configure.

configure --help says:
[...]
Defaults for the options are specified in brackets.
[...]
System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET   configure for building compilers for TARGET [HOST]

So if you do not specify --target, configure sets in $target the value that
it previously set in $host.

Sebastian
--
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum



More information about the cfe-commits mailing list