From f6ffb63f173a40826b731295555681d297987b88 Mon Sep 17 00:00:00 2001
From: Kooda <kooda@upyum.com>
Date: Fri, 14 Feb 2020 15:51:03 +0100
Subject: [PATCH] Make CHICKEN build with TCC
---
Makefile.linux | 4 ++--
chicken.h | 2 ++
csc.scm | 6 +++---
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Makefile.linux b/Makefile.linux
index cfa8c2c5..7f0fa06c 100644
a
|
b
|
C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer |
43 | 43 | endif |
44 | 44 | endif |
45 | 45 | LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared |
46 | | LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -L. -shared -Wl,-R"$(RUNTIME_LINKER_PATH)" |
47 | | LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,-R"$(RUNTIME_LINKER_PATH)" |
| 46 | LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -L. -shared -Wl,-rpath="$(RUNTIME_LINKER_PATH)" |
| 47 | LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,-rpath="$(RUNTIME_LINKER_PATH)" |
48 | 48 | LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,-soname,lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).so.$(BINARYVERSION) |
49 | 49 | LIBRARIES = -lm -ldl |
50 | 50 | NEEDS_RELINKING = yes |
diff --git a/chicken.h b/chicken.h
index 376b0a26..9816cfc9 100644
a
|
b
|
typedef void (C_ccall *C_proc)(C_word, C_word *) C_noret; |
1017 | 1017 | # else |
1018 | 1018 | # define C_stack_pointer ((C_word *)C_alloca(1)) |
1019 | 1019 | # endif |
| 1020 | #elif defined (__TINYC__) |
| 1021 | # define C_stack_pointer ((C_word *)C_alloca(1)) |
1020 | 1022 | #else |
1021 | 1023 | # define C_stack_pointer ((C_word *)C_alloca(0)) |
1022 | 1024 | #endif |
diff --git a/csc.scm b/csc.scm
index a3a89aa3..f78a1b81 100644
a
|
b
|
|
262 | 262 | (cond (elf |
263 | 263 | (list |
264 | 264 | (conc "-L" library-dir) |
265 | | (conc "-Wl,-R" |
| 265 | (conc "-Wl,-rpath=" |
266 | 266 | (if deployed |
267 | 267 | "$ORIGIN" |
268 | 268 | (if host-mode |
269 | 269 | host-libdir |
270 | 270 | TARGET_RUN_LIB_HOME))))) |
271 | 271 | (aix |
272 | | (list (conc "-Wl,-R\"" library-dir "\""))) |
| 272 | (list (conc "-Wl,-rpath\"" library-dir "\""))) |
273 | 273 | (else |
274 | 274 | (list (conc "-L" library-dir)))) |
275 | 275 | (if (and deployed (memq (software-version) '(freebsd openbsd netbsd))) |
… |
… |
EOF |
776 | 776 | (set! rpath (car rest)) |
777 | 777 | (when (and (memq (build-platform) '(gnu clang)) |
778 | 778 | (not mingw) (not osx)) |
779 | | (set! link-options (append link-options (list (string-append "-Wl,-R" rpath)))) ) |
| 779 | (set! link-options (append link-options (list (string-append "-Wl,-rpath=" rpath)))) ) |
780 | 780 | (set! rest (cdr rest)) ] |
781 | 781 | [(-host) #f] |
782 | 782 | ((-oi) |