[clang] 6ecd4a4 - [clang][scan-build] Use uname -s to detect the operating system.

Frederic Cambus via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 30 14:27:47 PDT 2021


Author: Frederic Cambus
Date: 2021-10-30T23:26:39+02:00
New Revision: 6ecd4a4d01a3f71dc6590194dd00f96550c2ab04

URL: https://github.com/llvm/llvm-project/commit/6ecd4a4d01a3f71dc6590194dd00f96550c2ab04
DIFF: https://github.com/llvm/llvm-project/commit/6ecd4a4d01a3f71dc6590194dd00f96550c2ab04.diff

LOG: [clang][scan-build] Use uname -s to detect the operating system.

We only need the operating system name, not all information.

Differential Revision: https://reviews.llvm.org/D111797

Added: 
    

Modified: 
    clang/tools/scan-build/libexec/ccc-analyzer

Removed: 
    


################################################################################
diff  --git a/clang/tools/scan-build/libexec/ccc-analyzer b/clang/tools/scan-build/libexec/ccc-analyzer
index ed0d4d3d73f38..2a589a3a0ef5e 100755
--- a/clang/tools/scan-build/libexec/ccc-analyzer
+++ b/clang/tools/scan-build/libexec/ccc-analyzer
@@ -72,7 +72,7 @@ my $AnalyzerTarget;
 # If on OSX, use xcrun to determine the SDK root.
 my $UseXCRUN = 0;
 
-if (`uname -a` =~ m/Darwin/) {
+if (`uname -s` =~ m/Darwin/) {
   $DefaultCCompiler = 'clang';
   $DefaultCXXCompiler = 'clang++';
   # Older versions of OSX do not have xcrun to
@@ -80,7 +80,7 @@ if (`uname -a` =~ m/Darwin/) {
   if (-x "/usr/bin/xcrun") {
     $UseXCRUN = 1;
   }
-} elsif (`uname -a` =~ m/OpenBSD/) {
+} elsif (`uname -s` =~ m/OpenBSD/) {
   $DefaultCCompiler = 'cc';
   $DefaultCXXCompiler = 'c++';
 } else {


        


More information about the cfe-commits mailing list