From: Stefan Weil <sw@weilnetz.de>
To: linux-sparse@vger.kernel.org
Cc: Stefan Weil <sw@weilnetz.de>
Subject: [PATCH] cgcc: Fix preprocessing of assembler files
Date: Sat, 4 Jan 2014 11:20:48 +0100 [thread overview]
Message-ID: <1388830848-2020-1-git-send-email-sw@weilnetz.de> (raw)
The old code does not preprocess assembler files when cgcc is called like
this:
cgcc -E -o multiboot.asm multiboot.S
As the preprocessor is not called, no multiboot.asm is generated, and any
further build steps which need it will fail.
Fix this by using a new intermediate variable $do_preprocess.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
This patch allows using cgcc for QEMU builds. I did not run any other tests,
so please review carefully.
Thanks,
Stefan Weil
cgcc | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/cgcc b/cgcc
index c075e5f..a43e074 100755
--- a/cgcc
+++ b/cgcc
@@ -10,6 +10,7 @@ my $has_specs = 0;
my $gendeps = 0;
my $do_check = 0;
my $do_compile = 1;
+my $do_preprocess = 0;
my $gcc_base_dir;
my $verbose = 0;
@@ -44,8 +45,7 @@ while (@ARGV) {
next;
}
- # If someone adds "-E", don't pre-process twice.
- $do_compile = 0 if $_ eq '-E';
+ $do_preprocess = 1 if $_ eq '-E';
$verbose = 1 if $_ eq '-v';
@@ -59,6 +59,11 @@ if ($gendeps) {
$do_check = 0;
}
+if ($do_check && $do_preprocess) {
+ # If someone adds "-E", don't pre-process twice.
+ $do_compile = 0;
+}
+
if ($do_check) {
if (!$has_specs) {
$check .= &add_specs ('host_arch_specs');
--
1.7.10.4
next reply other threads:[~2014-01-04 10:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-04 10:20 Stefan Weil [this message]
2014-01-04 10:57 ` [PATCH] cgcc: Fix preprocessing of assembler files Josh Triplett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388830848-2020-1-git-send-email-sw@weilnetz.de \
--to=sw@weilnetz.de \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).