The gold plugin supports many of the backend options. But Clang doesn't pass all of them to the plugin as it does to the backend. For example, to support -emulated-tls with LTO, Clang needs to pass -emulated-tls to the LTO backend. Shall I just change the driver to add -plugin-opt=-emulated-tls or is the best practice to embed this in the IR? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170907/d8850b93/attachment.html>
I think that particular option would need to be embedded in the IR. In general, if an option is normally passed only at compile time, it would need to have some representation in the IR. Peter On Thu, Sep 7, 2017 at 10:53 AM, Pirama Arumuga Nainar via llvm-dev < llvm-dev at lists.llvm.org> wrote:> The gold plugin supports many of the backend options. But Clang doesn't > pass all of them to the plugin as it does to the backend. > > For example, to support -emulated-tls with LTO, Clang needs to pass > -emulated-tls to the LTO backend. Shall I just change the driver to add > -plugin-opt=-emulated-tls or is the best practice to embed this in the IR? > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-- -- Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170907/49687b31/attachment.html>
-emulated-tls is particularly interesting for LTO because it is automatically set by the fronted during compilation for Android and OpenBSD (see clang lib/Driver/ToolChains/Clang.cpp). At the very least, perhaps this can be set in tools::AddGoldPlugin as well to keep the same default behavior under LTO? - stephen On Thu, Sep 7, 2017 at 11:36 AM, Peter Collingbourne via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I think that particular option would need to be embedded in the IR. In > general, if an option is normally passed only at compile time, it would need > to have some representation in the IR. > > Peter > > On Thu, Sep 7, 2017 at 10:53 AM, Pirama Arumuga Nainar via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> >> The gold plugin supports many of the backend options. But Clang doesn't >> pass all of them to the plugin as it does to the backend. >> >> For example, to support -emulated-tls with LTO, Clang needs to pass >> -emulated-tls to the LTO backend. Shall I just change the driver to add >> -plugin-opt=-emulated-tls or is the best practice to embed this in the IR? >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > > > -- > -- > Peter > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
Maybe Matching Threads
- lld + ThinLTO + fprofile-generate causes duplicate symbol errors
- lld + ThinLTO + fprofile-generate causes duplicate symbol errors
- lld + ThinLTO + fprofile-generate causes duplicate symbol errors
- lld + ThinLTO + fprofile-generate causes duplicate symbol errors
- lld + ThinLTO + fprofile-generate causes duplicate symbol errors