aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-04-02 18:00:34 +0200
committerJosh Triplett <josh@freedesktop.org>2008-04-07 05:09:57 -0700
commitf93bc9bade1f2db9320ad65ffa174ff3f684849f (patch)
tree9e34b71a01ddedb3961f46681d0b9a06a40a5972
parent08431f18af58bb612976185000a465bf8168582b (diff)
downloadsparse-f93bc9bade1f2db9320ad65ffa174ff3f684849f.tar.gz
sparse-f93bc9bade1f2db9320ad65ffa174ff3f684849f.tar.xz
sparse-f93bc9bade1f2db9320ad65ffa174ff3f684849f.zip
cgcc: handle ppc arch
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>
-rwxr-xr-xcgcc7
1 files changed, 7 insertions, 0 deletions
diff --git a/cgcc b/cgcc
index 9acf498..4fab530 100755
--- 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";