lib/tcov.c: - can't be cross-compiled (needs stdio.h) - can be included in libtcc1.a Reason why bt-xxx.o/bcheck.o are linked separatly is because we don't want then to linked into exe's and dlls at the same time.
Unified · Split
| @@ -334,12 +334,11 @@ IR = $(IM) mkdir -p $2 && cp -r $1/. $2 · 333 unmodified lines | |||
| 334 | IM = $(info -> $2 : $1)@ | 334 | IM = $(info -> $2 : $1)@ |
| 335 | 335 | ||
| 336 | B_O = bcheck.o bt-exe.o bt-log.o bt-dll.o | 336 | B_O = bcheck.o bt-exe.o bt-log.o bt-dll.o |
| 337 | T_O = tcov.o | ||
| 338 | 337 | ||
| 339 | # install progs & libs | 338 | # install progs & libs |
| 340 | install-unx: | 339 | install-unx: |
| 341 | $(call IBw,$(PROGS) $(PROGS_CROSS),"$(bindir)") | 340 | $(call IBw,$(PROGS) $(PROGS_CROSS),"$(bindir)") |
| 342 | $(call IFw,$(LIBTCC1) $(B_O) $(T_O) $(LIBTCC1_U),"$(tccdir)") | 341 | $(call IFw,$(LIBTCC1) $(B_O) $(LIBTCC1_U),"$(tccdir)") |
| 343 | $(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include") | 342 | $(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include") |
| 344 | $(call $(if $(findstring .so,$(LIBTCC)),IBw,IFw),$(LIBTCC),"$(libdir)") | 343 | $(call $(if $(findstring .so,$(LIBTCC)),IBw,IFw),$(LIBTCC),"$(libdir)") |
| 345 | $(call IF,$(TOPSRC)/libtcc.h,"$(includedir)") | 344 | $(call IF,$(TOPSRC)/libtcc.h,"$(includedir)") |
| @@ -364,7 +363,7 @@ uninstall-unx: · 18 unmodified lines | |||
| 364 | install-win: | 363 | install-win: |
| 365 | $(call IBw,$(PROGS) $(PROGS_CROSS) $(subst libtcc.a,,$(LIBTCC)),"$(bindir)") | 364 | $(call IBw,$(PROGS) $(PROGS_CROSS) $(subst libtcc.a,,$(LIBTCC)),"$(bindir)") |
| 366 | $(call IF,$(TOPSRC)/win32/lib/*.def,"$(tccdir)/lib") | 365 | $(call IF,$(TOPSRC)/win32/lib/*.def,"$(tccdir)/lib") |
| 367 | $(call IFw,libtcc1.a $(B_O) $(T_O) $(LIBTCC1_W),"$(tccdir)/lib") | 366 | $(call IFw,libtcc1.a $(B_O) $(LIBTCC1_W),"$(tccdir)/lib") |
| 368 | $(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include") | 367 | $(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include") |
| 369 | $(call IR,$(TOPSRC)/win32/include,"$(tccdir)/include") | 368 | $(call IR,$(TOPSRC)/win32/include,"$(tccdir)/include") |
| 370 | $(call IR,$(TOPSRC)/win32/examples,"$(tccdir)/examples") | 369 | $(call IR,$(TOPSRC)/win32/examples,"$(tccdir)/examples") |
| @@ -108,6 +108,8 @@ enum { · 107 unmodified lines | |||
| 108 | /* maximum alignment (for aligned attribute support) */ | 108 | /* maximum alignment (for aligned attribute support) */ |
| 109 | #define MAX_ALIGN 8 | 109 | #define MAX_ALIGN 8 |
| 110 | 110 | ||
| 111 | #undef CONFIG_TCC_BCHECK | ||
| 112 | |||
| 111 | /******************************************************/ | 113 | /******************************************************/ |
| 112 | #else /* ! TARGET_DEFS_ONLY */ | 114 | #else /* ! TARGET_DEFS_ONLY */ |
| 113 | /******************************************************/ | 115 | /******************************************************/ |
File mode changed from 100644 to 100755.
| @@ -38,6 +38,7 @@ endif · 37 unmodified lines | |||
| 38 | $(X)BT_O = bt-exe.o bt-log.o | 38 | $(X)BT_O = bt-exe.o bt-log.o |
| 39 | $(X)B_O = $(BCHECK_O) bt-exe.o bt-log.o bt-dll.o | 39 | $(X)B_O = $(BCHECK_O) bt-exe.o bt-log.o bt-dll.o |
| 40 | endif | 40 | endif |
| 41 | $(X)BT_O += tcov.o | ||
| 41 | 42 | ||
| 42 | DSO_O = dsohandle.o | 43 | DSO_O = dsohandle.o |
| 43 | 44 | ||
| @@ -64,7 +65,6 @@ OBJ-arm-wince = $(ARM_O) $(WIN_O) · 20 unmodified lines | |||
| 64 | OBJ-riscv64 = $(RISCV64_O) $(BCHECK_O) $(DSO_O) | 65 | OBJ-riscv64 = $(RISCV64_O) $(BCHECK_O) $(DSO_O) |
| 65 | 66 | ||
| 66 | OBJ-extra = $(filter $(B_O),$(OBJ-$T)) | 67 | OBJ-extra = $(filter $(B_O),$(OBJ-$T)) |
| 67 | OBJ-extra += tcov.o | ||
| 68 | OBJ-libtcc1 = $(addprefix $(X),$(filter-out $(OBJ-extra),$(OBJ-$T))) | 68 | OBJ-libtcc1 = $(addprefix $(X),$(filter-out $(OBJ-extra),$(OBJ-$T))) |
| 69 | 69 | ||
| 70 | ALL = $(addprefix $(TOP)/,$(X)libtcc1.a $(OBJ-extra)) | 70 | ALL = $(addprefix $(TOP)/,$(X)libtcc1.a $(OBJ-extra)) |
| @@ -1367,6 +1367,10 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) · 1366 unmodified lines | |||
| 1367 | 1367 | ||
| 1368 | dprintf (stderr, "%s, %s() %d %p %p\n", __FILE__, __FUNCTION__, | 1368 | dprintf (stderr, "%s, %s() %d %p %p\n", __FILE__, __FUNCTION__, |
| 1369 | signum, act, oldact); | 1369 | signum, act, oldact); |
| 1370 | |||
| 1371 | if (sigaction_redir == NULL) | ||
| 1372 | __bound_init(0,-1); | ||
| 1373 | |||
| 1370 | if (act) { | 1374 | if (act) { |
| 1371 | nact = *act; | 1375 | nact = *act; |
| 1372 | if (nact.sa_flags & SA_SIGINFO) | 1376 | if (nact.sa_flags & SA_SIGINFO) |
| @@ -18,11 +18,6 @@ void __bt_init(rt_context *p, int num_callers) · 17 unmodified lines | |||
| 18 | __attribute__((weak)) void __bound_init(void*, int); | 18 | __attribute__((weak)) void __bound_init(void*, int); |
| 19 | struct rt_context *rc = &g_rtctxt; | 19 | struct rt_context *rc = &g_rtctxt; |
| 20 | //fprintf(stderr, "__bt_init %d %p %p\n", num_callers, p->stab_sym, p->bounds_start), fflush(stderr); | 20 | //fprintf(stderr, "__bt_init %d %p %p\n", num_callers, p->stab_sym, p->bounds_start), fflush(stderr); |
| 21 | #ifdef __APPLE__ | ||
| 22 | /* call __bound_init here due to redirection of sigaction */ | ||
| 23 | if (__bound_init && p->bounds_start) | ||
| 24 | __bound_init(p->bounds_start, 0); | ||
| 25 | #endif | ||
| 26 | if (num_callers) { | 21 | if (num_callers) { |
| 27 | memcpy(rc, p, offsetof(rt_context, next)); | 22 | memcpy(rc, p, offsetof(rt_context, next)); |
| 28 | rc->num_callers = num_callers - 1; | 23 | rc->num_callers = num_callers - 1; |
| @@ -1479,8 +1479,6 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1478 unmodified lines | |||
| 1479 | if (!s1->nostdlib) { | 1479 | if (!s1->nostdlib) { |
| 1480 | if (s1->option_pthread) | 1480 | if (s1->option_pthread) |
| 1481 | tcc_add_library_err(s1, "pthread"); | 1481 | tcc_add_library_err(s1, "pthread"); |
| 1482 | if (s1->test_coverage) | ||
| 1483 | tcc_add_support(s1, "tcov.o"); | ||
| 1484 | tcc_add_library_err(s1, "c"); | 1482 | tcc_add_library_err(s1, "c"); |
| 1485 | #ifdef TCC_LIBGCC | 1483 | #ifdef TCC_LIBGCC |
| 1486 | if (!s1->static_link) { | 1484 | if (!s1->static_link) { |
| @@ -2949,6 +2949,12 @@ static void gen_opic(int op) · 2948 unmodified lines | |||
| 2949 | 2949 | ||
| 2950 | #if defined TCC_TARGET_X86_64 || defined TCC_TARGET_I386 | 2950 | #if defined TCC_TARGET_X86_64 || defined TCC_TARGET_I386 |
| 2951 | # define gen_negf gen_opf | 2951 | # define gen_negf gen_opf |
| 2952 | #elif defined TCC_TARGET_ARM | ||
| 2953 | void gen_negf(int op) | ||
| 2954 | { | ||
| 2955 | /* arm will detect 0-x and replace by vneg */ | ||
| 2956 | vpushi(0), vswap(), gen_op('-'); | ||
| 2957 | } | ||
| 2952 | #else | 2958 | #else |
| 2953 | /* XXX: implement in gen_opf() for other backends too */ | 2959 | /* XXX: implement in gen_opf() for other backends too */ |
| 2954 | void gen_negf(int op) | 2960 | void gen_negf(int op) |
| @@ -1915,10 +1915,8 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) · 1914 unmodified lines | |||
| 1915 | tcc_add_btstub(s1); | 1915 | tcc_add_btstub(s1); |
| 1916 | } | 1916 | } |
| 1917 | #endif | 1917 | #endif |
| 1918 | if (s1->test_coverage) { | 1918 | if (s1->test_coverage) |
| 1919 | tcc_add_support(s1, "tcov.o"); | ||
| 1920 | tcc_add_tcov(s1); | 1919 | tcc_add_tcov(s1); |
| 1921 | } | ||
| 1922 | 1920 | ||
| 1923 | /* grab the startup code from libtcc1.a */ | 1921 | /* grab the startup code from libtcc1.a */ |
| 1924 | #ifdef TCC_IS_NATIVE | 1922 | #ifdef TCC_IS_NATIVE |
| @@ -58,7 +58,11 @@ ts1:; · 57 unmodified lines | |||
| 58 | void *p = (void*)&main; | 58 | void *p = (void*)&main; |
| 59 | char cc[] = "static string"; | 59 | char cc[] = "static string"; |
| 60 | double d = 8.0; | 60 | double d = 8.0; |
| 61 | struct __attribute__((packed)) { | 61 | struct |
| 62 | #ifndef __arm__ | ||
| 63 | __attribute__((packed)) | ||
| 64 | #endif | ||
| 65 | { | ||
| 62 | unsigned x : 12; | 66 | unsigned x : 12; |
| 63 | unsigned char y : 7; | 67 | unsigned char y : 7; |
| 64 | unsigned z : 28, a: 4, b: 5; | 68 | unsigned z : 28, a: 4, b: 5; |