[PATCH] D62315: [compiler-rt][crt] Pass -fno-lto in check_cxx_section_exists

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 09:02:15 PDT 2019

hans marked an inline comment as done.
hans added a comment.

In D62315#1513898 <https://reviews.llvm.org/D62315#1513898>, @thakis wrote:

> This lgtm, but it suggests there's no upstream bot building llvm with lto, and running tests with it. I'm not sure I want to be in the business of owning test coverage for that config -- should we have an LTO bot on the llvm buildbot master?

As Bob pointed out on the Chromium bug, there is http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu but that doesn't include compiler-rt. It's Sony's bot. I'll ask if they want to include compiler-rt.

Comment at: compiler-rt/lib/crt/CMakeLists.txt:22
+  append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto try_compile_flags)
phosek wrote:
> I believe this should be done on line 79 as `append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto CRT_CFLAGS)`, `try_compile_flags` is only used to test whether the compiler supports `.init/.fini` section but doesn't change flags used to compile `crtbegin.o`/`crtend.o`.
We're already building crtbegin.o/crtend.o with -fno-lto -- I think it gets appended to all runtime build targets at some point.

It's really the "check whether .init/.fini is support" part I'm going after here, because that doesn't build with the normal compiler-rt flags, and so it doesn't work in thin-lto builds.



More information about the llvm-commits mailing list