[compiler-rt] r317728 - [ThinLTO] New test needs to require LTO

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 9 11:46:18 PST 2017


On Thu, Nov 9, 2017 at 10:56 AM, Roman Lebedev <lebedev.ri at gmail.com> wrote:

> On Thu, Nov 9, 2017 at 9:54 PM, Teresa Johnson via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>>
>>
>> On Thu, Nov 9, 2017 at 10:14 AM, Evgenii Stepanov <
>> eugeni.stepanov at gmail.com> wrote:
>>
>>> It's failing on my desktop right now, because BFD is the default linker
>>> and there is nothing on the test run line to use gold or lld. I believe
>>> this is a common configuration.
>>>
>>
>> It sounds like the best path forward is to revert this new test, then add
>> it again after
>>
>
Reverted it for now.


>
>
>> adding support to test/asan/lit.cfg to use lto_flags.
>>
> I *think* this is roughly the direction in which https://reviews.llvm.
> org/D39508 is moving.
>

I tried the same approach used currently in test/profile/lit.cfg (see
below), with a corresponding change to use the new %clangxx_lto_asan
command in the test. The downside is that I still have to specify
-flto=thin on the command line in the test since that option is only
enabled when config.use_thinlto is enabled. Is there a way to enable that
just for a single command?


 diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg
index 6a4044a44..6f46029bb 100644
--- a/test/asan/lit.cfg
+++ b/test/asan/lit.cfg
@@ -95,13 +95,20 @@ if platform.system() == 'Windows':
     win_runtime_feature = "win32-static-asan"
   config.available_features.add(win_runtime_feature)

-def build_invocation(compile_flags):
-  return " " + " ".join([config.compile_wrapper, config.clang] +
compile_flags) + " "
+def build_invocation(compile_flags, with_lto = False):
+  lto_flags = []
+  lto_prefix = []
+  if with_lto and config.lto_supported:
+    lto_flags += config.lto_flags
+    lto_prefix += config.lto_launch
+  return " " + " ".join(lto_prefix + [config.compile_wrapper,
config.clang] + lto_flags + compile_flags) + " "

 config.substitutions.append( ("%clang ", build_invocation(target_cflags)) )
 config.substitutions.append( ("%clangxx ",
build_invocation(target_cxxflags)) )
 config.substitutions.append( ("%clang_asan ",
build_invocation(clang_asan_cflags)) )
 config.substitutions.append( ("%clangxx_asan ",
build_invocation(clang_asan_cxxflags)) )
+config.substitutions.append( ("%clang_lto_asan ",
build_invocation(clang_asan_cflags, True)) )
+config.substitutions.append( ("%clangxx_lto_asan ",
build_invocation(clang_asan_cxxflags, True)) )
 config.substitutions.append( ("%shared_libasan", "libclang_rt.asan-%s.so"
% config.target_arch))
 if config.asan_dynamic:
   config.substitutions.append( ("%clang_asan_static ",
build_invocation(clang_asan_static_cflags)) )




>
>> I can then move it back to the OS-independent directory.
>>
>>
>>>
>>> On Wed, Nov 8, 2017 at 6:16 PM, Teresa Johnson <tejohnson at google.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Wed, Nov 8, 2017 at 2:49 PM, Evgenii Stepanov <
>>>> eugeni.stepanov at gmail.com> wrote:
>>>>
>>>>> See config.lto_flags and tests/cfi/lit.cfg
>>>>>
>>>>> On Wed, Nov 8, 2017 at 2:47 PM, Evgenii Stepanov
>>>>> <eugeni.stepanov at gmail.com> wrote:
>>>>> > This also needs -fuse-ld=gold, at least.
>>>>>
>>>>
>>>> All the bots that were failing are now succeeding after adding the
>>>> REQUIRES. It would work with lld as well.
>>>>
>>>>
>>>>
>>>>> >
>>>>> > On Wed, Nov 8, 2017 at 1:48 PM, Teresa Johnson via llvm-commits
>>>>> > <llvm-commits at lists.llvm.org> wrote:
>>>>> >> Author: tejohnson
>>>>> >> Date: Wed Nov  8 13:48:27 2017
>>>>> >> New Revision: 317728
>>>>> >>
>>>>> >> URL: http://llvm.org/viewvc/llvm-project?rev=317728&view=rev
>>>>> >> Log:
>>>>> >> [ThinLTO] New test needs to require LTO
>>>>> >>
>>>>> >> Fix buildbot failures:
>>>>> >> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/bui
>>>>> lds/5262/steps/annotate/logs/stdio
>>>>> >>
>>>>> >> Modified:
>>>>> >>     compiler-rt/trunk/test/asan/TestCases/Linux/contiguous_cont
>>>>> ainer_crash_thinlto.cc
>>>>> >>
>>>>> >> Modified: compiler-rt/trunk/test/asan/Te
>>>>> stCases/Linux/contiguous_container_crash_thinlto.cc
>>>>> >> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/a
>>>>> san/TestCases/Linux/contiguous_container_crash_thinlto.cc?re
>>>>> v=317728&r1=317727&r2=317728&view=diff
>>>>> >> ============================================================
>>>>> ==================
>>>>> >> --- compiler-rt/trunk/test/asan/TestCases/Linux/contiguous_container_crash_thinlto.cc
>>>>> (original)
>>>>> >> +++ compiler-rt/trunk/test/asan/TestCases/Linux/contiguous_container_crash_thinlto.cc
>>>>> Wed Nov  8 13:48:27 2017
>>>>> >> @@ -6,6 +6,8 @@
>>>>> >>  //
>>>>> >>  // Test crash due to __sanitizer_annotate_contiguous_container.
>>>>> >>
>>>>> >> +// REQUIRES: lto
>>>>> >> +
>>>>> >>  #include <assert.h>
>>>>> >>  #include <string.h>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> _______________________________________________
>>>>> >> llvm-commits mailing list
>>>>> >> llvm-commits at lists.llvm.org
>>>>> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Teresa Johnson |  Software Engineer |  tejohnson at google.com |
>>>> 408-460-2413 <(408)%20460-2413>
>>>>
>>>
>>>
>>
>>
>> --
>> Teresa Johnson |  Software Engineer |  tejohnson at google.com |
>> 408-460-2413 <(408)%20460-2413>
>>
> Roman.
>
> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>>
>


-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171109/f48923bd/attachment.html>


More information about the llvm-commits mailing list