Hi all,
I often meet the problem cause by Link::ConstructJob does not pass
driver level flags relevant to LTO code generation down to the plugin.
So when I compile program like:
clang -c a.c -o a.o -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -flto
clang -c main.c -o main.o -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3
clang a.o main.o -o main -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=vfpv3 -flto
I will got error like:
ld: error: lto-llvm.o-SchABH uses VFP register arguments, output does not
So I need to modify Link::ConstructJob to pass “-plugin-opt=-float-abi=hard” and vfpv3 feature to the plugin.
It’s tedious because some option may be missed in LTO code generation.
For example when I add a new option to llc, and add the same one in clang,
I also need to modify Link::ConstructJob to pass this option to plugin…
Is there a more general solution?
Thanks.