* [PATCH] cgcc: handle ppc arch
@ 2008-04-02 16:00 Johannes Berg
2008-04-07 12:11 ` Josh Triplett
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2008-04-02 16:00 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-sparse
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";
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-07 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-02 16:00 [PATCH] cgcc: handle ppc arch Johannes Berg
2008-04-07 12:11 ` Josh Triplett
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).