linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Josh Triplett <josh@freedesktop.org>
Cc: linux-sparse <linux-sparse@vger.kernel.org>
Subject: [PATCH] cgcc: handle ppc arch
Date: Wed, 02 Apr 2008 18:00:34 +0200	[thread overview]
Message-ID: <1207152034.3957.15.camel@johannes.berg> (raw)

I'm not sure this is exactly the right thing to do because I'm
unfamiliar with the default CFLAGS, but it seems to at least make it
mostly work on powerpc.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
In particular, I don't know what that _STRING_ARCH_unaligned thing is
and whether I should define it to 0 or 1 (and why I need it at all.)

--- a/cgcc
+++ b/cgcc
@@ -241,6 +241,11 @@ sub add_specs {
 		&integer_types (8, 16, 32, $m32 ? 32 : 64, 64) .
 		&float_types (1, 1, 33, [24,8], [53,11], [113,15]) .
 		&define_size_t ($m32 ? "unsigned int" : "long unsigned int"));
+    } elsif ($spec eq 'ppc') {
+	return (' -D__powerpc__=1 -D_BIG_ENDIAN -D_STRING_ARCH_unaligned=1' .
+		&integer_types (8, 16, 32, $m64 ? 64 : 32, 64) .
+		&float_types (1, 1, 21, [24,8], [53,11], [113,15]) .
+		&define_size_t ($m64 ? "long unsigned int" : "unsigned int"));
     } elsif ($spec eq 'host_os_specs') {
 	my $os = `uname -s`;
 	chomp $os;
@@ -254,6 +259,8 @@ sub add_specs {
 	    return &add_specs ('sparc');
 	} elsif ($arch =~ /^(x86_64)$/i) {
 	    return &add_specs ('x86_64');
+	} elsif ($arch =~ /^(ppc)$/i) {
+	    return &add_specs ('ppc');
 	}
     } else {
 	die "$0: invalid specs: $spec\n";



             reply	other threads:[~2008-04-03 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-02 16:00 Johannes Berg [this message]
2008-04-07 12:11 ` [PATCH] cgcc: handle ppc arch 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=1207152034.3957.15.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=josh@freedesktop.org \
    --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).