aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-29 20:46:55 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-30 09:52:35 +0100
commit92907fce1391eff64246b7ac51a40ded6df58640 (patch)
treeed09c2e0ac6e1db773f37dbfeb5ae85b84a49151
parent2c06f143fa63394dbdfa07f3f9d00b24b7c902c5 (diff)
downloadsparse-92907fce1391eff64246b7ac51a40ded6df58640.tar.gz
cgcc: specify the arch via --arch
Now that it's possible to specify the architecture via the --arch=ARCH option, let cgcc make use of it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xcgcc15
1 files changed, 11 insertions, 4 deletions
diff --git a/cgcc b/cgcc
index 122f6e27..0ac9a55c 100755
--- a/cgcc
+++ b/cgcc
@@ -294,29 +294,35 @@ sub add_specs {
" -D'__declspec(x)=__attribute__((x))'";
} elsif ($spec eq 'i386') {
return (
+ ' --arch=i386' .
&float_types (1, 1, 21, [24,8], [53,11], [64,15]));
} elsif ($spec eq 'sparc') {
return (
+ ' --arch=sparc' .
&integer_types (8, 16, 32, $m64 ? 64 : 32, 64) .
&float_types (1, 1, 33, [24,8], [53,11], [113,15]) .
&define_size_t ($m64 ? "long unsigned int" : "unsigned int") .
' -D__SIZEOF_POINTER__=' . ($m64 ? '8' : '4'));
} elsif ($spec eq 'sparc64') {
return (
+ ' --arch=sparc64' .
&integer_types (8, 16, 32, 64, 64, 128) .
&float_types (1, 1, 33, [24,8], [53,11], [113,15]) .
&define_size_t ("long unsigned int") .
' -D__SIZEOF_POINTER__=8');
} elsif ($spec eq 'x86_64') {
- return &float_types (1, 1, 33, [24,8], [53,11], [113,15]);
+ return (' --arch=x86_64' .
+ &float_types (1, 1, 33, [24,8], [53,11], [113,15]));
} elsif ($spec eq 'ppc') {
return (' -D_BIG_ENDIAN -D_STRING_ARCH_unaligned=1' .
+ ' --arch=ppc' .
&integer_types (8, 16, 32, $m64 ? 64 : 32, 64) .
&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_STRING_ARCH_unaligned=1 -m64' .
+ return (' -D_STRING_ARCH_unaligned=1 ' .
+ ' --arch=ppc64' .
&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';
@@ -324,17 +330,18 @@ sub add_specs {
return &add_specs ('ppc64') . ' -mlittle-endian -D_CALL_ELF=2';
} elsif ($spec eq 's390x') {
return (' -D_BIG_ENDIAN' .
+ ' --arch=s390x' .
&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 'arm') {
- return (' -m32' .
+ return (' --arch=arm' .
&float_types (1, 1, 36, [24,8], [53,11], [53, 11]));
} elsif ($spec eq 'arm+hf') {
return &add_specs ('arm') . ' -D__ARM_PCS_VFP=1';
} elsif ($spec eq 'aarch64') {
- return (' -m64' .
+ return (' --arch=aarch64' .
&float_types (1, 1, 36, [24,8], [53,11], [113,15]));
} elsif ($spec eq 'host_os_specs') {
my $os = `uname -s`;