Re: [ccache] How to support another compiler?

2011-12-01 Thread Paul Lamb
Hi Yang Zhou,

Zhou, Yang  Polycom.com> writes:

> Thanks for help. I'm using cl6x from Texas Instruments, it's used for TI C6000
DSPs.
> 

I am also using the TI compiler. I am looking at using ccache with this 
compiler but it is annoyingly unlike gcc :-(.

Here are some key differences which makes it incompatible with ccache as it 
stands.

1. It doesn't support -E for preprocessing. Instead it uses -ppo.
2. When it preprocesses (using -ppo) it doesn't output to stdout as gcc does 
but instead outputs to a .pp file. By default this is in the current directory
(or somewhere else if you use the --pp_directory option as well) 
3. ccache assumes that the output file is named with the -o  option.
The TI compiler uses -fe  for this purpose.

I had a go at writing a wrapper which could sit between ccache and the TI
compiler doing the relevant option conversion but had to shelve this due to
particular issues unique to my environment (including backward compatibility
with a complex make system; all sorts of issues with quoting and escaping of
command line options, some of which contained spaces; and difficulty getting 
the preprocessed output to stdout). These issues are all probably solvable 
given enough time but I think that modifying ccache itself is probably a much 
better solution.

> 
> -Original Message-
> From: martinpool  gmail.com [mailto:martinpool  gmail.com] On Behalf
Of Martin Pool
> Sent: Friday, November 18, 2011 11:48 AM
> To: Zhou, Yang
> Cc: ccache  lists.samba.org
> Subject: Re: [ccache] How to support another compiler?
> 
> On 18 November 2011 14:34, Zhou, Yang  polycom.com> wrote:
> > Hi all,
> >
> > I want to use ccache to optimize the compilation of my project. However,
another compiler(not gcc) is used
> for the compilation. The compiler options are different from those of gcc. But
I think the compilation
> process should be similar.
> > I tried to compile with ccache, from the log, every time the manifest file
can't be found, and can't find the
> object file in manifest. After that, preprocessor runs, and got object file
hash from preprocessor, but
> the object file is not in cache.
> 
> > So the real compiler runs every time.
> > Seems the results of real compilation are not stored into the cache.
> 
> If the command line arguments are different that's not surprising.
> 
> > Do you think it's possible to change ccache source code to support the my
compiler?
> 
> Yes.
> 
> > If possible, which part of code should be updated? Thanks a lot!
> 
> The parts that deal with compiler argument parsing.
> 
> Probably you will want to introduce an object layer that describes
> different compilers, and an environment variable to switch between
> them.
> 
> What's the other compiler you are using?
> 
> m
> 

I would be very interested if we can modify ccache itself to work with this
compiler. How are you getting on with this? Is there any way I can help move
this forward and avoid duplication of effort?

p.



___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] How to support another compiler?

2011-11-17 Thread Martin Pool
Hi, Yang Zhou,

If you get this working, or even just a start towards it, please post
the patch here and hopefully we can integrate it to help others.

Regards,
Martin

On 18 November 2011 14:52, Zhou, Yang  wrote:
> Hi Martin,
>
> Thanks for help. I'm using cl6x from Texas Instruments, it's used for TI 
> C6000 DSPs.
>
> Best Regards,
> Yang Zhou
>
> -Original Message-
> From: martinp...@gmail.com [mailto:martinp...@gmail.com] On Behalf Of Martin 
> Pool
> Sent: Friday, November 18, 2011 11:48 AM
> To: Zhou, Yang
> Cc: ccache@lists.samba.org
> Subject: Re: [ccache] How to support another compiler?
>
> On 18 November 2011 14:34, Zhou, Yang  wrote:
>> Hi all,
>>
>> I want to use ccache to optimize the compilation of my project. However, 
>> another compiler(not gcc) is used for the compilation. The compiler options 
>> are different from those of gcc. But I think the compilation process should 
>> be similar.
>> I tried to compile with ccache, from the log, every time the manifest file 
>> can't be found, and can't find the object file in manifest. After that, 
>> preprocessor runs, and got object file hash from preprocessor, but the 
>> object file is not in cache.
>
>> So the real compiler runs every time.
>> Seems the results of real compilation are not stored into the cache.
>
> If the command line arguments are different that's not surprising.
>
>> Do you think it's possible to change ccache source code to support the my 
>> compiler?
>
> Yes.
>
>> If possible, which part of code should be updated? Thanks a lot!
>
> The parts that deal with compiler argument parsing.
>
> Probably you will want to introduce an object layer that describes
> different compilers, and an environment variable to switch between
> them.
>
> What's the other compiler you are using?
>
> m
> ___
> ccache mailing list
> ccache@lists.samba.org
> https://lists.samba.org/mailman/listinfo/ccache
>
>



-- 
Martin
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] How to support another compiler?

2011-11-17 Thread Zhou, Yang
Hi Martin,

Thanks for help. I'm using cl6x from Texas Instruments, it's used for TI C6000 
DSPs.

Best Regards,
Yang Zhou

-Original Message-
From: martinp...@gmail.com [mailto:martinp...@gmail.com] On Behalf Of Martin 
Pool
Sent: Friday, November 18, 2011 11:48 AM
To: Zhou, Yang
Cc: ccache@lists.samba.org
Subject: Re: [ccache] How to support another compiler?

On 18 November 2011 14:34, Zhou, Yang  wrote:
> Hi all,
>
> I want to use ccache to optimize the compilation of my project. However, 
> another compiler(not gcc) is used for the compilation. The compiler options 
> are different from those of gcc. But I think the compilation process should 
> be similar.
> I tried to compile with ccache, from the log, every time the manifest file 
> can't be found, and can't find the object file in manifest. After that, 
> preprocessor runs, and got object file hash from preprocessor, but the object 
> file is not in cache.

> So the real compiler runs every time.
> Seems the results of real compilation are not stored into the cache.

If the command line arguments are different that's not surprising.

> Do you think it's possible to change ccache source code to support the my 
> compiler?

Yes.

> If possible, which part of code should be updated? Thanks a lot!

The parts that deal with compiler argument parsing.

Probably you will want to introduce an object layer that describes
different compilers, and an environment variable to switch between
them.

What's the other compiler you are using?

m
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] How to support another compiler?

2011-11-17 Thread Martin Pool
On 18 November 2011 14:34, Zhou, Yang  wrote:
> Hi all,
>
> I want to use ccache to optimize the compilation of my project. However, 
> another compiler(not gcc) is used for the compilation. The compiler options 
> are different from those of gcc. But I think the compilation process should 
> be similar.
> I tried to compile with ccache, from the log, every time the manifest file 
> can't be found, and can't find the object file in manifest. After that, 
> preprocessor runs, and got object file hash from preprocessor, but the object 
> file is not in cache.

> So the real compiler runs every time.
> Seems the results of real compilation are not stored into the cache.

If the command line arguments are different that's not surprising.

> Do you think it's possible to change ccache source code to support the my 
> compiler?

Yes.

> If possible, which part of code should be updated? Thanks a lot!

The parts that deal with compiler argument parsing.

Probably you will want to introduce an object layer that describes
different compilers, and an environment variable to switch between
them.

What's the other compiler you are using?

m
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] How to support another compiler?

2011-11-17 Thread Zhou, Yang
Hi all,

I want to use ccache to optimize the compilation of my project. However, 
another compiler(not gcc) is used for the compilation. The compiler options are 
different from those of gcc. But I think the compilation process should be 
similar.
I tried to compile with ccache, from the log, every time the manifest file 
can't be found, and can't find the object file in manifest. After that, 
preprocessor runs, and got object file hash from preprocessor, but the object 
file is not in cache.
So the real compiler runs every time.
Seems the results of real compilation are not stored into the cache.
Do you think it's possible to change ccache source code to support the my 
compiler? If possible, which part of code should be updated? Thanks a lot!

Best Regards,
Yang

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache