[compiler-rt] r365841 - Use clang driver for libfuzzer tests on Windows

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 15:04:40 PDT 2019


I thought the party line was that clang-cl was the officially prescribed way to build MSVC ABI code, and using the gcc-style driver was supported in a best-effort way. E.g. see https://reviews.llvm.org/D43700:

"While we still don't claim to support clang on Windows without the cl driver, this is a straightforward patch to make things slightly better for people who want to go this route anyway."

Has that changed now?

On 7/11/19, 4:20 PM, "llvm-commits on behalf of Reid Kleckner via llvm-commits" <llvm-commits-bounces at lists.llvm.org on behalf of llvm-commits at lists.llvm.org> wrote:

    Author: rnk
    Date: Thu Jul 11 16:20:04 2019
    New Revision: 365841
    
    URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D365841-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=hLC_h0ykUUGprgMqLjtx4jVpRaqFCT5AAEluH183aN8&e= 
    Log:
    Use clang driver for libfuzzer tests on Windows
    
    Summary:
    There's no real reason to use clang-cl on Windows, the clang driver
    works just as well. This fixes a test which uses the -O0 flag, which was
    recently removed from clang-cl to match MSVC, which lacks this flag.
    
    While I'm here, remove the explicit -std=c++11 flag. Previously, this
    flag was necessary when the default C++ standard was C++98. Now that the
    default is C++14, this is no longer necessary. It's problematic on
    Windows, because the Visual C++ standard library relies on C++14
    features, and attempting to compile it with C++11 results in errors.
    Rather than adding logic to conditionally set the standard to C++11 only
    on non-Win, this flag can be removed.
    
    See https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_builders_clang-2Dx64-2Dwindows-2Dmsvc&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=yp4B5xMb17VbJH1f5nSXHh7AIWzeTuN6sambP8p-ovU&e=  and
    https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D64506&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=0l9k0AWU7_ZK8t0EEgQZEZiyMIlVROmw02JCNhH0Dbs&e= .
    
    Reviewers: morehouse, thakis
    
    Subscribers: #sanitizers, llvm-commits
    
    Tags: #sanitizers, #llvm
    
    Differential Revision: https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D64587&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=uhSE7dO-MYalsbNzcKLea23dbuj3U-V5birSwlTXwNQ&e= 
    
    Modified:
        compiler-rt/trunk/test/fuzzer/lit.cfg.py
        compiler-rt/trunk/test/fuzzer/windows-opt-ref.test
    
    Modified: compiler-rt/trunk/test/fuzzer/lit.cfg.py
    URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_compiler-2Drt_trunk_test_fuzzer_lit.cfg.py-3Frev-3D365841-26r1-3D365840-26r2-3D365841-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=WbrkwhGmM5JCGC7miHgtd0FcMusKkLmwjdAtPDQrBlY&e= 
    ==============================================================================
    --- compiler-rt/trunk/test/fuzzer/lit.cfg.py (original)
    +++ compiler-rt/trunk/test/fuzzer/lit.cfg.py Thu Jul 11 16:20:04 2019
    @@ -66,10 +66,8 @@ def generate_compiler_cmd(is_cpp=True, f
       compiler_cmd = config.clang
       extra_cmd = config.target_flags
     
    -  if is_cpp and 'windows-msvc' in config.target_triple:
    -    std_cmd = '--driver-mode=cl'
    -  elif is_cpp:
    -    std_cmd = '--driver-mode=g++ -std=c++11'
    +  if is_cpp:
    +    std_cmd = '--driver-mode=g++'
       else:
         std_cmd = ''
     
    
    Modified: compiler-rt/trunk/test/fuzzer/windows-opt-ref.test
    URL: https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_compiler-2Drt_trunk_test_fuzzer_windows-2Dopt-2Dref.test-3Frev-3D365841-26r1-3D365840-26r2-3D365841-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=aYPEKvK64GPZVg47bmaO2mTb49lRtugkmPupYhfmYlE&e= 
    ==============================================================================
    --- compiler-rt/trunk/test/fuzzer/windows-opt-ref.test (original)
    +++ compiler-rt/trunk/test/fuzzer/windows-opt-ref.test Thu Jul 11 16:20:04 2019
    @@ -1,7 +1,7 @@
     REQUIRES: windows
     // Verify that the linker eliminating unreferenced functions (/OPT:REF) does not
     // strip sancov module constructor.
    -RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest /link /OPT:REF
    +RUN: %cpp_compiler %S/SimpleCmpTest.cpp -o %t-SimpleCmpTest -Wl,-OPT:REF
     
     RUN: not %run %t-SimpleCmpTest -seed=1 -runs=100000000 2>&1 | FileCheck %s
     
    
    
    _______________________________________________
    llvm-commits mailing list
    llvm-commits at lists.llvm.org
    https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=GK5oCBrN9-E5MRyou_hEqKINlybHWjWowzTl5zShb7k&s=2oQNbNbFbh8Av5E3KAl4IWZ2zKB1W2GFmzBe3X0H1gU&e= 
    



More information about the llvm-commits mailing list