<div dir="ltr"><div>Yuri says this is causing other related problems: </div><a href="https://code.google.com/p/address-sanitizer/issues/detail?id=308">https://code.google.com/p/address-sanitizer/issues/detail?id=308</a><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 1, 2014 at 8:45 PM, Greg Fitzgerald <span dir="ltr"><<a href="mailto:garious@gmail.com" target="_blank">garious@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Will fix.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Greg<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, May 1, 2014 at 8:23 AM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
> This change breaks asan testing on x86_64 linux.<br>
> The newly failing test is<br>
> projects/compiler-rt/test/asan/TestCases/Linux/kernel-area.cc<br>
> It has this line:<br>
> // REQUIRES: asan-32-bits<br>
> Apparently after this change this line is not honored any more and the test<br>
> runs in 64-bit, where it is not supposed to be run.<br>
><br>
> Please fix.<br>
><br>
> --kcc<br>
><br>
><br>
> On Thu, May 1, 2014 at 1:32 AM, Greg Fitzgerald <<a href="mailto:gregf@codeaurora.org">gregf@codeaurora.org</a>><br>
> wrote:<br>
>><br>
>> Author: garious<br>
>> Date: Wed Apr 30 16:32:30 2014<br>
>> New Revision: 207707<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=207707&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=207707&view=rev</a><br>
>> Log:<br>
>> Allow any test to be executed via a %run command.<br>
>><br>
>> Configure %run with COMPILER_RT_EMULATOR:<br>
>><br>
>>   $ cmake -DCOMPILER_RT_EMULATOR="qemu-arm -L $SYSROOT"<br>
>><br>
>> Modified:<br>
>>     compiler-rt/trunk/test/asan/CMakeLists.txt<br>
>>     compiler-rt/trunk/test/asan/lit.cfg<br>
>>     compiler-rt/trunk/test/asan/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>>     compiler-rt/trunk/test/lit.common.cfg<br>
>>     compiler-rt/trunk/test/<a href="http://lit.common.configured.in" target="_blank">lit.common.configured.in</a><br>
>>     compiler-rt/trunk/test/lsan/lit.common.cfg<br>
>>     compiler-rt/trunk/test/profile/instrprof-basic.c<br>
>>     compiler-rt/trunk/test/profile/lit.cfg<br>
>>     compiler-rt/trunk/test/ubsan/lit.common.cfg<br>
>><br>
>> Modified: compiler-rt/trunk/test/asan/CMakeLists.txt<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/CMakeLists.txt?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/CMakeLists.txt?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/asan/CMakeLists.txt (original)<br>
>> +++ compiler-rt/trunk/test/asan/CMakeLists.txt Wed Apr 30 16:32:30 2014<br>
>> @@ -9,7 +9,7 @@ if(CAN_TARGET_arm_android)<br>
>>    get_filename_component(ASAN_TEST_LLVM_TOOLS_DIR ${CMAKE_C_COMPILER}<br>
>> PATH)<br>
>>    set(ASAN_TEST_CONFIG_SUFFIX "-arm-android")<br>
>>    set(ASAN_TEST_BITS "32")<br>
>> -  get_target_flags_for_arch(arm_android ASAN_TEST_TARGET_CFLAGS)<br>
>> +  get_target_flags_for_arch(arm_android COMPILER_RT_TEST_COMPILER_CFLAGS)<br>
>>    configure_lit_site_cfg(<br>
>>      ${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>>      ${CMAKE_CURRENT_BINARY_DIR}/ARMAndroidConfig/lit.site.cfg<br>
>> @@ -17,10 +17,24 @@ if(CAN_TARGET_arm_android)<br>
>>    list(APPEND ASAN_TESTSUITES<br>
>> ${CMAKE_CURRENT_BINARY_DIR}/ARMAndroidConfig)<br>
>>  endif()<br>
>><br>
>> +if(CAN_TARGET_arm)<br>
>> +  # This is only true if we are cross-compiling.<br>
>> +  # Build all tests with host compiler and use host tools.<br>
>> +  set(ASAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})<br>
>> +  set(ASAN_TEST_CONFIG_SUFFIX "-arm-linux")<br>
>> +  set(ASAN_TEST_BITS "32")<br>
>> +  set(ASAN_TEST_DYNAMIC False)<br>
>> +  configure_lit_site_cfg(<br>
>> +    ${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>> +    ${CMAKE_CURRENT_BINARY_DIR}/ARMLinuxConfig/lit.site.cfg<br>
>> +    )<br>
>> +  list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/ARMLinuxConfig)<br>
>> +endif()<br>
>> +<br>
>>  if(CAN_TARGET_x86_64 OR CAN_TARGET_powerpc64)<br>
>>    set(ASAN_TEST_CONFIG_SUFFIX "64")<br>
>>    set(ASAN_TEST_BITS "64")<br>
>> -  set(ASAN_TEST_TARGET_CFLAGS ${TARGET_64_BIT_CFLAGS})<br>
>> +  set(COMPILER_RT_TEST_COMPILER_CFLAGS ${TARGET_64_BIT_CFLAGS})<br>
>>    set(ASAN_TEST_DYNAMIC False)<br>
>>    configure_lit_site_cfg(<br>
>>      ${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>> @@ -40,7 +54,7 @@ endif()<br>
>>  if(CAN_TARGET_i386)<br>
>>    set(ASAN_TEST_CONFIG_SUFFIX "32")<br>
>>    set(ASAN_TEST_BITS "32")<br>
>> -  set(ASAN_TEST_TARGET_CFLAGS ${TARGET_32_BIT_CFLAGS})<br>
>> +  set(COMPILER_RT_TEST_COMPILER_CFLAGS ${TARGET_32_BIT_CFLAGS})<br>
>>    set(ASAN_TEST_DYNAMIC False)<br>
>>    set(ASAN_TEST_TARGET_ARCH "i386")<br>
>>    configure_lit_site_cfg(<br>
>><br>
>> Modified: compiler-rt/trunk/test/asan/lit.cfg<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.cfg?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.cfg?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/asan/lit.cfg (original)<br>
>> +++ compiler-rt/trunk/test/asan/lit.cfg Wed Apr 30 16:32:30 2014<br>
>> @@ -4,7 +4,7 @@ import os<br>
>><br>
>>  def get_required_attr(config, attr_name):<br>
>>    attr_value = getattr(config, attr_name, None)<br>
>> -  if not attr_value:<br>
>> +  if attr_value == None:<br>
>>      lit_config.fatal(<br>
>>        "No attribute %r in test configuration! You may need to run "<br>
>>        "tests from your build directory or add this attribute "<br>
>><br>
>> Modified: compiler-rt/trunk/test/asan/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a><br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.site.cfg.in?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.site.cfg.in?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/asan/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a> (original)<br>
>> +++ compiler-rt/trunk/test/asan/<a href="http://lit.site.cfg.in" target="_blank">lit.site.cfg.in</a> Wed Apr 30 16:32:30 2014<br>
>> @@ -4,7 +4,6 @@<br>
>>  # Tool-specific config options.<br>
>>  config.name_suffix = "@ASAN_TEST_CONFIG_SUFFIX@"<br>
>>  config.asan_lit_source_dir = "@ASAN_LIT_SOURCE_DIR@"<br>
>> -config.target_cflags = "@ASAN_TEST_TARGET_CFLAGS@"<br>
>>  config.clang = "@ASAN_TEST_TARGET_CC@"<br>
>>  config.llvm_tools_dir = "@ASAN_TEST_LLVM_TOOLS_DIR@"<br>
>>  config.bits = "@ASAN_TEST_BITS@"<br>
>><br>
>> Modified: compiler-rt/trunk/test/lit.common.cfg<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/lit.common.cfg (original)<br>
>> +++ compiler-rt/trunk/test/lit.common.cfg Wed Apr 30 16:32:30 2014<br>
>> @@ -56,6 +56,9 @@ config.substitutions.append(<br>
>>      (' clang', """\n\n*** Do not use 'clangXXX' in tests,<br>
>>       instead define '%clangXXX' substitution in lit config. ***\n\n""") )<br>
>><br>
>> +# Allow tests to be executed on a simulator or remotely.<br>
>> +config.substitutions.append( ('%run', config.emulator) )<br>
>> +<br>
>>  # Add supported compiler_rt architectures to a list of available<br>
>> features.<br>
>>  compiler_rt_arch = getattr(config, 'compiler_rt_arch', None)<br>
>>  if compiler_rt_arch:<br>
>><br>
>> Modified: compiler-rt/trunk/test/<a href="http://lit.common.configured.in" target="_blank">lit.common.configured.in</a><br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.configured.in?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.configured.in?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/<a href="http://lit.common.configured.in" target="_blank">lit.common.configured.in</a> (original)<br>
>> +++ compiler-rt/trunk/test/<a href="http://lit.common.configured.in" target="_blank">lit.common.configured.in</a> Wed Apr 30 16:32:30<br>
>> 2014<br>
>> @@ -8,6 +8,7 @@ def set_default(attr, value):<br>
>><br>
>>  # Generic config options for all compiler-rt lit tests.<br>
>>  set_default("target_triple", "@TARGET_TRIPLE@")<br>
>> +set_default("target_cflags", "@COMPILER_RT_TEST_COMPILER_FLAGS@")<br>
>>  set_default("host_arch", "@HOST_ARCH@")<br>
>>  set_default("target_arch", "@HOST_ARCH@")<br>
>>  set_default("host_os", "@HOST_OS@")<br>
>> @@ -22,6 +23,7 @@ set_default("compiler_rt_arch", "@COMPIL<br>
>>  set_default("python_executable", "@PYTHON_EXECUTABLE@")<br>
>>  set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)<br>
>>  set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@")<br>
>> +set_default("emulator", "@COMPILER_RT_EMULATOR@")<br>
>><br>
>>  # LLVM tools dir can be passed in lit parameters, so try to<br>
>>  # apply substitution.<br>
>><br>
>> Modified: compiler-rt/trunk/test/lsan/lit.common.cfg<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/lit.common.cfg?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lsan/lit.common.cfg?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/lsan/lit.common.cfg (original)<br>
>> +++ compiler-rt/trunk/test/lsan/lit.common.cfg Wed Apr 30 16:32:30 2014<br>
>> @@ -6,7 +6,7 @@ import os<br>
>><br>
>>  def get_required_attr(config, attr_name):<br>
>>    attr_value = getattr(config, attr_name, None)<br>
>> -  if not attr_value:<br>
>> +  if attr_value == None:<br>
>>      lit_config.fatal(<br>
>>        "No attribute %r in test configuration! You may need to run "<br>
>>        "tests from your build directory or add this attribute "<br>
>><br>
>> Modified: compiler-rt/trunk/test/profile/instrprof-basic.c<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-basic.c?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-basic.c?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/profile/instrprof-basic.c (original)<br>
>> +++ compiler-rt/trunk/test/profile/instrprof-basic.c Wed Apr 30 16:32:30<br>
>> 2014<br>
>> @@ -1,5 +1,5 @@<br>
>>  // RUN: %clang_profgen -o %t -O3 %s<br>
>> -// RUN: env LLVM_PROFILE_FILE=%t.profraw %t<br>
>> +// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t<br>
>>  // RUN: llvm-profdata merge -o %t.profdata %t.profraw<br>
>>  // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s<br>
>><br>
>><br>
>> Modified: compiler-rt/trunk/test/profile/lit.cfg<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/lit.cfg?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/lit.cfg?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/profile/lit.cfg (original)<br>
>> +++ compiler-rt/trunk/test/profile/lit.cfg Wed Apr 30 16:32:30 2014<br>
>> @@ -27,10 +27,16 @@ if config.test_exec_root is None:<br>
>>  # Test suffixes.<br>
>>  config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test']<br>
>><br>
>> +# Clang flags.<br>
>> +clang_cflags = [config.target_cflags]<br>
>> +<br>
>> +def build_invocation(compile_flags):<br>
>> +  return " " + " ".join([config.clang] + compile_flags) + " "<br>
>> +<br>
>>  # Add clang substitutions.<br>
>> -config.substitutions.append( ("%clang ", config.clang + " ") )<br>
>> -config.substitutions.append( ("%clang_profgen ", config.clang + "<br>
>> -fprofile-instr-generate ") )<br>
>> -config.substitutions.append( ("%clang_profuse=", config.clang + "<br>
>> -fprofile-instr-use=") )<br>
>> +config.substitutions.append( ("%clang ", build_invocation([])) )<br>
>> +config.substitutions.append( ("%clang_profgen ",<br>
>> build_invocation(clang_cflags) + " -fprofile-instr-generate ") )<br>
>> +config.substitutions.append( ("%clang_profuse=",<br>
>> build_invocation(clang_cflags) + " -fprofile-instr-use=") )<br>
>><br>
>>  # Profile tests are currently supported on Linux and Darwin only.<br>
>>  if config.host_os not in ['Linux', 'Darwin']:<br>
>><br>
>> Modified: compiler-rt/trunk/test/ubsan/lit.common.cfg<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/lit.common.cfg?rev=207707&r1=207706&r2=207707&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/ubsan/lit.common.cfg?rev=207707&r1=207706&r2=207707&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- compiler-rt/trunk/test/ubsan/lit.common.cfg (original)<br>
>> +++ compiler-rt/trunk/test/ubsan/lit.common.cfg Wed Apr 30 16:32:30 2014<br>
>> @@ -4,7 +4,7 @@ import os<br>
>><br>
>>  def get_required_attr(config, attr_name):<br>
>>    attr_value = getattr(config, attr_name, None)<br>
>> -  if not attr_value:<br>
>> +  if attr_value == None:<br>
>>      lit_config.fatal(<br>
>>        "No attribute %r in test configuration! You may need to run "<br>
>>        "tests from your build directory or add this attribute "<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
</div></div></blockquote></div><br></div>