Skip to contentSkip to conversation

cgcc: use only the cc command to determine $gcc_base_dir

PATCH In review Ramsay Jones 1 participant 1 message Aug 4, 2014 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 8/10 cgcc: use only the cc command to determine $gcc_base_dir

Capture the c-compiler command, in the $ccom variable, in order to later invoke the compiler without extraneous command-line options. In particular, use the $ccom variable in order to cleanly invoke the compiler when setting the $gcc_base_dir variable.

---
 cgcc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
cgcc +2 -1
index ed35e39..f330116 100755
@@ -3,6 +3,7 @@
 
 my $cc = $ENV{'REAL_CC'} || 'cc';
 my $check = $ENV{'CHECK'} || 'sparse';
+my $ccom = $cc;
 
 my $m32 = 0;
 my $m64 = 0;
@@ -72,7 +73,7 @@ if ($do_check) {
 	$check .= &add_specs ('host_os_specs');
     }
 
-    $gcc_base_dir = qx($cc -print-file-name=) if !$gcc_base_dir;
+    $gcc_base_dir = qx($ccom -print-file-name=) if !$gcc_base_dir;
     chomp($gcc_base_dir);  # possibly remove '\n' from compiler
     $check .= " -gcc-base-dir " . $gcc_base_dir if $gcc_base_dir;
 
Signature · 1 line
2.0.0