[cfe-dev] Question about LTO pass driver level flags to the plugin

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Aug 23 14:07:52 PDT 2013


I think Bill's work on extending function attributes should fix this
at some point. The idea is that when building a file with, for
example, -mno-sse or -march=core2 the IL functions would get an
attribute equivalent to those options.

That way you can even have files that use sse and files that don't
LTOed together.

Bill, is that the case?

On 23 August 2013 04:47, Zakk <zakk0610 at gmail.com> wrote:
> 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.
> --
> Best regards,
> Kuan-Hsu Chen
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list