From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] cgcc: teach cgcc about ppc64[le]
Date: Wed, 21 Jun 2017 15:34:55 +0200 [thread overview]
Message-ID: <20170621133455.97253-1-luc.vanoostenryck@gmail.com> (raw)
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
reply other threads:[~2017-06-21 13:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170621133455.97253-1-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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).