Skip to content

Commit f38c75a

Browse files
Blackhexgithub-cygwin
authored andcommitted
Cygwin: gendef: stub implementations of routines for AArch64
This patch aspires to provide only minimal changes to `winsup/cygwin/scripts/gendef` allowing to pass the AArch64 build. It does not provide any implementations of the generated routines. Signed-off-by: Radek Bartoň <radek.barton@microsoft.com>
1 parent 8065978 commit f38c75a

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

winsup/cygwin/scripts/gendef

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if (!defined($cpu) || !defined($output_def)) {
2121
die "$0: missing required option\n";
2222
}
2323

24+
my $is_aarch64 = $cpu eq 'aarch64';
2425
my $is_x86_64 = $cpu eq 'x86_64';
2526
# FIXME? Do other (non-32 bit) arches on Windows still use symbol prefixes?
2627
my $sym_prefix = '';
@@ -89,7 +90,7 @@ sub fefunc {
8990
my $func = $sym_prefix . shift;
9091
my $fe = $sym_prefix . shift;
9192
my $sigfe_func;
92-
if ($is_x86_64) {
93+
if ($is_x86_64 || $is_aarch64) {
9394
$sigfe_func = ($fe =~ /^(.*)_${func}$/)[0];
9495
}
9596
my $extra;
@@ -109,6 +110,15 @@ $fe:
109110
110111
EOF
111112
}
113+
# TODO: This is only a stub, it needs to be implemented properly for AArch64.
114+
if ($is_aarch64) {
115+
$res = <<EOF;
116+
.extern $func
117+
.global $fe
118+
$fe:
119+
EOF
120+
}
121+
112122
if (!$main::first++) {
113123
if ($is_x86_64) {
114124
$res = <<EOF . longjmp () . $res;
@@ -338,6 +348,23 @@ stabilize_sig_stack:
338348
popq %r12
339349
ret
340350
.seh_endproc
351+
EOF
352+
}
353+
# TODO: These are only stubs, they need to be implemented properly for AArch64.
354+
if ($is_aarch64) {
355+
$res = <<EOF . longjmp () . $res;
356+
.include "tlsoffsets"
357+
.text
358+
359+
_sigfe_maybe:
360+
.global _sigbe
361+
_sigfe:
362+
_sigbe:
363+
.global sigdelayed
364+
sigdelayed:
365+
_sigdelayed_end:
366+
.global _sigdelayed_end
367+
stabilize_sig_stack:
341368
EOF
342369
}
343370
}
@@ -474,6 +501,19 @@ longjmp:
474501
incl %eax
475502
0: ret
476503
.seh_endproc
504+
EOF
505+
}
506+
if ($is_aarch64) {
507+
# TODO: These are only stubs, they need to be implemented properly for AArch64.
508+
return <<EOF;
509+
.globl sigsetjmp
510+
sigsetjmp:
511+
.globl setjmp
512+
setjmp:
513+
.globl siglongjmp
514+
siglongjmp:
515+
.globl longjmp
516+
longjmp:
477517
EOF
478518
}
479519
}

0 commit comments

Comments
 (0)