Interoperability between Clang, GCC and LTO

帅比萌擦擦* 提交于 2020-01-14 16:46:26

问题


I know that Clang and GCC are more or less compatible C/C++ compilers as long as one takes care of things like architecture flags, predefines and linking the right libraries. Creating libraries with one compiler and linking them with objects created by the other is actually pretty easy (at least on x86).

Here is a little test project doing exactly that: https://gitlab.com/higaski/Interoperability

I was wondering however if Link Time Optimization (LTO) could somehow work across compilers? I know that LTO requires some form of intermediate representation like LLVMs bitcode or GCCs GIMPLE but maybe there is a workflow in which both of them could be utilized?


回答1:


No, LTO can not be shared across compilers, precisely because it's effectively a dump of compiler's internal representation. Such representation is unstable even across releases of the same compiler.



来源:https://stackoverflow.com/questions/51259340/interoperability-between-clang-gcc-and-lto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!