Rename -ccc-host-triple into -ccc-target-triple

Hi,

I am definitely in favour of less confusing names. It took me a while to understand what these mean. Apparently gcc uses three terms:

- build (for the system building the compiler)
- target (for the system that the compiler is built to run on)
- host (for the system that the code built with the compiler is build to run on)

This is a bit confusing, but unfortunately this terminology also seems to have made its way into the configure scripts. The autoconf documentation uses these three and when you do cross-building with autoconf you specify the host, not the target. My worry is that if we start using target to mean what GCC users call host then this will confuse people (well, more than they are already confused by the GNU project getting host and target the wrong way around).

Perhaps we could just rename the option -ccc-triple? Neither a -ccc-build-triple nor a -ccc-target-triple (in GCC terminology) would make sense, so specifying host / target here seems redundant, and not specifying anything means that we won't introduce confusion from the what-sane-people-thing and what-gcc-developer-say mismatch.

David

-- Sent from my PDP-11

> Hi,
>
>> Hi,
>>
>> I would like to rename -ccc-host-triple into -ccc-target-triple.
>>
>> The host (that is the machine on which clang is running) cannot be
>> changed, and what this flag does is that it changes the llvm backend
>> clang will use to produce code, that is called the target machine.
>>
>> Does anybody see a reason to keep the old misleading name?
>>
>
> I would like to have some comments on this change:
> ok to commit, or hold on?

I am definitely in favour of less confusing names. It took me a while to understand what these mean. Apparently gcc uses three terms:

- build (for the system building the compiler)
- target (for the system that the compiler is built to run on)
- host (for the system that the code built with the compiler is build to run on)

This is a bit confusing, but unfortunately this terminology also seems to have made its way into the configure scripts. The autoconf documentation uses these three and when you do cross-building with autoconf you specify the host, not the target. My worry is that if we start using target to mean what GCC users call host then this will confuse people (well, more than they are already confused by the GNU project getting host and target the wrong way around).

Perhaps we could just rename the option -ccc-triple? Neither a -ccc-build-triple nor a -ccc-target-triple (in GCC terminology) would make sense, so specifying host / target here seems redundant, and not specifying anything means that we won't introduce confusion from the what-sane-people-thing and what-gcc-developer-say mismatch.

I agree, and this seems consistent with what llc accepts
(-mtriple=<string>). Can we keep the old name as an alias? I have a
bunch of scripts setup to use it as is, and I'd need to change them all
if the old option goes away.

David

-- Sent from my PDP-11

Really? :wink:

-Hal

Hi,

Hi,

I would like to rename -ccc-host-triple into -ccc-target-triple.

The host (that is the machine on which clang is running) cannot be
changed, and what this flag does is that it changes the llvm backend
clang will use to produce code, that is called the target machine.

Does anybody see a reason to keep the old misleading name?

I would like to have some comments on this change:
ok to commit, or hold on?

I am definitely in favour of less confusing names. It took me a while to understand what these mean. Apparently gcc uses three terms:

- build (for the system building the compiler)
- target (for the system that the compiler is built to run on)
- host (for the system that the code built with the compiler is build to run on)

Really?
Can you send out a pointer to the documentation page that you were reading?
I have never seen these definitions for target and host in GCC.
In the autoconf documentation you also have it the other way around,
please read:
http://airs.com/ian/configure/configure_5.html
"The system on which the tools will run is called the host system.
The system for which the tools generate code is called the target system."

This is a bit confusing, but unfortunately this terminology also seems to have made its way into the configure scripts. The autoconf documentation uses these three and when you do cross-building with autoconf you specify the host, not the target. My worry is that if we start using target to mean what GCC users call host then this will confuse people (well, more than they are already confused by the GNU project getting host and target the wrong way around).

Perhaps we could just rename the option -ccc-triple? Neither a -ccc-build-triple nor a -ccc-target-triple (in GCC terminology) would make sense, so specifying host / target here seems redundant, and not specifying anything means that we won't introduce confusion from the what-sane-people-thing and what-gcc-developer-say mismatch.

-ccc-triple is fine with me.

Sebastian

I am definitely in favour of less confusing names. It took me a while to understand what these mean. Apparently gcc uses three terms:

- build (for the system building the compiler)
- target (for the system that the compiler is built to run on)
- host (for the system that the code built with the compiler is build to run on)

Really?
Can you send out a pointer to the documentation page that you were reading?
I have never seen these definitions for target and host in GCC.

Hmm, after double-checking, it seems that this is correct.

In the autoconf documentation you also have it the other way around,
please read:
The GNU configure and build system - Cross Compilation Tools
"The system on which the tools will run is called the host system.
The system for which the tools generate code is called the target system."

Ah, that was where my confusion came from. A lot of things don't generate code, but their configure scripts still seem to use this terminology, so the system that you compile them for when you are cross-compiling is the host system.

-ccc-triple is fine with me.

Anyone object?

David

-ccc-triple is fine with me.

You could expose the -triple cc1 and -triple= flags and have them do what you want? This is ultimately what James and I had talked about doing. If you do expose them please get rid of the -ccc-host-triple flag.

-eric

Hi,

If you keep the "-ccc-" prefix, you're still polishing a turd from my perspective. Setting the target architecture shouldn't be a driver-internal-special option.

We discussed this in the BoF at the conference, and decided on "-target", but "-triple" being an alias for that makes a lot of sense and I like it. I'm still working on the driver redesign - I haven't had a lot of resource to put into it yet but I'm ramping up as of the new year. Patches soon to follow.

Changes like this are simple defaults/naming changes and shouldn't conflict at all with the refactoring I'm doing, so don't worry about treading on my toes :slight_smile:

Cheers,

James

Hi,

If you keep the "-ccc-" prefix, you're still polishing a turd from my perspective. Setting the target architecture shouldn't be a driver-internal-special option.

Agreed.

We discussed this in the BoF at the conference, and decided on "-target", but "-triple" being an alias for that makes a lot of sense and I like it. I'm still working on the driver redesign - I haven't had a lot of resource to put into it yet but I'm ramping up as of the new year. Patches soon to follow.

Yeah, I couldn't remember which we'd decided on. I believe it ended up being -target because we'd like to someday allow things that don't look like gnu target triples :slight_smile:

-eric

...

I am definitely in favour of less confusing names. It took me a while to understand what these mean. Apparently gcc uses three terms:

- build (for the system building the compiler)
- target (for the system that the compiler is built to run on)
- host (for the system that the code built with the compiler is build to run on)

No, in autoconf terms, "target" has always meant: the system where the
code produced by the binutils/compiler will run. The "host" is the
system which runs the binutils/compiler programs themselves.

Of course, for programs that do not produce any executable code, for
instance GNU diffutils, "host" and "target" as above have no meaning,
and are often interchanged randomly. For these, I guess "target" makes
the most sense for many people, but speaking strictly in autoconf terms,
it should be "host", as that is where the programs themselves run.

That said, for clang, it doesn't seem a canadian cross is supported, so
we could only use the "build" and "target" terms, to reduce confusion.

Thanks all for your suggestions. See attached the revised patch.
Tested on amd64-linux with make check, and started the nightly test.

I decided to leave -ccc-host-triple as an alias of -target.
Where should I document that -ccc-host-triple is deprecated?

Ok to commit with some more documentation changes?

Thanks,
Sebastian

0001-rename-ccc-host-triple-into-target.patch (92.2 KB)

We build a canadian cross all the time.

deep