Make progress towards aarch64 build

This commit is contained in:
Justine Tunney 2023-05-01 19:43:59 -07:00
parent 08ff26c817
commit ca2860947f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15428 changed files with 25694 additions and 23138 deletions

View file

@ -20,7 +20,7 @@ MADEDIRS=
mkdir -p libc/nt/kernel32 &&
touch libc/nt/kernel32/boop.s &&
rm -f libc/nt/*/*.s ||
rm -f libc/nt/*/*.s libc/nt/*/*.S ||
exit
imp() {
@ -36,10 +36,10 @@ imp() {
{
# Generate Portable Executable import data structures
if [ "$DLL" = "ntdll" ]; then
echo ".include \"o/libc/nt/ntdllimport.inc\""
echo ".ntimp $ACTUAL"
echo "#include \"libc/nt/ntdllimport.h\""
echo ".ntimp $ACTUAL,$NAME"
else
echo ".include \"o/libc/nt/codegen.inc\""
echo "#include \"libc/nt/codegen.h\""
echo ".imp $DLL,__imp_$ACTUAL,$ACTUAL,$HINT"
fi
@ -56,11 +56,12 @@ imp() {
13|14) thunk "$NAME" "$ACTUAL" __sysv2nt14 "$NAME" ;;
esac
fi
} >libc/nt/$DLL/$ACTUAL.s
} >libc/nt/$DLL/$ACTUAL.S
}
thunk() {
printf '
#ifdef __x86_64__
.text.windows
%s:
push %%rbp
@ -70,11 +71,13 @@ thunk() {
jmp %s
.endfn %s,globl
.previous
#endif
' "$@"
}
thunk0() {
printf '
#ifdef __x86_64__
.text.windows
%s:
push %%rbp
@ -86,11 +89,13 @@ thunk0() {
ret
.endfn %s,globl
.previous
#endif
' "$@"
}
thunk1() {
printf '
#ifdef __x86_64__
.text.windows
%s:
push %%rbp
@ -103,5 +108,6 @@ thunk1() {
ret
.endfn %s,globl
.previous
#endif
' "$@"
}