History

replace native platform macros in the compiler

- The compiler should not use these - However tccrun.c & libtcc1.a files should use these Also: - use s1->loaded_dlls for loaded dlls instead of dlopens - alpine musl: fully supported now and tested - ./configure ... --config-backtrace=no : disable backtraces --config-bcheck=no : disable bcheck - tests:dlltest: enable by default - tccrun.c : simplify mmaps - __builtin_alloca : always use asm-alias (instead of #define) - tccpe.c : use write32le

grischka committed 5 years ago

Commit e2e62fc1 parent 02f61d513 files · +163 −202Browse files

Unified · Split

13 files
  1. Makefile +4 −1
  2. configure +4 −2
  3. lib/Makefile +7 −7
  4. lib/bcheck.c +4 −1
  5. libtcc.c +49 −51
  6. tcc.c +3 −3
  7. tcc.h +18 −18
  8. tccelf.c +33 −38
  9. tccpe.c +19 −25
  10. tccpp.c +3 −2
  11. tccrun.c +5 −19
  12. tests/Makefile +4 −24
  13. tests/tests2/Makefile +10 −11
Makefile+4−1
@@ -94,7 +94,10 @@ NATIVE_DEFINES_$(CONFIG_arm_eabi) += -DTCC_ARM_EABI · 93 unmodified lines
9494 NATIVE_DEFINES_$(CONFIG_arm_vfp) += -DTCC_ARM_VFP
9595 NATIVE_DEFINES_$(CONFIG_arm64) += -DTCC_TARGET_ARM64
9696 NATIVE_DEFINES_$(CONFIG_riscv64) += -DTCC_TARGET_RISCV64
97−NATIVE_DEFINES += $(NATIVE_DEFINES_yes)
97+NATIVE_DEFINES_$(CONFIG_BSD) += -DTARGETOS_$(TARGETOS)
98+NATIVE_DEFINES_no_$(CONFIG_bcheck) += -DCONFIG_TCC_BCHECK=0
99+NATIVE_DEFINES_no_$(CONFIG_backtrace) += -DCONFIG_TCC_BACKTRACE=0
100+NATIVE_DEFINES += $(NATIVE_DEFINES_yes) $(NATIVE_DEFINES_no_no)
98101
99102 ifeq ($(INCLUDED),no)
100103 # --------------------------------------------------------------------------
configure+4−2
@@ -55,7 +55,7 @@ ar_set= · 54 unmodified lines
5555 targetos=`uname`
5656 case $targetos in
5757 Darwin)
58− confvars="$confvars OSX"
58+ confvars="$confvars OSX dll=no"
5959 cc=`which cc`
6060 cc=`readlink $cc`
6161 tcc_usrinclude="`xcrun --show-sdk-path`/usr/include"
@@ -63,9 +63,10 @@ case $targetos in · 1 unmodified line
6363 ;;
6464 Windows_NT|MINGW*|MSYS*|CYGWIN*)
6565 mingw32=yes
66+ targetos=WIN32
6667 ;;
6768 DragonFly|OpenBSD|FreeBSD|NetBSD)
68− confvars="$confvars ldl=no"
69+ confvars="$confvars BSD ldl=no"
6970 ;;
7071 *)
7172 ;;
@@ -311,6 +312,7 @@ Advanced options (experts only): · 239 unmodified lines
311312 --elfinterp=... specify elf interpreter
312313 --triplet=... specify system library/include directory triplet
313314 --config-uClibc,-musl,-mingw32... enable system specific configurations
315+ --config-bcheck=no/-backtrace=no disable bounds checker/stack backtraces
314316 EOF
315317 #echo "NOTE: The object files are build at the place where configure is launched"
316318 exit 1
lib/Makefile+7−7
@@ -30,17 +30,17 @@ ifeq "$($(T)-libtcc1-usegcc)" "yes" · 29 unmodified lines
3030 XFLAGS = $(CFLAGS) -fPIC -gstabs -fno-omit-frame-pointer -Wno-unused-function -Wno-unused-variable
3131 endif
3232
33+ifneq ($(CONFIG_backtrace),no)
3334 # only for native compiler
35+ifneq ($(CONFIG_bcheck),no)
3436 $(X)BCHECK_O = bcheck.o
37+endif
3538 $(X)BT_O = bt-exe.o bt-log.o
36−$(X)B_O = bcheck.o bt-exe.o bt-log.o bt-dll.o
37−
38−ifeq ($(CONFIG_musl)$(CONFIG_uClibc),yes)
39− BCHECK_O =
40−else
41− DSO_O = dsohandle.o
39+$(X)B_O = $(BCHECK_O) bt-exe.o bt-log.o bt-dll.o
4240 endif
4341
42+DSO_O = dsohandle.o
43+
4444 I386_O = libtcc1.o alloca86.o alloca86-bt.o $(BT_O)
4545 X86_64_O = libtcc1.o alloca86_64.o alloca86_64-bt.o $(BT_O)
4646 ARM_O = libtcc1.o armeabi.o alloca-arm.o armflush.o fetch_and_add_arm.o $(BT_O)
@@ -82,7 +82,7 @@ $(X)%.o : %.S · 35 unmodified lines
8282 $(TOP)/%.o : %.c
8383 $S$(XCC) -c $< -o $@ $(XFLAGS)
8484
85−$(TOP)/bcheck.o : XFLAGS += -g
85+$(TOP)/bcheck.o : XFLAGS += -g $(if (CONFIG_musl),-DTCC_MUSL)
8686 $(TOP)/bt-exe.o : $(TOP)/tccrun.c
8787
8888 $(X)crt1w.o : crt1.c
lib/bcheck.c+4−1
@@ -161,6 +161,9 @@ static pthread_spinlock_t bounds_spin; · 160 unmodified lines
161161 #define HAVE_TLS_FUNC (1)
162162 #define HAVE_TLS_VAR (0)
163163 #endif
164+#ifdef TCC_MUSL
165+# undef HAVE_CTYPE
166+#endif
164167 #endif
165168
166169 #if MALLOC_REDIR
@@ -1150,7 +1153,7 @@ void __attribute__((destructor)) __bound_exit(void) · 983 unmodified lines
11501153 dprintf(stderr, "%s, %s():\n", __FILE__, __FUNCTION__);
11511154
11521155 if (inited) {
1153−#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__)
1156+#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OpenBSD__) && !defined TCC_MUSL
11541157 if (print_heap) {
11551158 extern void __libc_freeres (void);
11561159 __libc_freeres ();
libtcc.c+49−51
@@ -880,7 +880,7 @@ LIBTCCAPI TCCState *tcc_new(void) · 879 unmodified lines
880880 tcc_define_symbol(s, "__linux__", NULL);
881881 tcc_define_symbol(s, "__linux", NULL);
882882 # endif
883−# if defined(__FreeBSD__)
883+# if TARGETOS_FreeBSD
884884 tcc_define_symbol(s, "__FreeBSD__", "12");
885885 /* No 'Thread Storage Local' on FreeBSD with tcc */
886886 tcc_define_symbol(s, "__NO_TLS", NULL);
@@ -889,10 +889,10 @@ LIBTCCAPI TCCState *tcc_new(void) · 2 unmodified lines
889889 tcc_define_symbol(s, "__int128_t", "struct { unsigned char _dummy[16]; }");
890890 # endif
891891 # endif
892−# if defined(__FreeBSD_kernel__)
892+# if TARGETOS_FreeBSD_kernel
893893 tcc_define_symbol(s, "__FreeBSD_kernel__", NULL);
894894 # endif
895−# if defined(__NetBSD__)
895+# if TARGETOS_NetBSD
896896 tcc_define_symbol(s, "__NetBSD__", "1");
897897 tcc_define_symbol(s, "__GNUC__", "4");
898898 tcc_define_symbol(s, "__GNUC_MINOR__", "0");
@@ -900,11 +900,10 @@ LIBTCCAPI TCCState *tcc_new(void) · 1 unmodified line
900900 tcc_define_symbol(s, "_Pragma(x)", "");
901901 tcc_define_symbol(s, "__ELF__", "1");
902902 # endif
903−# if defined(__OpenBSD__)
903+# if TARGETOS_OpenBSD
904904 tcc_define_symbol(s, "__OpenBSD__", "1");
905905 tcc_define_symbol(s, "_ANSI_LIBRARY", "1");
906906 tcc_define_symbol(s, "__GNUC__", "4");
907− tcc_define_symbol(s, "__builtin_alloca", "alloca"); /* as we claim GNUC */
908907 /* used by math.h */
909908 tcc_define_symbol(s, "__builtin_huge_val()", "1e500");
910909 tcc_define_symbol(s, "__builtin_huge_valf()", "1e50f");
@@ -940,17 +939,15 @@ LIBTCCAPI TCCState *tcc_new(void) · 29 unmodified lines
940939 /* wint_t is unsigned int by default, but (signed) int on BSDs
941940 and unsigned short on windows. Other OSes might have still
942941 other conventions, sigh. */
943−# if defined(__FreeBSD__) || defined (__FreeBSD_kernel__) \
944− || defined(__NetBSD__) || defined(__OpenBSD__)
942+# if TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel || TARGETOS_NetBSD || TARGETOS_OpenBSD
945943 tcc_define_symbol(s, "__WINT_TYPE__", "int");
946−# ifdef __FreeBSD__
944+# if TARGETOS_FreeBSD
947945 /* define __GNUC__ to have some useful stuff from sys/cdefs.h
948946 that are unconditionally used in FreeBSDs other system headers :/ */
949947 tcc_define_symbol(s, "__GNUC__", "9");
950948 tcc_define_symbol(s, "__GNUC_MINOR__", "3");
951949 tcc_define_symbol(s, "__GNUC_PATCHLEVEL__", "0");
952950 tcc_define_symbol(s, "__amd64__", "1");
953− tcc_define_symbol(s, "__builtin_alloca", "alloca");
954951 # endif
955952 # else
956953 tcc_define_symbol(s, "__WINT_TYPE__", "unsigned int");
@@ -969,7 +966,6 @@ LIBTCCAPI TCCState *tcc_new(void) · 12 unmodified lines
969966 tcc_define_symbol(s, "__GNUC__", "4"); /* darwin emits warning on GCC<4 */
970967 tcc_define_symbol(s, "__APPLE_CC__", "1"); /* for <TargetConditionals.h> */
971968 tcc_define_symbol(s, "_DONT_USE_CTYPE_INLINE_", "1");
972− tcc_define_symbol(s, "__builtin_alloca", "alloca"); /* as we claim GNUC */
973969 /* used by math.h */
974970 tcc_define_symbol(s, "__builtin_huge_val()", "1e500");
975971 tcc_define_symbol(s, "__builtin_huge_valf()", "1e50f");
@@ -1028,12 +1024,6 @@ LIBTCCAPI void tcc_delete(TCCState *s1) · 52 unmodified lines
10281024 dynarray_reset(&s1->target_deps, &s1->nb_target_deps);
10291025 dynarray_reset(&s1->pragma_libs, &s1->nb_pragma_libs);
10301026 dynarray_reset(&s1->argv, &s1->argc);
1031−#ifdef __OpenBSD__
1032− tcc_free(s1->dlopens);
1033− s1->dlopens = NULL;
1034− s1->nb_dlopens = 0;
1035−#endif
1036−
10371027 cstr_free(&s1->cmdline_defs);
10381028 cstr_free(&s1->cmdline_incl);
10391029 #ifdef TCC_IS_NATIVE
@@ -1115,24 +1105,24 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) · 75 unmodified lines
11151105 /* add libc crt1/crti objects */
11161106 if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) &&
11171107 !s->nostdlib) {
1118−#if defined(__OpenBSD__)
1108+#if TARGETOS_OpenBSD
11191109 if (output_type != TCC_OUTPUT_DLL)
11201110 tcc_add_crt(s, "crt0.o");
11211111 if (output_type == TCC_OUTPUT_DLL)
11221112 tcc_add_crt(s, "crtbeginS.o");
11231113 else
11241114 tcc_add_crt(s, "crtbegin.o");
1125−#elif defined(__FreeBSD__)
1115+#elif TARGETOS_FreeBSD
11261116 if (output_type != TCC_OUTPUT_DLL)
11271117 tcc_add_crt(s, "crt1.o");
11281118 tcc_add_crt(s, "crti.o");
11291119 tcc_add_crt(s, "crtbegin.o");
1130−#elif defined(__NetBSD__)
1120+#elif TARGETOS_NetBSD
11311121 if (output_type != TCC_OUTPUT_DLL)
11321122 tcc_add_crt(s, "crt0.o");
11331123 tcc_add_crt(s, "crti.o");
11341124 tcc_add_crt(s, "crtbegin.o");
1135−#elif !defined(TCC_TARGET_MACHO)
1125+#elif !TCC_TARGET_MACHO
11361126 /* Mach-O with LC_MAIN doesn't need any crt startup code. */
11371127 if (output_type != TCC_OUTPUT_DLL)
11381128 tcc_add_crt(s, "crt1.o");
@@ -1155,16 +1145,26 @@ LIBTCCAPI int tcc_add_sysinclude_path(TCCState *s, const char *pathname) · 16 unmodified lines
11551145 return 0;
11561146 }
11571147
1148+#if !defined TCC_TARGET_MACHO || defined TCC_IS_NATIVE
1149+ST_FUNC DLLReference *tcc_add_dllref(TCCState *s1, const char *dllname)
1150+{
1151+ DLLReference *ref = tcc_mallocz(sizeof(DLLReference) + strlen(dllname));
1152+ strcpy(ref->name, dllname);
1153+ dynarray_add(&s1->loaded_dlls, &s1->nb_loaded_dlls, ref);
1154+ return ref;
1155+}
1156+#endif
1157+
11581158 ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags)
11591159 {
1160− int fd, ret;
1160+ int fd, ret = -1;
11611161
11621162 /* open the file */
11631163 fd = _tcc_open(s1, filename);
11641164 if (fd < 0) {
11651165 if (flags & AFF_PRINT_ERROR)
11661166 tcc_error_noabort("file '%s' not found", filename);
1167− return -1;
1167+ return ret;
11681168 }
11691169
11701170 s1->current_filename = filename;
@@ -1181,55 +1181,53 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags) · 10 unmodified lines
11811181 #endif
11821182
11831183 switch (obj_type) {
1184+
11841185 case AFF_BINTYPE_REL:
11851186 ret = tcc_load_object_file(s1, fd, 0);
11861187 break;
1187−#ifndef TCC_TARGET_PE
1188+
1189+ case AFF_BINTYPE_AR:
1190+ ret = tcc_load_archive(s1, fd, !(flags & AFF_WHOLE_ARCHIVE));
1191+ break;
1192+
1193+#ifdef TCC_TARGET_PE
1194+ default:
1195+ ret = pe_load_file(s1, fd, filename);
1196+#else
11881197 case AFF_BINTYPE_DYN:
11891198 if (s1->output_type == TCC_OUTPUT_MEMORY) {
1190− ret = 0;
11911199 #ifdef TCC_IS_NATIVE
1192− {
1193− void *dl = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY);
1194− if (NULL == dl)
1195− ret = -1;
1196−#ifdef __OpenBSD__
1197− else
1198− dynarray_add(&s1->dlopens, &s1->nb_dlopens, dl);
1199−#endif
1200− }
1200+ void *dl = dlopen(filename, RTLD_GLOBAL | RTLD_LAZY);
1201+ if (dl) {
1202+ tcc_add_dllref(s1, filename)->handle = dl;
1203+ ret = 0;
1204+ }
12011205 #endif
1202− } else {
1203−#ifndef TCC_TARGET_MACHO
1204− ret = tcc_load_dll(s1, fd, filename,
1205− (flags & AFF_REFERENCED_DLL) != 0);
1206+ break;
1207+ }
1208+#ifdef TCC_TARGET_MACHO
1209+ ret = macho_load_dll(s1, fd, filename,
1210+ (flags & AFF_REFERENCED_DLL) != 0);
12061211 #else
1207− ret = macho_load_dll(s1, fd, filename,
1208− (flags & AFF_REFERENCED_DLL) != 0);
1212+ ret = tcc_load_dll(s1, fd, filename,
1213+ (flags & AFF_REFERENCED_DLL) != 0);
12091214 #endif
1210− }
1211− break;
1212−#endif
1213− case AFF_BINTYPE_AR:
1214− ret = tcc_load_archive(s1, fd, !(flags & AFF_WHOLE_ARCHIVE));
12151215 break;
1216+
12161217 #ifdef TCC_TARGET_COFF
12171218 case AFF_BINTYPE_C67:
12181219 ret = tcc_load_coff(s1, fd);
12191220 break;
12201221 #endif
12211222 default:
1222−#ifdef TCC_TARGET_PE
1223− ret = pe_load_file(s1, filename, fd);
1224−#elif defined(TCC_TARGET_MACHO)
1225− ret = -1;
1226−#else
1223+#ifndef TCC_TARGET_MACHO
12271224 /* as GNU ld, consider it is an ld script if not recognized */
12281225 ret = tcc_load_ldscript(s1, fd);
12291226 #endif
1227+
1228+#endif /* !TCC_TARGET_PE */
12301229 if (ret < 0)
1231− tcc_error_noabort("%s: unrecognized file type %d", filename,
1232− obj_type);
1230+ tcc_error_noabort("%s: unrecognized file type", filename);
12331231 break;
12341232 }
12351233 close(fd);
tcc.c+3−3
@@ -169,11 +169,11 @@ static const char version[] = · 168 unmodified lines
169169 " Windows"
170170 #elif defined(TCC_TARGET_MACHO)
171171 " Darwin"
172−#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
172+#elif TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel
173173 " FreeBSD"
174−#elif defined(__OpenBSD__)
174+#elif TARGETOS_OpenBSD
175175 " OpenBSD"
176−#elif defined(__NetBSD__)
176+#elif TARGETOS_NetBSD
177177 " NetBSD"
178178 #else
179179 " Linux"
tcc.h+18−18
@@ -184,13 +184,16 @@ extern long double strtold (const char *__nptr, char **__endptr); · 183 unmodified lines
184184 # endif
185185 #endif
186186
187−#if defined TCC_IS_NATIVE && !defined CONFIG_TCCBOOT
188−# define CONFIG_TCC_BACKTRACE
189−# if (defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64 || \
190− defined TCC_TARGET_ARM || defined TCC_TARGET_ARM64 || \
191− defined TCC_TARGET_RISCV64) \
192− && !defined TCC_UCLIBC && !defined TCC_MUSL
193−# define CONFIG_TCC_BCHECK /* enable bound checking code */
187+#if !defined TCC_IS_NATIVE \
188+ || (defined CONFIG_TCC_BACKTRACE && CONFIG_TCC_BACKTRACE==0)
189+# undef CONFIG_TCC_BACKTRACE
190+# undef CONFIG_TCC_BCHECK
191+#else
192+# define CONFIG_TCC_BACKTRACE 1
193+# if defined CONFIG_TCC_BCHECK && CONFIG_TCC_BCHECK==0
194+# undef CONFIG_TCC_BCHECK
195+# else
196+# define CONFIG_TCC_BCHECK 1 /* enable bound checking code */
194197 # endif
195198 #endif
196199
@@ -254,9 +257,9 @@ extern long double strtold (const char *__nptr, char **__endptr); · 57 unmodified lines
254257
255258 /* name of ELF interpreter */
256259 #ifndef CONFIG_TCC_ELFINTERP
257−# if defined __FreeBSD__
260+# if TARGETOS_FreeBSD
258261 # define CONFIG_TCC_ELFINTERP "/libexec/ld-elf.so.1"
259−# elif defined __FreeBSD_kernel__
262+# elif TARGETOS_FreeBSD_kernel
260263 # if defined(TCC_TARGET_X86_64)
261264 # define CONFIG_TCC_ELFINTERP "/lib/ld-kfreebsd-x86-64.so.1"
262265 # else
@@ -264,7 +267,7 @@ extern long double strtold (const char *__nptr, char **__endptr); · 1 unmodified line
264267 # endif
265268 # elif defined __DragonFly__
266269 # define CONFIG_TCC_ELFINTERP "/usr/libexec/ld-elf.so.2"
267−# elif defined __NetBSD__
270+# elif TARGETOS_NetBSD
268271 # define CONFIG_TCC_ELFINTERP "/usr/libexec/ld.elf_so"
269272 # elif defined __GNU__
270273 # define CONFIG_TCC_ELFINTERP "/lib/ld.so"
@@ -282,7 +285,7 @@ extern long double strtold (const char *__nptr, char **__endptr); · 11 unmodified lines
282285 # if defined(TCC_MUSL)
283286 # define CONFIG_TCC_ELFINTERP "/lib/ld-musl-x86_64.so.1"
284287 # else
285−# if defined(__OpenBSD__)
288+# if TARGETOS_OpenBSD
286289 # define CONFIG_TCC_ELFINTERP "/usr/libexec/ld.so"
287290 # else
288291 # define CONFIG_TCC_ELFINTERP "/lib64/ld-linux-x86-64.so.2"
@@ -793,12 +796,6 @@ struct TCCState { · 504 unmodified lines
793796 char **crt_paths;
794797 int nb_crt_paths;
795798
796−#ifdef __OpenBSD__
797− /* track dlopen */
798− void **dlopens;
799− int nb_dlopens;
800−#endif
801−
802799 /* -D / -U options */
803800 CString cmdline_defs;
804801 /* -include options */
@@ -1309,6 +1306,9 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int *argc, char ***argv, int optind); · 504 unmodified lines
13091306 #ifdef _WIN32
13101307 ST_FUNC char *normalize_slashes(char *path);
13111308 #endif
1309+#if !defined TCC_TARGET_MACHO || defined TCC_IS_NATIVE
1310+ST_FUNC DLLReference *tcc_add_dllref(TCCState *s1, const char *dllname);
1311+#endif
13121312
13131313 /* tcc_parse_args return codes: */
13141314 #define OPT_HELP 1
@@ -1743,7 +1743,7 @@ ST_FUNC void asm_clobber(uint8_t *clobber_regs, const char *str); · 428 unmodified lines
17431743
17441744 /* ------------ tccpe.c -------------- */
17451745 #ifdef TCC_TARGET_PE
1746−ST_FUNC int pe_load_file(struct TCCState *s1, const char *filename, int fd);
1746+ST_FUNC int pe_load_file(struct TCCState *s1, int fd, const char *filename);
17471747 ST_FUNC int pe_output_file(TCCState * s1, const char *filename);
17481748 ST_FUNC int pe_putimport(TCCState *s1, int dllindex, const char *name, addr_t value);
17491749 #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
tccelf.c+33−38
@@ -94,7 +94,7 @@ ST_FUNC void tccelf_stab_new(TCCState *s) · 93 unmodified lines
9494 #ifdef CONFIG_TCC_BACKTRACE
9595 /* include stab info with standalone backtrace support */
9696 if (s->do_backtrace && s->output_type != TCC_OUTPUT_MEMORY)
97− shf = SHF_ALLOC;
97+ shf = SHF_ALLOC | SHF_WRITE; // SHF_WRITE needed for musl/SELINUX
9898 #endif
9999 stab_section = new_section(s, ".stab", SHT_PROGBITS, shf);
100100 stab_section->sh_entsize = sizeof(Stab_Sym);
@@ -906,20 +906,15 @@ ST_FUNC void relocate_syms(TCCState *s1, Section *symtab, int do_resolve) · 805 unmodified lines
906906 /* Use ld.so to resolve symbol for us (for tcc -run) */
907907 if (do_resolve) {
908908 #if defined TCC_IS_NATIVE && !defined TCC_TARGET_PE
909−#ifdef TCC_TARGET_MACHO
910− /* The symbols in the symtables have a prepended '_'
911− but dlsym() needs the undecorated name. */
912− void *addr = dlsym(RTLD_DEFAULT, name + 1);
913−#else
914− void *addr = dlsym(RTLD_DEFAULT, name);
915−#ifdef __OpenBSD__
909+ /* dlsym() needs the undecorated name. */
910+ void *addr = dlsym(RTLD_DEFAULT, &name[s1->leading_underscore]);
911+#if TARGETOS_OpenBSD
916912 if (addr == NULL) {
917913 int i;
918− for (i = 0; i < s1->nb_dlopens; i++)
919− if ((addr = dlsym(s1->dlopens[i], name)))
914+ for (i = 0; i < s1->nb_loaded_dlls; i++)
915+ if ((addr = dlsym(s1->loaded_dlls[i]->handle, name)))
920916 break;
921917 }
922−#endif
923918 #endif
924919 if (addr) {
925920 sym->st_value = (addr_t) addr;
@@ -1421,7 +1416,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 495 unmodified lines
14211416 #ifdef CONFIG_TCC_BCHECK
14221417 if (s1->do_bounds_check && s1->output_type != TCC_OUTPUT_DLL) {
14231418 tcc_add_library_err(s1, "pthread");
1424−#if !defined(__OpenBSD__) && !defined(__NetBSD__)
1419+#if !TARGETOS_OpenBSD && !TARGETOS_NetBSD
14251420 tcc_add_library_err(s1, "dl");
14261421 #endif
14271422 tcc_add_support(s1, "bcheck.o");
@@ -1439,13 +1434,13 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 11 unmodified lines
14391434 #endif
14401435 if (strlen(TCC_LIBTCC1) > 0)
14411436 tcc_add_support(s1, TCC_LIBTCC1);
1442−#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
1437+#if TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD
14431438 /* add crt end if not memory output */
14441439 if (s1->output_type == TCC_OUTPUT_DLL)
14451440 tcc_add_crt(s1, "crtendS.o");
14461441 else if (s1->output_type != TCC_OUTPUT_MEMORY) {
14471442 tcc_add_crt(s1, "crtend.o");
1448−#if defined(__FreeBSD__) || defined(__NetBSD__)
1443+#if TARGETOS_FreeBSD || TARGETOS_NetBSD
14491444 tcc_add_crt(s1, "crtn.o");
14501445 #endif
14511446 }
@@ -1806,7 +1801,7 @@ struct dyn_inf { · 354 unmodified lines
18061801 unsigned long data_offset;
18071802 addr_t rel_addr;
18081803 addr_t rel_size;
1809−#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
1804+#if TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel
18101805 addr_t bss_addr;
18111806 addr_t bss_size;
18121807 #endif
@@ -1818,23 +1813,26 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, int phnum, · 5 unmodified lines
18181813 Section *interp, Section* strsec,
18191814 struct dyn_inf *dyninf, int *sec_order)
18201815 {
1821− int i, j, k, file_type, sh_order_index, file_offset;
1822− unsigned long s_align;
1823− long long tmp;
1824− addr_t addr;
1825− ElfW(Phdr) *ph;
1816+ int i, sh_order_index, file_offset;
18261817 Section *s;
18271818
1828− file_type = s1->output_type;
18291819 sh_order_index = 1;
18301820 file_offset = 0;
18311821 if (s1->output_format == TCC_OUTPUT_FORMAT_ELF)
18321822 file_offset = sizeof(ElfW(Ehdr)) + phnum * sizeof(ElfW(Phdr));
1833− s_align = ELF_PAGE_SIZE;
1834− if (s1->section_align)
1835− s_align = s1->section_align;
18361823
1837− if (phnum > 0) {
1824+#ifndef ELF_OBJ_ONLY
1825+ if (phnum > 0) { /* phnum is 0 for TCC_OUTPUT_OBJ */
1826+ unsigned long s_align;
1827+ long long tmp;
1828+ addr_t addr;
1829+ ElfW(Phdr) *ph;
1830+ int j, k, file_type = s1->output_type;
1831+
1832+ s_align = ELF_PAGE_SIZE;
1833+ if (s1->section_align)
1834+ s_align = s1->section_align;
1835+
18381836 if (s1->has_text_addr) {
18391837 int a_offset, p_offset;
18401838 addr = s1->text_addr;
@@ -1863,7 +1861,7 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, int phnum, · 22 unmodified lines
18631861
18641862 /* dynamic relocation table information, for .dynamic section */
18651863 dyninf->rel_addr = dyninf->rel_size = 0;
1866−#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
1864+#if TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel
18671865 dyninf->bss_addr = dyninf->bss_size = 0;
18681866 #endif
18691867
@@ -1934,7 +1932,7 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, int phnum, · 64 unmodified lines
19341932 }
19351933 /* update dynamic relocation infos */
19361934 if (s->sh_type == SHT_RELX) {
1937−#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
1935+#if TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel
19381936 if (!strcmp(strsec->data + s->sh_name, ".rel.got")) {
19391937 dyninf->rel_addr = addr;
19401938 dyninf->rel_size += s->sh_size; /* XXX only first rel. */
@@ -1979,6 +1977,7 @@ static int layout_sections(TCCState *s1, ElfW(Phdr) *phdr, int phnum, · 38 unmodified lines
19791977 }
19801978 }
19811979 }
1980+#endif /* ELF_OBJ_ONLY */
19821981
19831982 /* all other sections come after */
19841983 for(i = 1; i < s1->nb_sections; i++) {
@@ -2080,7 +2079,7 @@ static void fill_dynamic(TCCState *s1, struct dyn_inf *dyninf) · 95 unmodified lines
20802079 put_dt(dynamic, DT_RELA, dyninf->rel_addr);
20812080 put_dt(dynamic, DT_RELASZ, dyninf->rel_size);
20822081 put_dt(dynamic, DT_RELAENT, sizeof(ElfW_Rel));
2083−#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
2082+#if TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD
20842083 put_dt(dynamic, DT_PLTGOT, s1->got->sh_addr);
20852084 put_dt(dynamic, DT_PLTRELSZ, dyninf->rel_size);
20862085 put_dt(dynamic, DT_JMPREL, dyninf->rel_addr);
@@ -2088,7 +2087,7 @@ static void fill_dynamic(TCCState *s1, struct dyn_inf *dyninf) · 1 unmodified line
20882087 put_dt(dynamic, DT_BIND_NOW, 1); /* Dirty hack */
20892088 #endif
20902089 #else
2091−#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
2090+#if TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel
20922091 put_dt(dynamic, DT_PLTGOT, s1->got->sh_addr);
20932092 put_dt(dynamic, DT_PLTRELSZ, dyninf->rel_size);
20942093 put_dt(dynamic, DT_JMPREL, dyninf->rel_addr);
@@ -2200,8 +2199,7 @@ static void tcc_output_elf(TCCState *s1, FILE *f, int phnum, ElfW(Phdr) *phdr, · 105 unmodified lines
22002199 ehdr.e_ident[4] = ELFCLASSW;
22012200 ehdr.e_ident[5] = ELFDATA2LSB;
22022201 ehdr.e_ident[6] = EV_CURRENT;
2203−#if !defined(TCC_TARGET_PE) && (defined(__FreeBSD__) || defined(__FreeBSD_kernel__))
2204− /* FIXME: should set only for freebsd _target_, but we exclude only PE target */
2202+#if TARGETOS_FreeBSD || TARGETOS_FreeBSD_kernel
22052203 ehdr.e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
22062204 #endif
22072205 #ifdef TCC_TARGET_ARM
@@ -2408,7 +2406,7 @@ static void create_arm_attribute_section(TCCState *s1) · 200 unmodified lines
24082406 }
24092407 #endif
24102408
2411−#if defined(__OpenBSD__)
2409+#if TARGETOS_OpenBSD
24122410 static Section *create_openbsd_note_section(TCCState *s1)
24132411 {
24142412 Section *s = find_section (s1, ".note.openbsd.ident");
@@ -2441,7 +2439,7 @@ static int elf_output_file(TCCState *s1, const char *filename) · 26 unmodified lines
24412439 #ifdef TCC_TARGET_ARM
24422440 create_arm_attribute_section (s1);
24432441 #endif
2444−#ifdef __OpenBSD__
2442+#if TARGETOS_OpenBSD
24452443 if (file_type != TCC_OUTPUT_OBJ)
24462444 note = create_openbsd_note_section (s1);
24472445 #endif
@@ -2766,7 +2764,7 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 318 unmodified lines
27662764 #ifdef TCC_ARM_EABI
27672765 sh->sh_type != SHT_ARM_EXIDX &&
27682766 #endif
2769−#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
2767+#if TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD
27702768 sh->sh_type != SHT_X86_64_UNWIND &&
27712769 sh->sh_type != SHT_NOTE &&
27722770 #endif
@@ -3321,10 +3319,7 @@ ST_FUNC int tcc_load_dll(TCCState *s1, int fd, const char *filename, int level) · 548 unmodified lines
33213319 store_version(s1, &v, dynstr);
33223320
33233321 /* add the dll and its level */
3324− dllref = tcc_mallocz(sizeof(DLLReference) + strlen(soname));
3325− dllref->level = level;
3326− strcpy(dllref->name, soname);
3327− dynarray_add(&s1->loaded_dlls, &s1->nb_loaded_dlls, dllref);
3322+ tcc_add_dllref(s1, soname)->level = level;
33283323
33293324 /* add dynamic symbols in dynsym_section */
33303325 for(i = 1, sym = dynsym + 1; i < nb_syms; i++, sym++) {
tccpe.c+19−25
@@ -1277,24 +1277,10 @@ static int pe_check_symbols(struct pe_info *pe) · 1276 unmodified lines
12771277 unsigned long offset = is->thk_offset;
12781278 if (offset) {
12791279 /* got aliased symbol, like stricmp and _stricmp */
1280−
12811280 } else {
12821281 char buffer[100];
1283− WORD *p;
1282+ unsigned char *p;
12841283
1285− offset = text_section->data_offset;
1286− /* add the 'jmp IAT[x]' instruction */
1287−#ifdef TCC_TARGET_ARM
1288− p = section_ptr_add(text_section, 8+4); // room for code and address
1289− (*(DWORD*)(p)) = 0xE59FC000; // arm code ldr ip, [pc] ; PC+8+0 = 0001xxxx
1290− (*(DWORD*)(p+2)) = 0xE59CF000; // arm code ldr pc, [ip]
1291−#else
1292− p = section_ptr_add(text_section, 8);
1293− *p = 0x25FF;
1294−#ifdef TCC_TARGET_X86_64
1295− *(DWORD*)(p+1) = (DWORD)-4;
1296−#endif
1297−#endif
12981284 /* add a helper symbol, will be patched later in
12991285 pe_build_imports */
13001286 sprintf(buffer, "IAT.%s", name);
@@ -1302,16 +1288,27 @@ static int pe_check_symbols(struct pe_info *pe) · 1 unmodified line
13021288 symtab_section, 0, sizeof(DWORD),
13031289 ELFW(ST_INFO)(STB_GLOBAL, STT_OBJECT),
13041290 0, SHN_UNDEF, buffer);
1291+
1292+ offset = text_section->data_offset;
1293+ is->thk_offset = offset;
1294+
1295+ /* add the 'jmp IAT[x]' instruction */
13051296 #ifdef TCC_TARGET_ARM
1297+ p = section_ptr_add(text_section, 8+4); // room for code and address
1298+ write32le(p + 0, 0xE59FC000); // arm code ldr ip, [pc] ; PC+8+0 = 0001xxxx
1299+ write32le(p + 4, 0xE59CF000); // arm code ldr pc, [ip]
13061300 put_elf_reloc(symtab_section, text_section,
13071301 offset + 8, R_XXX_THUNKFIX, is->iat_index); // offset to IAT position
13081302 #else
1303+ p = section_ptr_add(text_section, 8);
1304+ write16le(p, 0x25FF);
1305+#ifdef TCC_TARGET_X86_64
1306+ write32le(p + 2, (DWORD)-4);
1307+#endif
13091308 put_elf_reloc(symtab_section, text_section,
13101309 offset + 2, R_XXX_THUNKFIX, is->iat_index);
13111310 #endif
1312− is->thk_offset = offset;
13131311 }
1314−
13151312 /* tcc_realloc might have altered sym's address */
13161313 sym = (ElfW(Sym) *)symtab_section->data + sym_index;
13171314
@@ -1531,16 +1528,13 @@ ST_FUNC int pe_putimport(TCCState *s1, int dllindex, const char *name, addr_t va · 213 unmodified lines
15311528 );
15321529 }
15331530
1534−static int add_dllref(TCCState *s1, const char *dllname)
1531+static int pe_add_dllref(TCCState *s1, const char *dllname)
15351532 {
1536− DLLReference *dllref;
15371533 int i;
15381534 for (i = 0; i < s1->nb_loaded_dlls; ++i)
15391535 if (0 == strcmp(s1->loaded_dlls[i]->name, dllname))
15401536 return i + 1;
1541− dllref = tcc_mallocz(sizeof(DLLReference) + strlen(dllname));
1542− strcpy(dllref->name, dllname);
1543− dynarray_add(&s1->loaded_dlls, &s1->nb_loaded_dlls, dllref);
1537+ tcc_add_dllref(s1, dllname);
15441538 return s1->nb_loaded_dlls;
15451539 }
15461540
@@ -1737,7 +1731,7 @@ static int pe_load_def(TCCState *s1, int fd) · 190 unmodified lines
17371731 continue;
17381732
17391733 case 2:
1740− dllindex = add_dllref(s1, dllname);
1734+ dllindex = pe_add_dllref(s1, dllname);
17411735 ++state;
17421736 /* fall through */
17431737 default:
@@ -1773,7 +1767,7 @@ static int pe_load_dll(TCCState *s1, const char *filename) · 29 unmodified lines
17731767 if (ret) {
17741768 return -1;
17751769 } else if (p) {
1776− index = add_dllref(s1, filename);
1770+ index = pe_add_dllref(s1, filename);
17771771 for (q = p; *q; q += 1 + strlen(q))
17781772 pe_putimport(s1, index, q, 0);
17791773 tcc_free(p);
@@ -1782,7 +1776,7 @@ static int pe_load_dll(TCCState *s1, const char *filename) · 2 unmodified lines
17821776 }
17831777
17841778 /* ------------------------------------------------------------- */
1785−ST_FUNC int pe_load_file(struct TCCState *s1, const char *filename, int fd)
1779+ST_FUNC int pe_load_file(struct TCCState *s1, int fd, const char *filename)
17861780 {
17871781 int ret = -1;
17881782 char buf[10];
tccpp.c+3−2
@@ -3700,8 +3700,7 @@ static void tcc_predefs(CString *cstr) · 3699 unmodified lines
37003700 "__BOTH(char*,strcat,(char*,const char*))\n"
37013701 "__BOTH(char*,strchr,(const char*,int))\n"
37023702 "__BOTH(char*,strdup,(const char*))\n"
3703−#if defined(TCC_TARGET_PE) || defined(__OpenBSD__) || \
3704− defined(__FreeBSD__) || defined(__NetBSD__)
3703+#if TCC_TARGET_PE || TARGETOS_OpenBSD || TARGETOS_FreeBSD || TARGETOS_NetBSD
37053704 "#define __MAYBE_REDIR __BOTH\n"
37063705 #else // HAVE MALLOC_REDIR
37073706 "#define __MAYBE_REDIR __BUILTIN\n"
@@ -3713,6 +3712,8 @@ static void tcc_predefs(CString *cstr) · 5 unmodified lines
37133712 "__MAYBE_REDIR(void,free,(void*))\n"
37143713 #if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64
37153714 "__BOTH(void*,alloca,(__SIZE_TYPE__))\n"
3715+#else
3716+ "__BUILTIN(void*,alloca,(__SIZE_TYPE__))\n"
37163717 #endif
37173718 #if defined(TCC_TARGET_ARM) && defined(TCC_ARM_EABI)
37183719 "__BOUND(void*,__aeabi_memcpy,(void*,const void*,__SIZE_TYPE__))\n"
tccrun.c+5−19
@@ -91,27 +91,14 @@ LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr) · 90 unmodified lines
9191 int fd = mkstemp(tmpfname);
9292 unlink(tmpfname);
9393 ftruncate(fd, size);
94−#ifdef __OpenBSD__
95−{
96− int offs;
94+
9795 size = (size + (PAGESIZE-1)) & ~(PAGESIZE-1);
98− offs = (size + (0x100000-1)) & ~(0x100000-1);
99− prx = NULL;
100− ptr = mmap(NULL, size + offs, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
101− if (ptr != MAP_FAILED) {
102− /* mmap RX memory at a fixed distance */
103− munmap((char*)ptr + size, offs);
104− prx = mmap((char*)ptr + offs, size, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_FIXED, fd, 0);
105− }
106−}
107−#else
108− ptr = mmap (NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
109− prx = mmap (NULL, size, PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
110−#endif
96+ ptr = mmap(NULL, size * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
97+ /* mmap RX memory at a fixed distance */
98+ prx = mmap((char*)ptr + size, size, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_FIXED, fd, 0);
11199 if (ptr == MAP_FAILED || prx == MAP_FAILED)
112100 tcc_error("tccrun: could not map memory");
113− dynarray_add(&s1->runtime_mem, &s1->nb_runtime_mem, (void*)(addr_t)size);
114− dynarray_add(&s1->runtime_mem, &s1->nb_runtime_mem, prx);
101+ dynarray_add(&s1->runtime_mem, &s1->nb_runtime_mem, (void*)(addr_t)(size*2));
115102 ptr_diff = (char*)prx - (char*)ptr;
116103 close(fd);
117104 //printf("map %p %p %p\n", ptr, prx, (void*)ptr_diff);
@@ -131,7 +118,6 @@ ST_FUNC void tcc_run_free(TCCState *s1) · 13 unmodified lines
131118 for (i = 0; i < s1->nb_runtime_mem; ++i) {
132119 #ifdef HAVE_SELINUX
133120 unsigned size = (unsigned)(addr_t)s1->runtime_mem[i++];
134− munmap(s1->runtime_mem[i++], size);
135121 munmap(s1->runtime_mem[i], size);
136122 #else
137123 #ifdef _WIN64
tests/Makefile+4−24
@@ -23,29 +23,13 @@ TESTS = \ · 22 unmodified lines
2323 tests2-dir \
2424 pp-dir
2525
26−BTESTS = btest test1b
2726 # test4_static -- Not all relocation types are implemented yet.
2827 # asmtest / asmtest2 -- minor differences with gcc
2928
30−# bounds-checking is supported on i386 and x86_64 on linux and windows
31−ifeq (-$(CONFIG_musl)-, --)
32−ifeq ($(ARCH),i386)
33− TESTS += $(BTESTS)
34−endif
35−ifeq ($(ARCH),x86_64)
36− TESTS += $(BTESTS)
37−endif
38−ifeq ($(ARCH),arm)
39− TESTS += $(BTESTS)
40−endif
41−ifeq ($(ARCH),arm64)
42− TESTS += $(BTESTS)
43−endif
44−ifeq ($(ARCH),riscv64)
45− TESTS += $(BTESTS)
29+ifneq ($(CONFIG_bcheck),no)
30+ TESTS += btest test1b
4631 endif
47−endif
48−ifdef CONFIG_OSX # some don't work yet
32+ifeq ($(CONFIG_dll),no)
4933 TESTS := $(filter-out dlltest, $(TESTS))
5034 endif
5135 ifeq (,$(filter arm64 i386 x86_64,$(ARCH)))
@@ -55,18 +39,14 @@ ifeq ($(CONFIG_arm_eabi),yes) · 3 unmodified lines
5539 TESTS := $(filter-out test3,$(TESTS))
5640 endif
5741 ifeq (,$(filter i386 x86_64,$(ARCH)))
58− TESTS := $(filter-out dlltest asm-c-connect-test,$(TESTS))
42+ TESTS := $(filter-out asm-c-connect-test,$(TESTS))
5943 endif
60−
6144 ifeq ($(OS),Windows_NT) # for libtcc_test to find libtcc.dll
6245 PATH := $(CURDIR)/$(TOP)$(if $(findstring ;,$(PATH)),;,:)$(PATH)
6346 endif
64−
6547 ifdef CONFIG_OSX
6648 LIBS += $(LINK_LIBTCC)
6749 endif
68−
69−
7050 ifeq ($(ARCH),arm)
7151 # tcctest refers to the alignment of functions, and with thumb mode
7252 # the low bit of code addresses selects the mode, so the "alignment"
tests/tests2/Makefile+10−11
@@ -14,7 +14,6 @@ ifeq ($(CONFIG_arm_eabi),yes) # not ARM soft-float · 13 unmodified lines
1414 endif
1515 ifdef CONFIG_OSX
1616 SKIP += 40_stdio.test 42_function_pointer.test
17− SKIP += 113_btdll.test # no shared lib support yet
1817 endif
1918 ifeq ($(ARCH),x86_64)
2019 SKIP += 73_arm64.test
@@ -24,16 +23,20 @@ ifeq (,$(filter i386,$(ARCH))) · 3 unmodified lines
2423 endif
2524 ifeq (,$(filter i386 x86_64,$(ARCH)))
2625 SKIP += 85_asm-outside-function.test # x86 asm
27− SKIP += 113_btdll.test # dll support needed
2826 endif
29−ifeq (,$(filter i386 x86_64 arm arm64 riscv64,$(ARCH)))
27+ifeq ($(CONFIG_backtrace),no)
3028 SKIP += 112_backtrace.test
29+ SKIP += 113_btdll.test
30+ CONFIG_bcheck = no # no bcheck without backtrace
31+endif
32+ifeq ($(CONFIG_bcheck),no)
3133 SKIP += 114_bound_signal.test
3234 SKIP += 115_bound_setjmp.test
3335 SKIP += 116_bound_setjmp2.test
36+ SKIP += 117_builtins.test
3437 endif
35−ifeq (-$(CONFIG_musl)-,-yes-)
36− SKIP += 112_backtrace.test
38+ifeq ($(CONFIG_dll),no)
39+ SKIP += 113_btdll.test # no shared lib support yet
3740 endif
3841 ifeq (-$(findstring gcc,$(CC))-,--)
3942 SKIP += $(patsubst %.expect,%.test,$(GEN-ALWAYS))
@@ -45,12 +48,6 @@ ifeq (-$(CONFIG_WIN32)-,-yes-) · 5 unmodified lines
4548 SKIP += 106_pthread.test # No pthread support
4649 SKIP += 114_bound_signal.test # No pthread support
4750 endif
48−ifeq ($(TARGETOS),OpenBSD)
49− SKIP += 106_pthread.test
50− SKIP += 113_btdll.test
51− SKIP += 114_bound_signal.test
52− SKIP += 116_bound_setjmp2.test
53−endif
5451
5552 # Some tests might need arguments
5653 ARGS =
@@ -109,8 +106,10 @@ GEN-ALWAYS = · 52 unmodified lines
109106 115_bound_setjmp.test: FLAGS += -b
110107 116_bound_setjmp2.test: FLAGS += -b
111108 117_builtins.test: T1 = ( $(TCC) -run $1 && $(TCC) -b -run $1 )
109+ifneq ($(CONFIG_bcheck),no)
112110 121_struct_return.test: FLAGS += -b
113111 122_vla_reuse.test: FLAGS += -b
112+endif
114113
115114 # Filter source directory in warnings/errors (out-of-tree builds)
116115 FILTER = 2>&1 | sed -e 's,$(SRC)/,,g'

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t