Compare commits
2 Commits
49133dce48
...
8fa443879c
Author | SHA1 | Date |
---|---|---|
Bananymous | 8fa443879c | |
Bananymous | 3a465cb94f |
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash ../install.sh
|
||||
|
||||
NAME='tcc'
|
||||
VERSION='0.9.27'
|
||||
DOWNLOAD_URL="https://download.savannah.gnu.org/releases/tinycc/tcc-$VERSION.tar.bz2#de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c"
|
||||
|
||||
configure() {
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysroot=$BANAN_SYSROOT \
|
||||
--cpu=$BANAN_ARCH \
|
||||
--enable-cross \
|
||||
--cross-prefix=$BANAN_TOOLCHAIN_TRIPLE- \
|
||||
--sysincludepaths=/usr/include:/usr/lib/tcc/include \
|
||||
--libpaths=/usr/lib \
|
||||
--crtprefix=/usr/lib \
|
||||
--elfinterp=/usr/lib/DynamicLoader.so
|
||||
}
|
||||
|
||||
build() {
|
||||
make -j$(nproc) cross-$BANAN_ARCH $BANAN_ARCH-libtcc1-usegcc=yes || exit 1
|
||||
}
|
||||
|
||||
install() {
|
||||
make install-unx DESTDIR=$BANAN_SYSROOT || exit 1
|
||||
ln -sf $BANAN_ARCH-tcc $BANAN_SYSROOT/usr/bin/tcc
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
diff -ruN tcc-0.9.27/configure tcc-0.9.27-banan_os/configure
|
||||
--- tcc-0.9.27/configure 2017-12-17 10:27:05.000000000 +0200
|
||||
+++ tcc-0.9.27-banan_os/configure 2024-08-25 18:43:00.329466309 +0300
|
||||
@@ -49,8 +49,11 @@
|
||||
gcc_minor=0
|
||||
|
||||
# OS specific
|
||||
-targetos=`uname`
|
||||
+targetos='banan_os'
|
||||
case $targetos in
|
||||
+ banan_os)
|
||||
+ confvars="$confvars ldl=no lm=no"
|
||||
+ ;;
|
||||
Darwin)
|
||||
confvars="$confvars OSX"
|
||||
DLLSUF=".dylib"
|
||||
diff -ruN tcc-0.9.27/Makefile tcc-0.9.27-banan_os/Makefile
|
||||
--- tcc-0.9.27/Makefile 2017-12-17 10:27:05.000000000 +0200
|
||||
+++ tcc-0.9.27-banan_os/Makefile 2024-08-25 18:43:44.996196450 +0300
|
||||
@@ -30,7 +30,9 @@
|
||||
CFGWIN = -win
|
||||
NATIVE_TARGET = $(ARCH)-win$(if $(findstring arm,$(ARCH)),ce,32)
|
||||
else
|
||||
- LIBS=-lm
|
||||
+ ifneq ($(CONFIG_lm),no)
|
||||
+ LIBS=-lm
|
||||
+ endif
|
||||
ifneq ($(CONFIG_ldl),no)
|
||||
LIBS+=-ldl
|
||||
endif
|
|
@ -0,0 +1,23 @@
|
|||
diff -ruN tcc-0.9.27/lib/bcheck.c tcc-0.9.27-banan_os/lib/bcheck.c
|
||||
--- tcc-0.9.27/lib/bcheck.c 2017-12-17 10:27:05.000000000 +0200
|
||||
+++ tcc-0.9.27-banan_os/lib/bcheck.c 2024-08-25 22:29:43.193883000 +0300
|
||||
@@ -26,7 +26,8 @@
|
||||
&& !defined(__FreeBSD_kernel__) \
|
||||
&& !defined(__DragonFly__) \
|
||||
&& !defined(__OpenBSD__) \
|
||||
- && !defined(__NetBSD__)
|
||||
+ && !defined(__NetBSD__) \
|
||||
+ && !defined(__banan_os__)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
@@ -56,7 +57,8 @@
|
||||
|| defined(__OpenBSD__) \
|
||||
|| defined(__NetBSD__) \
|
||||
|| defined(__dietlibc__) \
|
||||
- || defined(_WIN32)
|
||||
+ || defined(_WIN32) \
|
||||
+ || defined(__banan_os__)
|
||||
//#warning Bound checking does not support malloc (etc.) in this environment.
|
||||
#undef CONFIG_TCC_MALLOC_HOOKS
|
||||
#undef HAVE_MEMALIGN
|
|
@ -0,0 +1,17 @@
|
|||
diff -ruN tcc-0.9.27/libtcc.c tcc-0.9.27-banan_os/libtcc.c
|
||||
--- tcc-0.9.27/libtcc.c 2017-12-17 10:27:05.000000000 +0200
|
||||
+++ tcc-0.9.27-banan_os/libtcc.c 2024-08-26 01:26:52.175524270 +0300
|
||||
@@ -971,11 +971,11 @@
|
||||
#else
|
||||
/* paths for crt objects */
|
||||
tcc_split_path(s, &s->crt_paths, &s->nb_crt_paths, CONFIG_TCC_CRTPREFIX);
|
||||
- /* add libc crt1/crti objects */
|
||||
+ /* add libc crt0/crti objects */
|
||||
if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) &&
|
||||
!s->nostdlib) {
|
||||
if (output_type != TCC_OUTPUT_DLL)
|
||||
- tcc_add_crt(s, "crt1.o");
|
||||
+ tcc_add_crt(s, "crt0.o");
|
||||
tcc_add_crt(s, "crti.o");
|
||||
}
|
||||
#endif
|
|
@ -567,6 +567,9 @@ static void handle_dynamic(LoadedElf& elf)
|
|||
syscall(SYS_CLOSE, library_fd);
|
||||
}
|
||||
|
||||
if (pltgot == 0)
|
||||
return;
|
||||
|
||||
// setup required GOT entries
|
||||
reinterpret_cast<uintptr_t*>(pltgot)[0] = reinterpret_cast<uintptr_t>(elf.dynamics);
|
||||
reinterpret_cast<uintptr_t*>(pltgot)[1] = reinterpret_cast<uintptr_t>(&elf);
|
||||
|
|
Loading…
Reference in New Issue