Skip to content

Commit b187f7e

Browse files
committed
CI: Add TinyCC (aka TCC) support
Identification examples: tcc-0.9.27, tcc-0.9.28rc There are currently warnings such as: print-802_11.c:3317: warning: assignment discards qualifiers from pointer target type print-ldp.c:702: warning: function might return no value: 'ldp_pdu_print' So use: TCPDUMP_TAINTED=yes Works on linux-amd64. Does not work on linux-armv7l with BUILD_LIBPCAP=yes / CMAKE=yes (Segmentation fault, libpcap dynamically linked). Works with 0.9.28rc. TinyCC can be found at https://bellard.org/tcc/, https://repo.or.cz/r/tinycc.git or as package on some distros. (backported from commit 57f1c40)
1 parent 54580d9 commit b187f7e

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ suncc-5.1[45]/SunOS-5.11)
4747
# Various E_STATEMENT_NOT_REACHED and E_DEPRECATED_ATT warnings.
4848
TCPDUMP_TAINTED=yes
4949
;;
50+
tcc-*/*)
51+
# print-802_11.c:3317: warning: assignment discards qualifiers from pointer
52+
# target type
53+
# print-ldp.c:702: warning: function might return no value: 'ldp_pdu_print'
54+
TCPDUMP_TAINTED=yes
55+
;;
5056
*)
5157
;;
5258
esac

build_common.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ print_sysinfo() {
6363
cc_version_nocache() {
6464
: "${CC:?}"
6565
case `basename "$CC"` in
66-
gcc*|egcc*|clang*)
66+
gcc*|egcc*|clang*|tcc*)
6767
# GCC and Clang recognize --version, print to stdout and exit with 0.
6868
"$CC" --version
6969
;;
@@ -151,6 +151,17 @@ cc_id_nocache() {
151151
return
152152
fi
153153

154+
# Examples of installed packages:
155+
# "tcc version 0.9.27 (x86_64 Linux)"
156+
# "tcc version 0.9.27 2023-07-05 mob@5b28165 (x86_64 OpenBSD)"
157+
# Example of a development version:
158+
# "tcc version 0.9.28rc 2024-04-28 mob@0aca8611 (x86_64 Linux)"
159+
cc_id_guessed=`echo "$cc_id_firstline" | sed 's/^.*tcc version \([0-9\.rc]*\).*$/tcc-\1/'`
160+
if [ "$cc_id_firstline" != "$cc_id_guessed" ]; then
161+
echo "$cc_id_guessed"
162+
return
163+
fi
164+
154165
# OpenBSD default GCC:
155166
# "gcc (GCC) 4.2.1 20070719"
156167
# RedHat GCC:
@@ -187,7 +198,7 @@ discard_cc_cache() {
187198
# warnings as errors.
188199
cc_werr_cflags() {
189200
case `cc_id` in
190-
gcc-*|clang-*)
201+
gcc-*|clang-*|tcc-*)
191202
echo '-Werror'
192203
;;
193204
xlc-*)

0 commit comments

Comments
 (0)