cs: add configuration for {Free,Open,Net}BSD on {ARMv6,AArch64,PowerPC}

It's not clear how many of these combinations work right now, but they
should be close, and the intent is that they're supported. I
succcessfully built for FreeBSD on AArch64 and Chez Scheme for NetBSD
on PowerPC32.
This commit is contained in:
Matthew Flatt 2021-04-30 09:51:27 -06:00
parent c0af3a253b
commit 8ea5b58393
9 changed files with 112 additions and 69 deletions

View File

@ -8,9 +8,9 @@ Supported platforms:
* Windows: x86, x86_64
* Mac OS: x86, x86_64, AArch64, PowerPC32
* Linux: x86, x86_64, ARMv6, AArch64, PowerPC32
* FreeBSD: x86, x86_64
* OpenBSD: x86, x86_64
* NetBSD: x86, x86_64
* FreeBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
* OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
* NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
* Solaris: x86, x86_64
* Android: ARMv7, AArch64
* iOS: AArch64

View File

@ -43,6 +43,13 @@ void S_doflush(uptr start, uptr end) {
sys_icache_invalidate((void *)start, (char *)end-(char *)start);
#else
__clear_cache((char *)start, (char *)end);
# if defined(__clang__) && defined(__aarch64__) && !defined(__APPLE__)
/* Seem to need an extra combination of barriers here to make up for
something in Clang's __clear_cache() */
asm volatile ("dsb ish\n\t"
"isb"
: : : "memory");
# endif
#endif
}

View File

@ -35,6 +35,8 @@
#if (machine_type == machine_type_pb)
# undef FLUSHCACHE
#else
# undef PORTABLE_BYTECODE_BIGENDIAN
#endif
/*****************************************/

View File

@ -94,20 +94,7 @@ fi
case "${CONFIG_UNAME}" in
Linux)
if uname -a | egrep 'i386|i686|amd64|athlon|x86_64' > /dev/null 2>&1 ; then
m32=i3le
m64=a6le
tm32=ti3le
tm64=ta6le
elif uname -a | grep -i power > /dev/null 2>&1 ; then
m32=ppc32le
tm32=tppc32le
elif uname -a | egrep 'armv|aarch64' > /dev/null 2>&1 ; then
m32=arm32le
m64=arm64le
tm32=tarm32le
tm64=tarm64le
fi
unixsuffix=le
installprefix=/usr
installmansuffix=share/man
;;
@ -120,32 +107,17 @@ case "${CONFIG_UNAME}" in
installmansuffix=man
;;
FreeBSD)
if uname -a | egrep 'i386|i686|amd64|athlon|x86_64' > /dev/null 2>&1 ; then
m32=i3fb
m64=a6fb
tm32=ti3fb
tm64=ta6fb
fi
unixsuffix=fb
installprefix=/usr/local
installmansuffix=man
;;
OpenBSD)
if uname -a | egrep 'i386|i686|amd64|athlon|x86_64' > /dev/null 2>&1 ; then
m32=i3ob
m64=a6ob
tm32=ti3ob
tm64=ta6ob
fi
unixsuffix=ob
installprefix=/usr/local
installmansuffix=man
;;
NetBSD)
if uname -a | egrep 'i386|i686|amd64|athlon|x86_64' > /dev/null 2>&1 ; then
m32=i3nb
m64=a6nb
tm32=ti3nb
tm64=ta6nb
fi
unixsuffix=nb
installprefix=/usr
installmansuffix=share/man
gzipmanpages=no
@ -190,6 +162,23 @@ case "${CONFIG_UNAME}" in
;;
esac
if [ "$unixsuffix" != "" ] ; then
if uname -a | egrep 'i386|i686|amd64|athlon|x86_64' > /dev/null 2>&1 ; then
m32=i3${unixsuffix}
m64=a6${unixsuffix}
tm32=ti3${unixsuffix}
tm64=ta6${unixsuffix}
elif uname -a | egrep 'power|macppc' > /dev/null 2>&1 ; then
m32=ppc32${unixsuffix}
tm32=tppc32${unixsuffix}
elif uname -a | egrep 'armv|aarch64' > /dev/null 2>&1 ; then
m32=arm32${unixsuffix}
m64=arm64${unixsuffix}
tm32=tarm32${unixsuffix}
tm64=tarm64${unixsuffix}
fi
fi
threads=""
bits=""
@ -510,36 +499,15 @@ if [ "$cflagsset" = "no" ] ; then
a6le)
CFLAGS="-m64 -msse2 ${optFlags}"
;;
a6fb|a6nb|a6ob)
CFLAGS="-m64 ${optFlags}"
;;
a6s2)
CFLAGS="-m64 ${optFlags}"
;;
a6osx)
CFLAGS="-m64 ${optFlags}"
;;
arm64osx)
CFLAGS="-arch arm64 ${optFlags}"
;;
a6nt)
CFLAGS="${optFlags}"
;;
arm32le|tarm32le|arm64le|tarm64le)
CFLAGS="${optFlags}"
a6*)
CFLAGS="-m64 ${optFlags}"
;;
i3le)
CFLAGS="-m32 -msse2 ${optFlags}"
;;
i3fb|i3nb|i3ob)
CFLAGS="-m32 ${optFlags}"
;;
i3s2)
CFLAGS="-m32 ${optFlags}"
;;
i3osx)
CFLAGS="-m32 ${optFlags}"
;;
i3nt)
CFLAGS="${optFlags}"
;;
@ -547,12 +515,21 @@ if [ "$cflagsset" = "no" ] ; then
CC=qcc
CFLAGS="-m32 -N2048K ${optFlags}"
;;
ppc32le)
i3*)
CFLAGS="-m32 ${optFlags}"
;;
arm32*)
CFLAGS="-m32 ${optFlags}"
;;
arm64osx)
CFLAGS="-arch arm64 ${optFlags}"
;;
ppc32osx)
CFLAGS="${optFlags}"
;;
ppc32*)
CFLAGS="-m32 ${optFlags}"
;;
esac
fi
@ -699,13 +676,13 @@ case "${flagsmuni}" in
i3le)
mdldflags="-melf_i386"
;;
ppc32le|arm32le|arm64le)
;;
a6fb|a6ob|a6nb|i3fb|i3ob)
*le)
;;
i3nb)
mdldflags="-m elf_i386"
;;
*fb|*ob|*nb)
;;
*osx)
;;
a6s2)

View File

@ -396,6 +396,15 @@
arm64le tarm64le
arm64osx tarm64osx
ppc32osx tppc32osx
arm32fb tarm32fb
ppc32fb tppc32fb
arm64fb tarm64fb
arm32ob tarm32ob
ppc32ob tppc32ob
arm64ob tarm64ob
arm32nb tarm32nb
ppc32nb tppc32nb
arm64nb tarm64nb
)
(include "machine.def")

View File

@ -0,0 +1,5 @@
(define-constant machine-type (constant machine-type-ppc32nb))
(features iconv expeditor)
(define-constant time-t-bits 64)
(include "ppc32.def")
(include "default.def")

View File

@ -0,0 +1,5 @@
(define-constant machine-type (constant machine-type-tppc32nb))
(features iconv expeditor pthreads)
(define-constant time-t-bits 64)
(include "ppc32.def")
(include "default.def")

View File

@ -54,7 +54,13 @@ case "$Mhost" in
a6osx) ;;
a6s2) ;;
arm32le) ;;
arm32fb) ;;
arm32ob) ;;
arm32nb) ;;
arm64le) ;;
arm64fb) ;;
arm64ob) ;;
arm64nb) ;;
arm64osx) ;;
i3fb) ;;
i3le) ;;
@ -65,7 +71,9 @@ case "$Mhost" in
i3qnx) ;;
i3s2) ;;
ppc32le) ;;
ppc32osx) ;;
ppc32fb) ;;
ppc32ob) ;;
ppc32nb) ;;
ppc32osx) ;;
arm64osx) ;;
ta6fb) ;;
@ -76,7 +84,13 @@ case "$Mhost" in
ta6osx) ;;
ta6s2) ;;
tarm32le) ;;
tarm32fb) ;;
tarm32ob) ;;
tarm32nb) ;;
tarm64le) ;;
tarm64fb) ;;
tarm64ob) ;;
tarm64nb) ;;
tarm64osx) ;;
ti3fb) ;;
ti3le) ;;
@ -86,6 +100,9 @@ case "$Mhost" in
ti3osx) ;;
ti3s2) ;;
tppc32le) ;;
tppc32fb) ;;
tppc32ob) ;;
tppc32nb) ;;
tppc32osx) ;;
tarm64osx) ;;
*) echo "Unrecognized machine name $Mhost"; exit 1 ;;

View File

@ -38,9 +38,18 @@
arm32le tarm32le arm64le tarm64le
ppc32le tppc32le)
'linux]
[(a6ob ta6ob i3ob ti3ob) 'openbsd]
[(a6fb ta6fb i3fb ti3fb) 'freebsd]
[(a6nb ta6nb i3nb ti3nb) 'netbsd]
[(a6fb ta6fb i3fb ti3fb
arm32fb tarm32fb arm64fb tarm64fb
ppc32fb tppc32fb)
'freebsd]
[(a6ob ta6ob i3ob ti3ob
arm32ob tarm32ob arm64ob tarm64ob
ppc32ob tppc32ob)
'openbsd]
[(a6nb ta6nb i3nb ti3nb
arm32nb tarm32nb arm64nb tarm64nb
ppc32nb tppc32nb)
'netbsd]
[(a6s2 ta6s2 i3s2 ti3s2) 'solaris]
[(i3qnx) 'qnx]
[else (error 'system-type "internal error: unknown operating system")]))
@ -64,10 +73,22 @@
i3s2 ti3s2
i3qnx)
'i386]
[(arm32le tarm32le) 'arm]
[(arm64le tarm64le arm64osx tarm64osx) 'aarch64]
[(arm32le tarm32le
arm32fb tarm32fb
arm32ob tarm32ob
arm32nb tarm32nb)
'arm]
[(arm64le tarm64le
arm64osx tarm64osx
arm64fb tarm64fb
arm64ob tarm64ob
arm64nb tarm64nb)
'aarch64]
[(ppc32le tppc32le
ppc32osx tppc32osx)
ppc32osx tppc32osx
ppc32fb tppc32fb
ppc32ob tppc32ob
ppc32nb tppc32nb)
'ppc]
[else (error 'system-type "internal error: unknown architecture")]))