compiler-explorer: `-flto` does not work with LDC

The cmdline option -flto=thin (or -flto=full) does not work with LDC. https://godbolt.org/g/YokGlg

LDC searches for the required LLVMgold.so plugin in the path and in LDC’s own path. LLVMgold.so has to match or be newer than the LLVM version used to build LDC, so that can become a problem. When LLVM is built with the correct option to build LLVMgold.so, LDC will copy it to its own installation and rename it to include “ldc” in the name and it will take priority over a potential LLVMgold.so in the system path.

The current image downloads the release package of LDC, and these unfortunately don’t include LLVMgold.so (because of potential system incompatibilities…).

Don’t know what would be a good solution here, other than building LLVM+LDC from scratch…

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 33 (33 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @JohanEngelen - just an apology that I haven’t looked in to this still. I know it’s low priority…but…no progress at all is pretty bad! Sorry 😦

I haven’t pushed the fix yet; sorry. Have pushed it now and fixed some other bits and am re-running 😃

On Thu, Jun 15, 2017 at 2:04 PM Johan Engelen notifications@github.com wrote:

I am a total docker beginner, but if I run docker pull mattgodbolt/clang-builder and then docker run -it mattgodbolt/clang-builder again, the typo $ is still there in build-ldc.sh.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/mattgodbolt/compiler-explorer/issues/438#issuecomment-308837465, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmsdb0rv8LnoHWESoVMqv1_mOWmQ9zUks5sEYAggaJpZM4NkZs1 .

Building LDC is easy. I’ll have a closer look at the clang build script and try to come up with one for LDC. I see the clang script already contains stuff to build the LTO plugin 😃