History

configure chmod 755 etc.

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.

grischka committed 5 years ago

Commit 557b4a11 parent 25628cf10 files · +21 −15Browse files

Unified · Split

10 files
  1. Makefile +2 −3
  2. c67-gen.c +2 −0
  3. configure +0 −0
  4. lib/Makefile +1 −1
  5. lib/bcheck.c +4 −0
  6. lib/bt-exe.c +0 −5
  7. tccelf.c +0 −2
  8. tccgen.c +6 −0
  9. tccpe.c +1 −3
  10. tests/tests2/96_nodata_wanted.c +5 −1
Makefile+2−3
@@ -334,12 +334,11 @@ IR = $(IM) mkdir -p $2 && cp -r $1/. $2 · 333 unmodified lines
334334 IM = $(info -> $2 : $1)@
335335
336336 B_O = bcheck.o bt-exe.o bt-log.o bt-dll.o
337−T_O = tcov.o
338337
339338 # install progs & libs
340339 install-unx:
341340 $(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)")
343342 $(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include")
344343 $(call $(if $(findstring .so,$(LIBTCC)),IBw,IFw),$(LIBTCC),"$(libdir)")
345344 $(call IF,$(TOPSRC)/libtcc.h,"$(includedir)")
@@ -364,7 +363,7 @@ uninstall-unx: · 18 unmodified lines
364363 install-win:
365364 $(call IBw,$(PROGS) $(PROGS_CROSS) $(subst libtcc.a,,$(LIBTCC)),"$(bindir)")
366365 $(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")
368367 $(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/include")
369368 $(call IR,$(TOPSRC)/win32/include,"$(tccdir)/include")
370369 $(call IR,$(TOPSRC)/win32/examples,"$(tccdir)/examples")
c67-gen.c+2−0
@@ -108,6 +108,8 @@ enum { · 107 unmodified lines
108108 /* maximum alignment (for aligned attribute support) */
109109 #define MAX_ALIGN 8
110110
111+#undef CONFIG_TCC_BCHECK
112+
111113 /******************************************************/
112114 #else /* ! TARGET_DEFS_ONLY */
113115 /******************************************************/
configure+0−0

File mode changed from 100644 to 100755.

lib/Makefile+1−1
@@ -38,6 +38,7 @@ endif · 37 unmodified lines
3838 $(X)BT_O = bt-exe.o bt-log.o
3939 $(X)B_O = $(BCHECK_O) bt-exe.o bt-log.o bt-dll.o
4040 endif
41+$(X)BT_O += tcov.o
4142
4243 DSO_O = dsohandle.o
4344
@@ -64,7 +65,6 @@ OBJ-arm-wince = $(ARM_O) $(WIN_O) · 20 unmodified lines
6465 OBJ-riscv64 = $(RISCV64_O) $(BCHECK_O) $(DSO_O)
6566
6667 OBJ-extra = $(filter $(B_O),$(OBJ-$T))
67−OBJ-extra += tcov.o
6868 OBJ-libtcc1 = $(addprefix $(X),$(filter-out $(OBJ-extra),$(OBJ-$T)))
6969
7070 ALL = $(addprefix $(TOP)/,$(X)libtcc1.a $(OBJ-extra))
lib/bcheck.c+4−0
@@ -1367,6 +1367,10 @@ int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) · 1366 unmodified lines
13671367
13681368 dprintf (stderr, "%s, %s() %d %p %p\n", __FILE__, __FUNCTION__,
13691369 signum, act, oldact);
1370+
1371+ if (sigaction_redir == NULL)
1372+ __bound_init(0,-1);
1373+
13701374 if (act) {
13711375 nact = *act;
13721376 if (nact.sa_flags & SA_SIGINFO)
lib/bt-exe.c+0−5
@@ -18,11 +18,6 @@ void __bt_init(rt_context *p, int num_callers) · 17 unmodified lines
1818 __attribute__((weak)) void __bound_init(void*, int);
1919 struct rt_context *rc = &g_rtctxt;
2020 //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
2621 if (num_callers) {
2722 memcpy(rc, p, offsetof(rt_context, next));
2823 rc->num_callers = num_callers - 1;
tccelf.c+0−2
@@ -1479,8 +1479,6 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1478 unmodified lines
14791479 if (!s1->nostdlib) {
14801480 if (s1->option_pthread)
14811481 tcc_add_library_err(s1, "pthread");
1482− if (s1->test_coverage)
1483− tcc_add_support(s1, "tcov.o");
14841482 tcc_add_library_err(s1, "c");
14851483 #ifdef TCC_LIBGCC
14861484 if (!s1->static_link) {
tccgen.c+6−0
@@ -2949,6 +2949,12 @@ static void gen_opic(int op) · 2948 unmodified lines
29492949
29502950 #if defined TCC_TARGET_X86_64 || defined TCC_TARGET_I386
29512951 # 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+}
29522958 #else
29532959 /* XXX: implement in gen_opf() for other backends too */
29542960 void gen_negf(int op)
tccpe.c+1−3
@@ -1915,10 +1915,8 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) · 1914 unmodified lines
19151915 tcc_add_btstub(s1);
19161916 }
19171917 #endif
1918− if (s1->test_coverage) {
1919− tcc_add_support(s1, "tcov.o");
1918+ if (s1->test_coverage)
19201919 tcc_add_tcov(s1);
1921− }
19221920
19231921 /* grab the startup code from libtcc1.a */
19241922 #ifdef TCC_IS_NATIVE
tests/tests2/96_nodata_wanted.c+5−1
@@ -58,7 +58,11 @@ ts1:; · 57 unmodified lines
5858 void *p = (void*)&main;
5959 char cc[] = "static string";
6060 double d = 8.0;
61− struct __attribute__((packed)) {
61+ struct
62+#ifndef __arm__
63+ __attribute__((packed))
64+#endif
65+ {
6266 unsigned x : 12;
6367 unsigned char y : 7;
6468 unsigned z : 28, a: 4, b: 5;

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