summaryrefslogtreecommitdiffstatshomepage
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
commit9e7712272fea017c6e3dcf29dc321990028159c8 (patch)
tree374514eaf8c58675ac57f37e38d628b2afd5b68a
parenta451db31db58ead4c6bbcf02e6362ca5614575fd (diff)
downloadsparse-9e7712272fea017c6e3dcf29dc321990028159c8.tar.gz
cgcc: simpler handling of hard-float ARM
There is an ABI for ARM with hard floats and one for soft floats (as well as one for a sort of mix between hard & soft). For hard floats, the preprocessor symbol '__ARM_PCS_VFP' needs to be defined. This is added as an additional check in the code returning the 'specs' for ARM. To facilitate some upcoming changes and code reuse here, create a pseudo-arch 'arm+hf' using '-D__ARM_PCS_VFP=1' in addition to the usual options for ARM. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xcgcc15
1 files changed, 7 insertions, 8 deletions
diff --git a/cgcc b/cgcc
index e207d018..88681983 100755
--- a/cgcc
+++ b/cgcc
@@ -326,15 +326,10 @@ sub add_specs {
&define_size_t ("long unsigned int") .
' -D__SIZEOF_POINTER__=' . ($m64 ? '8' : '4'));
} elsif ($spec eq 'arm') {
- chomp (my $gccmachine = `$ccom -dumpmachine`);
- my $cppsymbols = ' -m32';
-
- if ($gccmachine eq 'arm-linux-gnueabihf') {
- $cppsymbols .= ' -D__ARM_PCS_VFP=1';
- }
-
- return ($cppsymbols .
+ return (' -m32' .
&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' .
&float_types (1, 1, 36, [24,8], [53,11], [113,15]));
@@ -362,6 +357,10 @@ sub add_specs {
} elsif ($arch =~ /^(sparc64)$/i) {
return &add_specs ('sparc64');
} elsif ($arch =~ /^arm(?:v[78]l)?$/i) {
+ chomp (my $gccmachine = `$ccom -dumpmachine`);
+ if ($gccmachine eq 'arm-linux-gnueabihf') {
+ return &add_specs ('arm+hf');
+ }
return &add_specs ('arm');
} elsif ($arch =~ /^(aarch64)$/i) {
return &add_specs ('aarch64');