Skip to content

Commit ecbfad5

Browse files
committed
newpkg(tur/opendylan): 2024.1
1 parent d129764 commit ecbfad5

File tree

6 files changed

+188
-0
lines changed

6 files changed

+188
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/sources/jamfiles/aarch64-linux-build.jam b/sources/jamfiles/aarch64-linux-build.jam
2+
index 50c5eea38..fe1dad42f 100644
3+
--- a/sources/jamfiles/aarch64-linux-build.jam
4+
+++ b/sources/jamfiles/aarch64-linux-build.jam
5+
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
6+
#
7+
# Overrides/redefinitions
8+
#
9+
-rtclibs += -lpthread -ldl -lrt ;
10+
+rtclibs += -ldl ;
11+
diff --git a/sources/jamfiles/arm-linux-build.jam b/sources/jamfiles/arm-linux-build.jam
12+
index 7d07ffec8..0d5319a85 100644
13+
--- a/sources/jamfiles/arm-linux-build.jam
14+
+++ b/sources/jamfiles/arm-linux-build.jam
15+
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
16+
#
17+
# Overrides/redefinitions
18+
#
19+
-rtclibs += -lpthread -ldl -lrt ;
20+
+rtclibs += -ldl ;
21+
diff --git a/sources/jamfiles/riscv64-linux-build.jam b/sources/jamfiles/riscv64-linux-build.jam
22+
index 4c70f2835..8c95d3589 100644
23+
--- a/sources/jamfiles/riscv64-linux-build.jam
24+
+++ b/sources/jamfiles/riscv64-linux-build.jam
25+
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
26+
#
27+
# Overrides/redefinitions
28+
#
29+
-rtclibs += -lpthread -ldl -lrt ;
30+
+rtclibs += -ldl -lrt ;
31+
diff --git a/sources/jamfiles/x86-linux-build.jam b/sources/jamfiles/x86-linux-build.jam
32+
index b811fc404..6acc56114 100644
33+
--- a/sources/jamfiles/x86-linux-build.jam
34+
+++ b/sources/jamfiles/x86-linux-build.jam
35+
@@ -24,4 +24,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
36+
#
37+
# Overrides/redefinitions
38+
#
39+
-rtclibs += -lpthread -ldl -lrt ;
40+
+rtclibs += -ldl ;
41+
diff --git a/sources/jamfiles/x86_64-linux-build.jam b/sources/jamfiles/x86_64-linux-build.jam
42+
index ea88e95ab..8e125bde3 100644
43+
--- a/sources/jamfiles/x86_64-linux-build.jam
44+
+++ b/sources/jamfiles/x86_64-linux-build.jam
45+
@@ -24,4 +24,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
46+
#
47+
# Overrides/redefinitions
48+
#
49+
-rtclibs += -lpthread -ldl -lrt ;
50+
+rtclibs += -ldl ;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/sources/jamfiles/posix-build.jam b/sources/jamfiles/posix-build.jam
2+
index 47b798368..0d878f54f 100644
3+
--- a/sources/jamfiles/posix-build.jam
4+
+++ b/sources/jamfiles/posix-build.jam
5+
@@ -53,6 +53,7 @@ OBJCOPY ?= objcopy ;
6+
STRIP ?= strip ;
7+
8+
CCFLAGS += -fPIC ;
9+
+echo $(CCFLAGS) ;
10+
11+
LINK ?= $(CC) ;
12+
UNIFYLINK ?= $(CC) -Bstatic ;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/sources/lib/run-time/x86-linux-exceptions.c b/sources/lib/run-time/x86-linux-exceptions.c
2+
index 0c4150a1e..7bda60f2b 100644
3+
--- a/sources/lib/run-time/x86-linux-exceptions.c
4+
+++ b/sources/lib/run-time/x86-linux-exceptions.c
5+
@@ -10,7 +10,9 @@
6+
#include <signal.h>
7+
#include <sys/ucontext.h>
8+
#include <ucontext.h>
9+
+#ifndef __ANDROID__
10+
#include <fpu_control.h>
11+
+#endif
12+
13+
#include "stack-walker.h"
14+
15+
@@ -46,11 +48,15 @@ extern void dylan_float_underflow_handler();
16+
/* FPU Control Word mask enabling exceptions for divide-by-zero,
17+
* invalid, overflow, and underflow
18+
*/
19+
+#ifndef __ANDROID__
20+
#define DYLAN_FPU_CW (_FPU_DEFAULT \
21+
& ~(_FPU_MASK_ZM \
22+
| _FPU_MASK_IM \
23+
| _FPU_MASK_OM \
24+
| _FPU_MASK_UM))
25+
+#else
26+
+#define DYLAN_FPU_CW 0
27+
+#endif
28+
29+
static inline void chain_sigaction(const struct sigaction *act,
30+
int sig, siginfo_t *info, void *uap)
31+
@@ -159,7 +165,9 @@ static void EstablishDylanExceptionHandlers(void)
32+
33+
/* Set the FPU control word */
34+
cw = DYLAN_FPU_CW;
35+
+ #ifndef __ANDROID__
36+
_FPU_SETCW(cw);
37+
+ #endif
38+
}
39+
40+
static void RemoveDylanExceptionHandlers (void)
41+
@@ -176,7 +184,9 @@ void RestoreFPState (ucontext_t *uc)
42+
if (uc->uc_mcontext.fpregs) {
43+
uc->uc_mcontext.fpregs->cw = cw;
44+
}
45+
+ #ifndef __ANDROID__
46+
_FPU_SETCW(cw);
47+
+ #endif
48+
}
49+
50+
static void DylanFPEHandler (int sig, siginfo_t *info, void *uap)

tur/opendylan/build.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
TERMUX_PKG_HOMEPAGE=https://opendylan.org
2+
TERMUX_PKG_DESCRIPTION="Open Dylan is a compiler and a set of libraries for the Dylan programming language."
3+
TERMUX_PKG_LICENSE="custom"
4+
TERMUX_PKG_LICENSE_FILE="License.txt"
5+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
6+
TERMUX_PKG_VERSION=2024.1.0
7+
TERMUX_PKG_SRCURL=git+https://github.com/dylan-lang/opendylan
8+
TERMUX_PKG_DEPENDS="clang, lld, libgc"
9+
TERMUX_PKG_BUILD_IN_SRC=true
10+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
11+
--with-gc=${TERMUX_PREFIX}
12+
--with-harp-collector=boehm
13+
"
14+
15+
termux_step_pre_configure() {
16+
curl -Lo "${TERMUX_PKG_CACHEDIR}/opendylan.tar.bz2" https://github.com/dylan-lang/opendylan/releases/download/v2024.1.0/opendylan-2024.1-x86_64-linux.tar.bz2
17+
tar -xf "${TERMUX_PKG_CACHEDIR}/opendylan.tar.bz2" -C "${TERMUX_PKG_CACHEDIR}"
18+
export PATH="$PATH:${TERMUX_PKG_CACHEDIR}/opendylan-2024.1/bin"
19+
20+
case "${TARGET_ARCH:=${TERMUX_ARCH}}" in
21+
i686) TARGET_ARCH=x86 ;;
22+
esac
23+
export OPEN_DYLAN_TARGET_PLATFORM="${TARGET_ARCH}-linux"
24+
25+
CFLAGS+=" -Wno-error=int-conversion"
26+
./autogen.sh
27+
}
28+
29+
termux_step_make() {
30+
pushd "sources/lib/run-time"
31+
32+
make -j "${TERMUX_PKG_MAKE_PROCESSES}" \
33+
OPEN_DYLAN_TARGET_PLATFORM="${OPEN_DYLAN_TARGET_PLATFORM}"
34+
35+
popd
36+
37+
dylan-compiler \
38+
-jobs "${TERMUX_PKG_MAKE_PROCESSES}" \
39+
-back-end c \
40+
-build-script "sources/jamfiles/${OPEN_DYLAN_TARGET_PLATFORM}-build.jam" \
41+
-build dylan-compiler -verbose
42+
43+
dylan-compiler \
44+
-jobs "${TERMUX_PKG_MAKE_PROCESSES}" \
45+
-back-end c \
46+
-build-script "sources/jamfiles/${OPEN_DYLAN_TARGET_PLATFORM}-build.jam" \
47+
-build dylan-tool -verbose
48+
49+
find ./_build
50+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/sources/jamfiles/config.jam.in b/sources/jamfiles/config.jam.in
2+
index 978b5c87f..947075766 100644
3+
--- a/sources/jamfiles/config.jam.in
4+
+++ b/sources/jamfiles/config.jam.in
5+
@@ -5,7 +5,7 @@
6+
SUPPORTED_COMPILER_BACK_ENDS ?= @SUPPORTED_COMPILER_BACK_ENDS@ ;
7+
8+
CC ?= @CC@ ;
9+
-CCFLAGS ?= @DISABLE_WARNINGS_CFLAGS@ @CFLAGS@ ;
10+
+CCFLAGS ?= -w @CFLAGS@ ;
11+
C++ ?= @CXX@ ;
12+
C++FLAGS ?= $(CCFLAGS) ;
13+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/sources/lib/run-time/Makefile.in b/sources/lib/run-time/Makefile.in
2+
index 9651c660c..4b1f884d3 100644
3+
--- a/sources/lib/run-time/Makefile.in
4+
+++ b/sources/lib/run-time/Makefile.in
5+
@@ -104,7 +104,7 @@ endif
6+
CC = @CC@
7+
AR = ar -rcs
8+
9+
-CFLAGS = $(PLATFORM_CFLAGS) -Wall -O -g -I$(srcdir) @DEFS@ @CPPFLAGS@
10+
+CFLAGS += $(PLATFORM_CFLAGS) -Wall -O -g -I$(srcdir) @DEFS@ @CPPFLAGS@
11+
LFLAGS = $(PLATFORM_LFLAGS)
12+
13+
HARP_CFLAGS = -DOPEN_DYLAN_BACKEND_HARP

0 commit comments

Comments
 (0)