diff mbox

cgcc: teach cgcc about arm64

Message ID 20170620221251.93292-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck June 20, 2017, 10:12 p.m. UTC
This is needed to use sparse on the git tree on an arm64
machine (where a bug in the __builtin_bswapXX() expansion
was discovered).

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 cgcc | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/cgcc b/cgcc
index fd9d482fa..28c55335a 100755
--- a/cgcc
+++ b/cgcc
@@ -289,6 +289,10 @@  sub add_specs {
 		&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 'aarch64') {
+	return (' -D__aarch64__=1 -m64' .
+		&integer_types (8, 16, 32, 64, 64) .
+		&float_types (1, 1, 36, [24,8], [53,11], [113,15]));
     } elsif ($spec eq 'host_os_specs') {
 	my $os = `uname -s`;
 	chomp $os;
@@ -308,6 +312,8 @@  sub add_specs {
 	    return &add_specs ('s390x');
 	} elsif ($arch =~ /^(sparc64)$/i) {
 	    return &add_specs ('sparc64');
+	} elsif ($arch =~ /^(aarch64)$/i) {
+	    return &add_specs ('aarch64');
 	}
     } else {
 	die "$0: invalid specs: $spec\n";