|
| 1 | +From d6759f3711877792de6eae84616f0077c5089b1e Mon Sep 17 00:00:00 2001 |
| 2 | +From: Andy-Python-Programmer < [email protected]> |
| 3 | +Date: Fri, 31 Dec 2021 17:14:30 +1100 |
| 4 | +Subject: [PATCH] add support for aero |
| 5 | + |
| 6 | +Signed-off-by: Andy-Python-Programmer < [email protected]> |
| 7 | +--- |
| 8 | + .vscode/settings.json | 3 +++ |
| 9 | + configure | 2 +- |
| 10 | + include/stdarg.h | 6 ++++++ |
| 11 | + lib/Makefile | 8 ++++---- |
| 12 | + libtcc.c | 4 ++-- |
| 13 | + tcc.c | 4 +++- |
| 14 | + tcc.h | 4 ++++ |
| 15 | + tccelf.c | 2 ++ |
| 16 | + 8 files changed, 25 insertions(+), 8 deletions(-) |
| 17 | + create mode 100644 .vscode/settings.json |
| 18 | + |
| 19 | +diff --git a/.vscode/settings.json b/.vscode/settings.json |
| 20 | +new file mode 100644 |
| 21 | +index 0000000..560faaa |
| 22 | +--- /dev/null |
| 23 | ++++ b/.vscode/settings.json |
| 24 | +@@ -0,0 +1,3 @@ |
| 25 | ++{ |
| 26 | ++ "editor.formatOnSave": false, |
| 27 | ++} |
| 28 | +\ No newline at end of file |
| 29 | +diff --git a/configure b/configure |
| 30 | +index 1ee3acb..cab20ed 100755 |
| 31 | +--- a/configure |
| 32 | ++++ b/configure |
| 33 | +@@ -49,7 +49,7 @@ gcc_major=0 |
| 34 | + gcc_minor=0 |
| 35 | + |
| 36 | + # OS specific |
| 37 | +-targetos=`uname` |
| 38 | ++targetos=Aero |
| 39 | + case $targetos in |
| 40 | + Darwin) |
| 41 | + confvars="$confvars OSX" |
| 42 | +diff --git a/include/stdarg.h b/include/stdarg.h |
| 43 | +index 10ce733..405ac68 100644 |
| 44 | +--- a/include/stdarg.h |
| 45 | ++++ b/include/stdarg.h |
| 46 | +@@ -1,6 +1,10 @@ |
| 47 | + #ifndef _STDARG_H |
| 48 | + #define _STDARG_H |
| 49 | + |
| 50 | ++#ifdef __need___va_list |
| 51 | ++typedef char *__gnuc_va_list; |
| 52 | ++#else |
| 53 | ++ |
| 54 | + #ifdef __x86_64__ |
| 55 | + #ifndef _WIN64 |
| 56 | + |
| 57 | +@@ -76,4 +80,6 @@ typedef char *va_list; |
| 58 | + typedef va_list __gnuc_va_list; |
| 59 | + #define _VA_LIST_DEFINED |
| 60 | + |
| 61 | ++#endif |
| 62 | ++ |
| 63 | + #endif /* _STDARG_H */ |
| 64 | +diff --git a/lib/Makefile b/lib/Makefile |
| 65 | +index 0c1ec54..c546dff 100644 |
| 66 | +--- a/lib/Makefile |
| 67 | ++++ b/lib/Makefile |
| 68 | +@@ -20,18 +20,18 @@ XCFG = $(or $(findstring -win,$T),-unx) |
| 69 | + # in order to use gcc, tyoe: make <target>-libtcc1-usegcc=yes |
| 70 | + arm-libtcc1-usegcc ?= no |
| 71 | + |
| 72 | +-ifeq "$($(T)-libtcc1-usegcc)" "yes" |
| 73 | ++#ifeq "$($(T)-libtcc1-usegcc)" "yes" |
| 74 | + XCC = $(CC) |
| 75 | + XAR = $(AR) |
| 76 | + XFLAGS = $(CFLAGS) -fPIC |
| 77 | +-endif |
| 78 | ++#endif |
| 79 | + |
| 80 | + # only for native compiler |
| 81 | + $(X)BCHECK_O = bcheck.o |
| 82 | + |
| 83 | +-ifeq ($(CONFIG_musl)$(CONFIG_uClibc),yes) |
| 84 | ++#ifeq ($(CONFIG_musl)$(CONFIG_uClibc),yes) |
| 85 | + BCHECK_O = |
| 86 | +-endif |
| 87 | ++#endif |
| 88 | + |
| 89 | + ifdef CONFIG_OSX |
| 90 | + XFLAGS += -D_ANSI_SOURCE |
| 91 | +diff --git a/libtcc.c b/libtcc.c |
| 92 | +index 1e9dd97..30d27f0 100644 |
| 93 | +--- a/libtcc.c |
| 94 | ++++ b/libtcc.c |
| 95 | +@@ -975,8 +975,8 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) |
| 96 | + if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) && |
| 97 | + !s->nostdlib) { |
| 98 | + if (output_type != TCC_OUTPUT_DLL) |
| 99 | +- tcc_add_crt(s, "crt1.o"); |
| 100 | +- tcc_add_crt(s, "crti.o"); |
| 101 | ++ tcc_add_crt(s, "crt0.o"); |
| 102 | ++ //tcc_add_crt(s, "crti.o"); |
| 103 | + } |
| 104 | + #endif |
| 105 | + return 0; |
| 106 | +diff --git a/tcc.c b/tcc.c |
| 107 | +index cd887d1..1bb0c24 100644 |
| 108 | +--- a/tcc.c |
| 109 | ++++ b/tcc.c |
| 110 | +@@ -1,6 +1,6 @@ |
| 111 | + /* |
| 112 | + * TCC - Tiny C Compiler |
| 113 | +- * |
| 114 | ++ * |
| 115 | + * Copyright (c) 2001-2004 Fabrice Bellard |
| 116 | + * |
| 117 | + * This library is free software; you can redistribute it and/or |
| 118 | +@@ -162,6 +162,8 @@ static const char version[] = |
| 119 | + " Darwin" |
| 120 | + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
| 121 | + " FreeBSD" |
| 122 | ++#elif defined(__aero__) |
| 123 | ++ " Aero" |
| 124 | + #else |
| 125 | + " Linux" |
| 126 | + #endif |
| 127 | +diff --git a/tcc.h b/tcc.h |
| 128 | +index cd67973..e42f5fe 100644 |
| 129 | +--- a/tcc.h |
| 130 | ++++ b/tcc.h |
| 131 | +@@ -162,6 +162,8 @@ extern long double strtold (const char *__nptr, char **__endptr); |
| 132 | + # endif |
| 133 | + #endif |
| 134 | + |
| 135 | ++#if 0 |
| 136 | ++ |
| 137 | + #if defined TCC_IS_NATIVE && !defined CONFIG_TCCBOOT |
| 138 | + # define CONFIG_TCC_BACKTRACE |
| 139 | + # if (defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64) \ |
| 140 | +@@ -170,6 +172,8 @@ extern long double strtold (const char *__nptr, char **__endptr); |
| 141 | + # endif |
| 142 | + #endif |
| 143 | + |
| 144 | ++#endif |
| 145 | ++ |
| 146 | + /* ------------ path configuration ------------ */ |
| 147 | + |
| 148 | + #ifndef CONFIG_SYSROOT |
| 149 | +diff --git a/tccelf.c b/tccelf.c |
| 150 | +index 70d47e1..994ee59 100644 |
| 151 | +--- a/tccelf.c |
| 152 | ++++ b/tccelf.c |
| 153 | +@@ -1202,8 +1202,10 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) |
| 154 | + #endif |
| 155 | + tcc_add_support(s1, TCC_LIBTCC1); |
| 156 | + /* add crt end if not memory output */ |
| 157 | ++ /* |
| 158 | + if (s1->output_type != TCC_OUTPUT_MEMORY) |
| 159 | + tcc_add_crt(s1, "crtn.o"); |
| 160 | ++ */ |
| 161 | + } |
| 162 | + } |
| 163 | + |
| 164 | +-- |
| 165 | +2.25.1 |
| 166 | + |
0 commit comments