Does DragonEgg support parameters like -fno-builtin in clang?

Hi,

I have been using clang for quite a while, and I can use clang -fno-builtin hello.c to prevent the generation of llvm built-in functions, such as llvm.memset. Recently, I switched to gcc with DragonEgg, since the program to be built is originally designed to be compiled with gcc. I searched on the web, but did not find any information about how to set DragonEgg parameters. Could anyone please give me some help? Thanks in advance!

Dragonegg is a GCC plugin, I think you can just pass "-fno-builtin"
[1] to gcc. Doesn't it work?

[1]
http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Option-Summary.html#Option-Summary

Regards,
chenwj

Hi Jeff,

I have been using clang for quite a while, and I can use `clang -fno-builtin
hello.c` to prevent the generation of llvm built-in functions, such as
llvm.memset. Recently, I switched to gcc with DragonEgg, since the program to be
built is originally designed to be compiled with gcc. I searched on the web, but
did not find any information about how to set DragonEgg parameters. Could anyone
please give me some help? Thanks in advance!

dragonegg just uses the same parameters as gcc. However -fno-builtin has no
effect (this is a bug) because it is surprisingly tricky to get the appropriate
information from inside gcc. To be more precise: it's not too hard to set up
something that works OK for C, but then it works poorly for Fortran and Ada. I
didn't yet come up with a scheme that works well for all languages.

Ciao, Duncan.

Hi chenwj,

Thanks! I have tried it, but the generated byte code still uses llvm.memset. I guess the flag -fno-builtin is not used by DragonEgg, or I missed some other

configuration parameters.

Hi,

I have figured out a way to achieve similar effects.

gcc -S -c -O0 -fplugin=$(DRAGONEGG_SO) -fplugin-arg-dragonegg-emit-ir hello.c -o hello.bc

opt -O3 -disable-simplify-libcalls hello.bc -o hello.bc

I guess "-fno-built-in" does not prevent dragonegg emitting "llvm"
builtin. Nice try. :slight_smile:

Cheers,
chenwj