aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-15 22:59:59 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-25 23:01:04 +0100
commita451db31db58ead4c6bbcf02e6362ca5614575fd (patch)
treeb6e982d9221961cddae11fb95ce4347b440d51b3
parent95ac0b0352814393c1413a953f3d409d25a86059 (diff)
downloadsparse-a451db31db58ead4c6bbcf02e6362ca5614575fd.tar.gz
cgcc: add pseudo-archs for ppc64be/ppc64le
Platforms having an uname's machine 'ppc64' or 'ppc64le' need to have their endianness set (as well as the 'ELF' version). To facilitate some future changes and code reuse here, create entries for 2 pseudo-archs 'ppc64+be' & 'ppc64+le'. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xcgcc8
1 files changed, 6 insertions, 2 deletions
diff --git a/cgcc b/cgcc
index c7959105..e207d018 100755
--- a/cgcc
+++ b/cgcc
@@ -315,6 +315,10 @@ sub add_specs {
} elsif ($spec eq 'ppc64') {
return (' -D_STRING_ARCH_unaligned=1 -m64' .
&float_types (1, 1, 21, [24,8], [53,11], [113,15]));
+ } elsif ($spec eq 'ppc64+be') {
+ return &add_specs ('ppc64') . ' -mbig-endian -D_CALL_ELF=1';
+ } elsif ($spec eq 'ppc64+le') {
+ return &add_specs ('ppc64') . ' -mlittle-endian -D_CALL_ELF=2';
} elsif ($spec eq 's390x') {
return (' -D_BIG_ENDIAN' .
&integer_types (8, 16, 32, $m64 ? 64 : 32, 64) .
@@ -350,9 +354,9 @@ sub add_specs {
} elsif ($arch =~ /^(ppc)$/i) {
return &add_specs ('ppc');
} elsif ($arch =~ /^(ppc64)$/i) {
- return &add_specs ('ppc64') . ' -mbig-endian -D_CALL_ELF=1';
+ return &add_specs ('ppc64+be');
} elsif ($arch =~ /^(ppc64le)$/i) {
- return &add_specs ('ppc64') . ' -mlittle-endian -D_CALL_ELF=2';
+ return &add_specs ('ppc64+le');
} elsif ($arch =~ /^(s390x)$/i) {
return &add_specs ('s390x');
} elsif ($arch =~ /^(sparc64)$/i) {