From e0306fe0b725af6e2e7ff59d7f0d99c96315791a Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Wed, 21 Jun 2017 13:24:26 +0200 Subject: [PATCH] cgcc: teach cgcc about ppc64[le] Signed-off-by: Luc Van Oostenryck --- cgcc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cgcc b/cgcc index 904695c8..f5f35223 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.11.4.GIT