diff options
| author | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-01-22 10:51:50 +0100 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2015-01-28 10:33:58 -0800 |
| commit | 1a900d9f37bb060329274970b25753181ce14223 (patch) | |
| tree | 5a92eb834f6af13ccdac0ac543a5d2f0f69aed08 /cgcc | |
| parent | 6c2d743d2f130a8bf9014410f928bae3647e3108 (diff) | |
| download | sparse-dev-1a900d9f37bb060329274970b25753181ce14223.tar.gz | |
s390x: add the proper defines for data types
This patch fixes several issues when compiling code under s390x
(64bit) with cgcc, e.g.
/usr/include/gnu/stubs.h:8:12: error: unable to open 'gnu/stubs-32.h'
by providing the proper defines.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'cgcc')
| -rwxr-xr-x | cgcc | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -279,6 +279,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 's390x') { + return (' -D__s390x__ -D__s390__ -D_BIG_ENDIAN' . + &integer_types (8, 16, 32, $m64 ? 64 : 32, 64) . + &float_types (1, 1, 36, [24,8], [53,11], [113,15]) . + &define_size_t ("long unsigned int") . + ' -D__SIZEOF_POINTER__=' . ($m64 ? '8' : '4')); } elsif ($spec eq 'host_os_specs') { my $os = `uname -s`; chomp $os; @@ -294,6 +300,8 @@ sub add_specs { return &add_specs ('x86_64'); } elsif ($arch =~ /^(ppc)$/i) { return &add_specs ('ppc'); + } elsif ($arch =~ /^(s390x)$/i) { + return &add_specs ('s390x'); } elsif ($arch =~ /^(sparc64)$/i) { return &add_specs ('sparc64'); } |
