* [PATCH] cgcc: teach cgcc about ppc64[le]
@ 2017-06-21 13:34 Luc Van Oostenryck
0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2017-06-21 13:34 UTC (permalink / raw)
To: linux-sparse; +Cc: Christopher Li, Luc Van Oostenryck
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
cgcc | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/cgcc b/cgcc
index 904695c81..f5f352234 100755
--- a/cgcc
+++ b/cgcc
@@ -283,6 +283,12 @@ sub add_specs {
&float_types (1, 1, 21, [24,8], [53,11], [113,15]) .
&define_size_t ($m64 ? "long unsigned int" : "unsigned int") .
' -D__SIZEOF_POINTER__=' . ($m64 ? '8' : '4'));
+ } elsif ($spec eq 'ppc64') {
+ return (' -D__powerpc__=1 -D__PPC__=1 -D_STRING_ARCH_unaligned=1' .
+ ' -D__powerpc64__=1 -D__PPC64__=1' .
+ ' -D_CALL_ELF=2' .
+ ' -m64' .
+ &float_types (1, 1, 21, [24,8], [53,11], [113,15]));
} elsif ($spec eq 's390x') {
return (' -D__s390x__ -D__s390__ -D_BIG_ENDIAN' .
&integer_types (8, 16, 32, $m64 ? 64 : 32, 64) .
@@ -307,6 +313,10 @@ sub add_specs {
return &add_specs ('x86_64');
} elsif ($arch =~ /^(ppc)$/i) {
return &add_specs ('ppc');
+ } elsif ($arch =~ /^(ppc64)$/i) {
+ return &add_specs ('ppc64') . ' -mbig-endian';
+ } elsif ($arch =~ /^(ppc64le)$/i) {
+ return &add_specs ('ppc64') . ' -mlittle-endian';
} elsif ($arch =~ /^(s390x)$/i) {
return &add_specs ('s390x');
} elsif ($arch =~ /^(sparc64)$/i) {
--
2.13.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-21 13:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-21 13:34 [PATCH] cgcc: teach cgcc about ppc64[le] Luc Van Oostenryck
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).