-cc1 and -m64 incompatible?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

-cc1 and -m64 incompatible?

Zhanyong Wan (λx.x x)
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?

Also, neither -cc1 nor -m64 is mentioned in 'clang --help' or
http://clang.llvm.org/docs/UsersManual.html.  Is there a definitive
guide on clang's command line flags?  Many thanks,

--
Zhanyong
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: -cc1 and -m64 incompatible?

Douglas Gregor

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.

>  Is there a definitive
> guide on clang's command line flags?  Many thanks,


Just the source. We'd love to enhance the source to contain documentation strings, so that we could automatically generate a reference manual for Clang's command-line flags... but nobody's done the work.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: -cc1 and -m64 incompatible?

Zhanyong Wan (λx.x x)
Thanks for the quick replay, Doug.

2010/1/19 Douglas Gregor <[hidden email]>:

>
> 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 ?

>
>>  Is there a definitive
>> guide on clang's command line flags?  Many thanks,
>
>
> Just the source. We'd love to enhance the source to contain documentation strings, so that we could automatically generate a reference manual for Clang's command-line flags... but nobody's done the work.

Got it.  Thanks!

>
>        - Doug



--
Zhanyong

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: -cc1 and -m64 incompatible?

Douglas Gregor

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 <[hidden email]>:
>>
>> 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


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

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

Daniel Dunbar
I plan to write better documentation of the clang / -cc1 split for
developers at some point (definitely by 2.7, perhaps sooner). Feel
free to nag me.

As far as exposing the additional clang features at a nicer level, I
think it would probably make sense to do this via a different tool
(not clang), which implements a driver-like interface, but is designed
for targeting additional clang tools. That way we don't need to worry
about the syntax of the command line arguments and how they impact
clang/gcc. Something like:
--
$ clang-tool --action=ast-print ... the usual set of driver arguments ...
--

 - Daniel

2010/1/19 Douglas Gregor <[hidden email]>:

>
> 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 <[hidden email]>:
>>>
>>> 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
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

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

Sean Hunt
2010/1/21 Daniel Dunbar <[hidden email]>:

> I plan to write better documentation of the clang / -cc1 split for
> developers at some point (definitely by 2.7, perhaps sooner). Feel
> free to nag me.
>
> As far as exposing the additional clang features at a nicer level, I
> think it would probably make sense to do this via a different tool
> (not clang), which implements a driver-like interface, but is designed
> for targeting additional clang tools. That way we don't need to worry
> about the syntax of the command line arguments and how they impact
> clang/gcc. Something like:
> --
> $ clang-tool --action=ast-print ... the usual set of driver arguments ...
> --
>
>  - Daniel

I for one would love to see this; I sometimes consider it to be a bit
of a misfeature that we support options exactly the way GCC does. In
my opinion, it might be nice to make the 'clang' driver have options
that we've worked out and then have a 'clang -gcc' driver for
compatibility, or something similar.

Sean

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev