File: cgcc-use-only-the-cc-command-to-determine-gcc_base_d.patch

package info (click to toggle)
sparse 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,936 kB
  • ctags: 3,948
  • sloc: ansic: 27,901; perl: 248; sh: 233; makefile: 166
file content (41 lines) | stat: -rw-r--r-- 1,318 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From d4029acb1036726aa83261bda14f31e9a55d7e59 Mon Sep 17 00:00:00 2001
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date: Mon, 4 Aug 2014 19:39:55 +0100
Subject: [PATCH] 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.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Origin: upstream, commit:d4029acb1036726aa83261bda14f31e9a55d7e59
---
 cgcc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cgcc b/cgcc
index e69a831fb52b..d6392e0aa75a 100755
--- a/cgcc
+++ b/cgcc
@@ -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;
 
-- 
2.1.4