[cfe-dev] -cc1 and -m64 incompatible?

Douglas Gregor dgregor at apple.com
Tue Jan 19 16:18:41 PST 2010


On Jan 19, 2010, at 4:11 PM, Zhanyong Wan (λx.x x) wrote:

> Thanks for the quick replay, Doug.
> 
> 2010/1/19 Douglas Gregor <dgregor at apple.com>:
>> 
>> On Jan 19, 2010, at 3:29 PM, Zhanyong Wan (λx.x x) wrote:
>> 
>>> Hi,
>>> 
>>> This command works:
>>> 
>>>  $ clang -cc1 t.cc
>>> 
>>> So does this:
>>> 
>>>  $ clang -m64 t.cc
>>> 
>>> However, it doesn't work when both -cc1 and -m64 are specified:
>>> 
>>>  $ clang -cc1 -m64 t.cc
>>>  error: unknown argument: '-m64'
>>>  $ clang -m64 -cc1 t.cc
>>>  gcc: unrecognized option '-cc1'
>>>  gcc: unrecognized option '-cc1'
>>> 
>>> Is this expected?  How do I run the front-end in 64-bit mode?
>> 
>> If you need to use -cc1 (which is very much an implementation detail), pass it the appropriate triple with -triple foo-bar-baz. Check out what the driver passes for the triple with, e.g.,
>> 
>>        clang -m64 t.cc -###
>> 
>> 
>>> Also, neither -cc1 nor -m64 is mentioned in 'clang --help' or
>>> http://clang.llvm.org/docs/UsersManual.html.
>> 
>> -cc1 is an implementation detail, so it shouldn't be part of the user manual. -m64, on the other hand, should be mentioned somewhere.
> 
> So should we remove -cc1 from http://clang.llvm.org/get_started.html ?


Hmm... it's only there for pretty-printing. I guess the right thing to do would be to expose -ast-print through the driver somehow, if we actually want to suggest that people use it as part of "Getting Started".

	- Doug





More information about the cfe-dev mailing list