Generating multiple binaries from a single source file

David Edelsohn dje.gcc@gmail.com
Sun Sep 1 13:00:00 GMT 2013


On Sat, Aug 31, 2013 at 11:57 PM, Rodolfo Guilherme Wottrich
<rgwott@gmail.com> wrote:
> Hello everyone,
>
> I would like to be able to generate multiple binaries from a single
> source file, each of which being slightly different from the other(s).
> For example, in case there's an OpenMP parallel region in the code, I
> want to generate two binaries: one of them being the normal one and
> the other one ignoring the parallel region, just like if the -fopenmp
> flag hadn't been used.
> This isn't exactly a good example, because I could just write a script
> to compile the source file twice, with and without the flag. But the
> manipulation I want to do with the code is something else.
>
> How do you guys suggest me to do it? It occurs to me that I may simply
> implement a new flag to perform a different behavior and compile the
> code twice, but looking at the code, I found it somehow difficult to
> do. Also, there may be some more clever way to do it.
>
> However, if you guys think that the flag thing is the best way to do
> it, please let me know and help me, telling how to implement that new
> flag (I can't figure out how to).

This sounds a little like Target specific function optimizations.

http://gcc.gnu.org/wiki/FunctionSpecificOpt

- David



More information about the Gcc mailing list