Message ID | 20190217153131.94556-3-luc.vanoostenryck@gmail.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | cgcc: use gcc -dumpmachine | expand |
On 17/02/2019 15:31, Luc Van Oostenryck wrote: > Platforms having an uname's machine 'ppc64' or 'ppc64le' need to > have their endianness set (as well as the 'ELF' version). > > To facilitate some futur changes and code reuses here, create s/futur/future/; s/reuses/reuse/ ATB, Ramsay Jones > entries for 2 pseudo-archs 'ppc64+be' & 'ppc64+le'. > > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> > --- > cgcc | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/cgcc b/cgcc > index 456b97e37..7ae6e5c6d 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) { >
diff --git a/cgcc b/cgcc index 456b97e37..7ae6e5c6d 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) {
Platforms having an uname's machine 'ppc64' or 'ppc64le' need to have their endianness set (as well as the 'ELF' version). To facilitate some futur changes and code reuses here, create entries for 2 pseudo-archs 'ppc64+be' & 'ppc64+le'. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- cgcc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)