Skip to content

Commit 086870a

Browse files
author
grischka
committed
configury update & bump VERSION to 0.9.28rc
configure: - option --targetos=... for cross build - cleanup win32/build-tcc.bat: - option -b <bindir> - make 'libtcc1.a' and cross-prefix-libtcc1.a (same convention as with makefile) Makefile: - streamline tcov-tests, help, etc. workflow/build.xml: simplify - using "windows-2019" runner (instead of windows-latest) because its msys seems more complete and has no problems with the 96_nodata_wanted.test either. Changelog,TODO,USES,tcc-doc.texi: update
1 parent 8c5fe87 commit 086870a

File tree

13 files changed

+432
-363
lines changed

13 files changed

+432
-363
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,32 @@
11
name: build and run tests
2+
23
on:
34
push:
45
branches: [ mob ]
5-
pull_request:
6-
branches: [ mob ]
6+
77
jobs:
8-
build-release-linux-i686-amd64:
9-
name: tinycc master linux/amd64
8+
test-x86_64-linux:
109
runs-on: ubuntu-20.04
1110
steps:
12-
- uses: actions/checkout@v2
13-
- name: Install dependencies
14-
run: sudo apt-get install -y
15-
gcc
16-
# see what's available in /usr/bin
17-
- name: see what's available
18-
run: ls -l /usr/bin
19-
# build project amd64
20-
- name: build amd64
21-
run: |
22-
./configure
23-
make
24-
# run tests
25-
- name: run test_exs amd64
26-
run: |
27-
make test
11+
- uses: actions/checkout@v3
12+
- name: make & test tcc
13+
run: ./configure && make && make test -k
2814

29-
build-release-osx-amd64:
30-
name: tinycc master osx/amd64
15+
test-x86_64-osx:
3116
runs-on: macos-11
3217
steps:
33-
- uses: actions/checkout@v2
34-
# see what's available in /usr/bin
35-
- name: see what's available
36-
run: ls -l /usr/bin
37-
# build project amd64
38-
- name: build amd64
39-
run: |
40-
./configure
41-
make
42-
# run tests
43-
- name: run test_exs amd64
44-
run: |
45-
make test
18+
- uses: actions/checkout@v3
19+
- name: make & test tcc
20+
run: ./configure && make && make test -k
4621

47-
build-release-windows-amd64-on-windows:
48-
name: tinycc master windows/amd64 on Windows
49-
runs-on: windows-latest
22+
test-x86_64-win32:
23+
runs-on: windows-2019
5024
steps:
51-
- uses: actions/checkout@v2
52-
- uses: msys2/setup-msys2@v2
53-
# build project amd64
54-
- name: build amd64
55-
run: |
56-
msys2 -c './configure'
57-
make
58-
# silency failing tests
59-
- name: silence 96_nodata_wanted
60-
run: |
61-
pushd .\tests\tests2
62-
Get-Content .\96_nodata_wanted.expect -TotalCount 2 | Out-File .\96_nodata_wanted.expect2 -Encoding default
63-
mv .\96_nodata_wanted.expect2 .\96_nodata_wanted.expect -force
64-
popd
65-
# run tests
66-
- name: run test_exs amd64
25+
- uses: actions/checkout@v3
26+
- name: make & test tcc
27+
shell: cmd
6728
run: |
68-
make test
29+
set MSYS2_PATH_TYPE=inherit
30+
set MSYSTEM=MINGW64
31+
set CHERE_INVOKING=yes
32+
C:\msys64\usr\bin\bash -l -c "./configure && make && make test -k"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ tags
3131
TAGS
3232
tcc.1
3333
*.pod
34+
*.tcov
3435
tcc-doc.html
3536
tcc-doc.info
36-
tcc_c.tcov
3737

3838
win32/doc
3939
win32/examples/libtcc_test.c

Changelog

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
version 0.9.28:
22

33
User interface:
4-
- new tcc -ar x and t flags (herman ten brugge)
4+
- -b : bounds checker much improved (herman ten brugge)
5+
- -bt : support for standalone backtraces also (grischka)
6+
- -gdwarf : debug format (herman ten brugge)
7+
- -M, -MM, and -MMD (Arthur Williams)
8+
- -W[no-]error=<option> (Steffen Nurpmeso)
59

610
Platforms:
7-
- new RISC-V (riscv64) target
8-
- native macOS support for x86_64/arm64 (Herman ten Brugge)
11+
- new RISC-V (riscv64) target (Michael Matz)
12+
- native macOS support for x86_64 (Michael Matz, Herman ten Brugge)
13+
- arm and riscv64 assemblers (Danny Milosavljevic)
14+
- Android support with position independent executables (grischka)
915

1016
Features:
11-
- Improved support for C11
12-
- C11 _Static_assert support (matthias)
17+
- _Static_assert() (matthias)
18+
- __attribute__ ((cleanup(func))) (matthias)
19+
- stdatomic (Dmitry Selyutin)
20+
- asm goto ("jmp %l[label]" : : : : label) (Michael Matz)
1321

1422
Fixes:
15-
- fix preprocessor line (#line) directive (Herman ten Brugge)
16-
Many more! see also git shortlog release_0_9_27...HEAD
23+
- ... many, see git shortlog release_0_9_27...release_0_9_27
1724

1825
Version 0.9.27:
1926

Makefile

Lines changed: 50 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ ifdef CONFIG_WIN32
3030
LIBTCC = libtcc$(DLLSUF)
3131
LIBTCCDEF = libtcc.def
3232
endif
33+
ifneq ($(CONFIG_debug),yes)
34+
LDFLAGS += -s
35+
endif
3336
NATIVE_TARGET = $(ARCH)-win$(if $(findstring arm,$(ARCH)),ce,32)
3437
else
3538
CFG = -unx
36-
LIBS=-lm -lpthread
39+
LIBS+=-lm
3740
ifneq ($(CONFIG_ldl),no)
3841
LIBS+=-ldl
3942
endif
43+
ifneq ($(CONFIG_pthread),no)
44+
LIBS+=-lpthread
45+
endif
4046
# make libtcc as static or dynamic library?
4147
ifeq ($(CONFIG_static),no)
4248
LIBTCC=libtcc$(DLLSUF)
@@ -68,11 +74,8 @@ endif
6874
TCCFLAGS-unx = -B$(TOP) -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP)
6975
TCCFLAGS-win = -B$(TOPSRC)/win32 -I$(TOPSRC)/include -I$(TOPSRC) -I$(TOP) -L$(TOP)
7076
TCCFLAGS = $(TCCFLAGS$(CFG))
71-
ifdef USE_TCC_C
72-
TCC = $(TOP)/tcc_c$(EXESUF) $(TCCFLAGS)
73-
else
74-
TCC = $(TOP)/tcc$(EXESUF) $(TCCFLAGS)
75-
endif
77+
TCC_LOCAL = $(TOP)/tcc$(EXESUF)
78+
TCC = $(TCC_LOCAL) $(TCCFLAGS)
7679

7780
CFLAGS_P = $(CFLAGS) -pg -static -DCONFIG_TCC_STATIC -DTCC_PROFILE
7881
LIBS_P = $(LIBS)
@@ -181,11 +184,8 @@ DEFINES += $(if $(ELF-$T),-DCONFIG_TCC_ELFINTERP="\"$(ELF-$T)\"")
181184
DEFINES += $(DEF-$(or $(findstring win,$T),unx))
182185

183186
ifneq ($(X),)
184-
ifeq ($(CONFIG_WIN32),yes)
185-
DEF-win += -DCONFIG_TCC_CROSSPREFIX="\"$X\""
186-
DEF-unx += -DCONFIG_TCC_CROSSPREFIX="\"lib/$X\""
187-
else
188187
DEF-all += -DCONFIG_TCC_CROSSPREFIX="\"$X\""
188+
ifneq ($(CONFIG_WIN32),yes)
189189
DEF-win += -DCONFIG_TCCDIR="\"$(tccdir)/win32\""
190190
endif
191191
endif
@@ -249,17 +249,14 @@ endif
249249

250250
GITHASH:=$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || echo no)
251251
ifneq ($(GITHASH),no)
252-
GITHASH:=$(shell git log -1 --pretty='format:%cs $(GITHASH)@%h')$(shell git diff --quiet || echo '*')
253-
DEF_GITHASH:= -DTCC_GITHASH="\"$(GITHASH)\""
252+
GITHASH:=$(shell git log -1 --date=short --pretty='format:%cd $(GITHASH)@%h')
253+
GITMODF:=$(shell git diff --quiet || echo '*')
254+
DEF_GITHASH:= -DTCC_GITHASH="\"$(GITHASH)$(GITMODF)\""
254255
endif
255256

256257
ifeq ($(CONFIG_debug),yes)
257258
CFLAGS += -g
258259
LDFLAGS += -g
259-
else
260-
ifndef CONFIG_OSX
261-
LDFLAGS += -s
262-
endif
263260
endif
264261

265262
# convert "include/tccdefs.h" to "tccdefs_.h"
@@ -335,7 +332,11 @@ libtcc1.a : tcc$(EXESUF) FORCE
335332
.PRECIOUS: %-libtcc1.a
336333
FORCE:
337334

338-
run-if = $(if $(shell command -v $1),$S $1 $2)
335+
# WHICH = which $1 2>/dev/null
336+
# some versions of gnu-make do not recognize 'command' as a shell builtin
337+
WHICH = sh -c 'command -v $1'
338+
339+
run-if = $(if $(shell $(call WHICH,$1)),$S $1 $2)
339340
S = $(if $(findstring yes,$(SILENT)),@$(info * $@))
340341

341342
# --------------------------------------------------------------------------
@@ -348,7 +349,7 @@ tcc-doc.info: tcc-doc.texi
348349

349350
tcc.1 : tcc-doc.pod
350351
$(call run-if,pod2man,--section=1 --center="Tiny C Compiler" \
351-
--release="$(VERSION)" $< >$@ && rm -f $<)
352+
--release="$(VERSION)" $< >$@)
352353
%.pod : %.texi
353354
$(call run-if,perl,$(TOPSRC)/texi2pod.pl $< $@)
354355

@@ -392,8 +393,9 @@ endif
392393

393394
# uninstall
394395
uninstall-unx:
395-
@rm -fv $(foreach P,$(PROGS) $(PROGS_CROSS),"$(bindir)/$P")
396-
@rm -fv "$(libdir)/libtcc.a" "$(libdir)/libtcc.so" "$(libdir)/libtcc.dylib" "$(includedir)/libtcc.h"
396+
@rm -fv $(addprefix "$(bindir)/",$(PROGS) $(PROGS_CROSS))
397+
@rm -fv $(addprefix "$(libdir)/", libtcc*.a libtcc*.so libtcc.dylib,$P)
398+
@rm -fv $(addprefix "$(includedir)/", libtcc.h)
397399
@rm -fv "$(mandir)/man1/tcc.1" "$(infodir)/tcc-doc.info"
398400
@rm -fv "$(docdir)/tcc-doc.html"
399401
@rm -frv "$(tccdir)"
@@ -415,17 +417,19 @@ ifneq "$(wildcard $(LIBTCC1_U))" ""
415417
$(call IF,$(TOPSRC)/include/*.h $(TOPSRC)/tcclib.h,"$(tccdir)/lib/include")
416418
endif
417419

418-
# the msys-git shell works to configure && make except it does not have install
419-
ifeq ($(CONFIG_WIN32)-$(shell command -v install || echo no),yes-no)
420-
install-win : INSTALL = cp
421-
install-win : INSTALLBIN = cp
422-
endif
423-
424420
# uninstall on windows
425421
uninstall-win:
426-
@rm -fv $(foreach P,libtcc.dll $(PROGS) *-tcc.exe,"$(bindir)"/$P)
427-
@rm -fr $(foreach P,doc examples include lib libtcc,"$(tccdir)/$P"/*)
428-
@rm -frv $(foreach P,doc examples include lib libtcc,"$(tccdir)/$P")
422+
@rm -fv $(addprefix "$(bindir)/", libtcc*.dll $(PROGS) *-tcc.exe)
423+
@rm -fr $(foreach P,doc examples include lib libtcc,"$(tccdir)/$P/*")
424+
@rm -frv $(addprefix "$(tccdir)/", doc examples include lib libtcc)
425+
426+
# the msys-git shell works to configure && make except it does not have install
427+
ifeq ($(OS),Windows_NT)
428+
ifeq ($(shell $(call WHICH,install) || echo no),no)
429+
INSTALL = cp
430+
INSTALLBIN = cp
431+
endif
432+
endif
429433

430434
# --------------------------------------------------------------------------
431435
# other stuff
@@ -459,66 +463,50 @@ test:
459463
# run test(s) from tests2 subdir (see make help)
460464
tests2.%:
461465
@$(MAKE) -C tests/tests2 $@
462-
466+
# run test(s) from testspp subdir (see make help)
463467
testspp.%:
464468
@$(MAKE) -C tests/pp $@
465-
466-
# run all tests with code coverage
469+
# run tests with code coverage
470+
tcov-tes% : tcc_c$(EXESUF)
471+
@rm -f $<.tcov
472+
@$(MAKE) --no-print-directory TCC_LOCAL=$(CURDIR)/$< tes$*
467473
tcc_c$(EXESUF): $($T_FILES)
468-
@${TCC} -o $@ -ftest-coverage $< $(DEFINES) $(CFLAGS) $(LIBS) $(LDFLAGS)
469-
testc: tcc_c$(EXESUF)
470-
@rm -f tcc_c.tcov
471-
@USE_TCC_C=yes $(MAKE) -C tests
472-
testc2.%: tcc_c$(EXESUF)
473-
@rm -f tcc_c.tcov
474-
@USE_TCC_C=yes $(MAKE) -C tests/tests2 $@
475-
testcpp.%: tcc_c$(EXESUF)
476-
@rm -f tcc_c.tcov
477-
@USE_TCC_C=yes $(MAKE) -C tests/pp $@
474+
$S$(TCC) tcc.c -o $@ -ftest-coverage $(DEFINES)
478475

479476
clean:
480-
@rm -f tcc$(EXESUF) tcc_c$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF) tags ETAGS *.pod
481-
@rm -f *.o *.a *.so* *.out *.log lib*.def *.exe *.dll a.out *.dylib *_.h
477+
@rm -f tcc$(EXESUF) tcc_c$(EXESUF) tcc_p$(EXESUF) *-tcc$(EXESUF)
478+
@rm -f tags ETAGS *.o *.a *.so* *.out *.log lib*.def *.exe *.dll
479+
@rm -f a.out *.dylib *_.h *.pod *.tcov
482480
@$(MAKE) -s -C lib $@
483481
@$(MAKE) -s -C tests $@
484482

485483
distclean: clean
486-
@rm -f config.h config.mak config.texi
487-
@rm -f $(TCCDOCS)
484+
@rm -vf config.h config.mak config.texi
485+
@rm -vf $(TCCDOCS)
488486

489487
.PHONY: all clean test tar tags ETAGS doc distclean install uninstall FORCE
490488

491489
help:
492490
@echo "make"
493491
@echo " build native compiler (from separate objects)"
494-
@echo ""
495492
@echo "make cross"
496493
@echo " build cross compilers (from one source)"
497-
@echo ""
498494
@echo "make ONE_SOURCE=no/yes SILENT=no/yes"
499495
@echo " force building from separate/one object(s), less/more silently"
500-
@echo ""
501496
@echo "make cross-TARGET"
502497
@echo " build one specific cross compiler for 'TARGET'. Currently supported:"
503-
@echo " $(wordlist 1,6,$(TCC_X))"
504-
@echo " $(wordlist 7,99,$(TCC_X))"
505-
@echo ""
498+
@echo " $(wordlist 1,8,$(TCC_X))"
499+
@echo " $(wordlist 9,99,$(TCC_X))"
506500
@echo "make test"
507501
@echo " run all tests"
508-
@echo ""
509-
@echo "make tests2.all / make tests2.37 / make tests2.37+ / make tests2.37-"
510-
@echo " run all/single test(s) from tests2, optionally update .expect, display"
511-
@echo ""
502+
@echo "make tests2.all / make tests2.37 / make tests2.37+"
503+
@echo " run all/single test(s) from tests2, optionally update .expect"
512504
@echo "make testspp.all / make testspp.17"
513505
@echo " run all/single test(s) from tests/pp"
514-
@echo ""
515-
@echo "make testc / testc2.all / testc2.37 / testc2.37+ / testc2.37-"
516-
@echo "make testcpp.all / make testcpp.17"
517-
@echo " run tests with code coverage. After test(s) see tcc_c.tcov"
518-
@echo ""
506+
@echo "make tcov-test / tcov-tests2... / tcov-testspp..."
507+
@echo " run tests as above with code coverage. After test(s) see tcc_c$(EXESUF).tcov"
519508
@echo "Other supported make targets:"
520509
@echo " install install-strip doc clean tags ETAGS tar distclean help"
521-
@echo ""
522510
@echo "Custom configuration:"
523511
@echo " The makefile includes a file 'config-extra.mak' if it is present."
524512
@echo " This file may contain some custom configuration. For example:"

TODO

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
TODO list:
22

33
Releases:
4-
- release tcc on a regular basis (which interval? 3 months?)
4+
5+
- release tcc on a regular basis
56

67
Bugs:
78

0 commit comments

Comments
 (0)