Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: aarch64-darwin #1562

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ case $host in
SUPPORT_HARP=yes
SUPPORT_LLVM=yes
;;
aarch64-*-darwin*)
OPEN_DYLAN_TARGET_PLATFORM="aarch64-darwin";
MACOS_SDK=`xcrun --show-sdk-path`
shrext=dylib
;;
x86_64-*-darwin*)
OPEN_DYLAN_TARGET_PLATFORM="x86_64-darwin";
MACOS_SDK=`xcrun --show-sdk-path`
Expand Down
3 changes: 2 additions & 1 deletion sources/common-dylan/darwin-common-dylan.lid
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: x86_64-darwin
Platforms: aarch64-darwin
x86_64-darwin
3 changes: 2 additions & 1 deletion sources/databases/odbc-ffi/unix-odbc.lid
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: x86_64-darwin
Platforms: aarch64-darwin
x86_64-darwin
3 changes: 2 additions & 1 deletion sources/duim/gtk/duim.lid
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: arm-linux
Platforms: aarch64-linux
arm-linux
x86-freebsd
x86-linux
x86-netbsd
Expand Down
2 changes: 1 addition & 1 deletion sources/environment/dfmc/database/library-objects.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ define method project-executable-pathname
select (platform)
#"x86-win32" =>
make(<file-locator>, base: base, extension: "dll");
#"x86_64-darwin" =>
#"aarch64-darwin", #"x86_64-darwin" =>
make(<file-locator>, base: concatenate("lib", base), extension: "dylib");
otherwise =>
make(<file-locator>, base: concatenate("lib", base), extension: "so");
Expand Down
3 changes: 2 additions & 1 deletion sources/io/unix-io.lid
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: arm-linux
Platforms: aarch64-darwin
arm-linux
x86-freebsd
x86-linux
x86-netbsd
Expand Down
1 change: 1 addition & 0 deletions sources/jamfiles/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ subdir = sources/jamfiles
BUILD_SCRIPTS_DEST = $(OPEN_DYLAN_USER_INSTALL)/share/opendylan/build-scripts

SCRIPTS = \
$(srcdir)/aarch64-darwin-build.jam \
$(srcdir)/mini-jambase.jam \
$(srcdir)/posix-build.jam \
$(srcdir)/shared-darwin-build.jam \
Expand Down
14 changes: 14 additions & 0 deletions sources/jamfiles/aarch64-darwin-build.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Generated config
#
include $(SYSTEM_BUILD_SCRIPTS)/config.jam ;

#
# Configuration variables
#
CCFLAGS += -arch arm64 -DOPEN_DYLAN_ARCH_AARCH64 ;

#
# Common build script
#
include $(SYSTEM_BUILD_SCRIPTS)/shared-darwin-build.jam ;
3 changes: 2 additions & 1 deletion sources/lib/dood/dood-64.lid
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: x86_64-darwin
Platforms: aarch64-darwin
x86_64-darwin
x86_64-freebsd
x86_64-linux
x86_64-netbsd
3 changes: 2 additions & 1 deletion sources/lib/jam/unix-jam.lid
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Copyright: Original Code is Copyright 2004 Gwydion Dylan Maintainers
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: arm-linux
Platforms: aarch64-darwin
arm-linux
x86-freebsd
x86-linux
x86-netbsd
Expand Down
6 changes: 6 additions & 0 deletions sources/lib/run-time/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ else ifeq ($(OPEN_DYLAN_TARGET_PLATFORM),x86_64-netbsd)
-DOPEN_DYLAN_PLATFORM_NETBSD -DOPEN_DYLAN_PLATFORM_UNIX \
-DOPEN_DYLAN_ARCH_X86_64
PLATFORM_LFLAGS=-m64 -fPIC
else ifeq ($(OPEN_DYLAN_TARGET_PLATFORM),aarch64-darwin)
PLATFORM_CFLAGS=-arch arm64 -D_REENTRANT=1 \
-DOPEN_DYLAN_PLATFORM_DARWIN -DOPEN_DYLAN_PLATFORM_UNIX \
-DOPEN_DYLAN_ARCH_AARCH64 -Wno-unknown-attributes
PLATFORM_LFLAGS=-arch arm64
DARWIN=yes
else ifeq ($(OPEN_DYLAN_TARGET_PLATFORM),x86_64-darwin)
PLATFORM_CFLAGS=-arch x86_64 -D_REENTRANT=1 \
-DOPEN_DYLAN_PLATFORM_DARWIN -DOPEN_DYLAN_PLATFORM_UNIX \
Expand Down
2 changes: 1 addition & 1 deletion sources/lib/run-time/stack-walker.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ void dylan_dump_callstack(void *ctxt)
{
unw_context_t context;
unw_cursor_t cursor;
#if (defined (OPEN_DYLAN_PLATFORM_DARWIN) && defined(OPEN_DYLAN_ARCH_X86_64))
#if defined (OPEN_DYLAN_PLATFORM_DARWIN) && (defined(OPEN_DYLAN_ARCH_X86_64) || defined(OPEN_DYLAN_ARCH_AARCH64))
// We can use the passed-in ucontext_t as the libunwind context
if (ctxt == NULL) {
unw_getcontext(&context);
Expand Down
3 changes: 2 additions & 1 deletion sources/lib/ssl/ssl.lid
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Files: library
openssl-wrapper
C-libraries: -lssl -lcrypto
C-source-files: support.c
Platforms: arm-linux
Platforms: aarch64-darwin
arm-linux
x86-freebsd
x86-linux
x86-netbsd
Expand Down
3 changes: 2 additions & 1 deletion sources/lib/variable-search/darwin-variable-search.lid
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: x86_64-darwin
Platforms: aarch64-darwin
x86_64-darwin
30 changes: 30 additions & 0 deletions sources/network/aarch64-darwin-network.lid
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Library: network
Author: Andy Armstrong
Synopsis: Linux (x86) version of the Functional Objects Network library
Target-Type: dll
Major-Version: 2
Minor-Version: 1
Files: darwin-network-library
unix-sockets/x86-unix-sockets-data
unix-sockets/x86-freebsd-sockets-data
unix-sockets/sockets-interfaces
unix-sockets/sockets-extras
unix-sockets/x86-freebsd-address-data
unix-sockets/address-interfaces
unix-sockets/errno-darwin
unix-sockets/poll
sockets/socket-conditions
sockets/unix-socket-accessor
sockets/internet-address
sockets/abstract-sockets
sockets/client-sockets
sockets/TCP-sockets
sockets/server-sockets
sockets/unix-TCP-socket-accessor
sockets/UDP-sockets
sockets/unix-UDP-sockets
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: aarch64-darwin
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/common-dylan
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/common-dylan/darwin-common-dylan.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/dood
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/lib/dood/dood-64.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/duim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/duim/gtk/duim.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/io
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/io/unix-io.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/jam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/lib/jam/unix-jam.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/network
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/network/aarch64-darwin-network.lid
2 changes: 2 additions & 0 deletions sources/registry/aarch64-darwin/odbc-ffi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
abstract://dylan/databases/odbc-ffi/unix-odbc.lid

1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/ssl-network
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/lib/ssl/ssl.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/system
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/system/aarch64-darwin-system.lid
1 change: 1 addition & 0 deletions sources/registry/aarch64-darwin/variable-search
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abstract://dylan/lib/variable-search/darwin-variable-search.lid
35 changes: 35 additions & 0 deletions sources/system/aarch64-darwin-magic-numbers.dylan
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Module: system-internals
License: Public Domain

// WARNING! This file is generated!

// Used by file-system/unix-ffi.dylan
define constant $ENOENT = 2;
define constant $EINTR = 4;
define constant $EACCES = 13;
define constant $EINVAL = 22;
define constant $ETXTBSY = 26;
define constant $EROFS = 30;
define constant $path-max = 1024;
define constant $stat-size = 144;
define constant $st-mode-offset = 4;
define constant $st-uid-offset = 16;
define constant $st-gid-offset = 20;
define constant $st-size-offset = 96;
define constant $st-atime-offset = 32;
define constant $st-mtime-offset = 48;
define constant $st-ctime-offset = 64;
define constant $pw-name-offset = 0;
define constant $pw-dir-offset = 48;
define constant $gr-name-offset = 0;

// Used by unix-date-interface.dylan
define constant $tm-sec-offset = 0;
define constant $tm-min-offset = 4;
define constant $tm-hour-offset = 8;
define constant $tm-mday-offset = 12;
define constant $tm-mon-offset = 16;
define constant $tm-year-offset = 20;
define constant $tm-isdst-offset = 32;
define constant $tm-gmtoff-offset = 40;
define constant $tm-zone-offset = 48;
6 changes: 6 additions & 0 deletions sources/system/aarch64-darwin-operating-system.dylan
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Module: system-internals

define constant $architecture-little-endian? :: <boolean> = #t;

define constant $machine-name = #"aarch64";
define constant $os-name = #"darwin";
38 changes: 38 additions & 0 deletions sources/system/aarch64-darwin-system.lid
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Library: system
Executable: odsystem
Synopsis: Portable operating system APIs
Author: Gail Zacharias
Major-Version: 2
Minor-Version: 1
Target-Type: dll
Files: library
operating-system
aarch64-darwin-magic-numbers
aarch64-darwin-operating-system
unix-operating-system
tokenize-variable
date
unix-date-interface
durations
locators/utilities
locators/locators
locators/web-locators
file-system/file-system
file-system/file-stream
file-system/wrapper-file-accessor
file-system/unix-ffi
file-system/unix-interface
file-system/unix-file-system
file-system/unix-file-accessor
file-system/posix-locators
file-system/microsoft-locators
file-system/native-posix-locators
xml
settings/settings
settings/dummy-settings
C-Source-Files: unix-portability.c
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
All rights reserved.
License: See License.txt in this distribution for details.
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
Platforms: aarch64-darwin