tinycc/lib
herman ten brugge 8025a829cc
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
Check with clang -fsanitize
Tested code with:
clang -fsanitize=address,undefined,nullability -pie -fPIE -Iinclude -I. -g tcc.c -o tcc.tcc -lm -ldl -lpthread
./tcc.tcc -Iinclude -I. -b -g tcc.c -o tcc.tcc1 -lm -ldl -lpthread

Also checked on i386/x86_64 with -fsanitize=memory (others not supported).

arm-link.c: use read32le/write32le/add32le to avoid unaligned access
tcc.h i386-asm.c: fix signed left shift
lib/bcheck.c: Add _Atomic
libtcc.c: Correct MEM_DEBUG_CHECK3 to avoid unaligned access
riscv64-link.c: Fix R_RISCV_SET16
tccpp.c: Align tal_header_t to avoid unaligned access
tccgen.c x86_64-gen.c: avoid use of uninitialized value

There are still warnings reported:
tccgen.c:4031:13: runtime error: member access within null pointer of type 'TCCState' (aka 'struct TCCState')
tccelf.c:321:22: runtime error: applying zero offset to null pointer
tccelf.c:1132:23: runtime error: applying non-zero offset 169184 to null pointer

A lot of left shift of negative value warnings.

I ignored these for the moment.

Also the -run option does no work well with -fsanitize. It gets confused
because it does not detect that the generated code in memory is used
without -fsanitize option.

There are a lot more -fsanitize options. I did not find serious problems
with them.
2025-07-27 11:22:16 +02:00
..
alloca-bt.S tcc/lib: reduce number of files 2021-08-03 22:49:18 +02:00
alloca.S tcc/lib: reduce number of files 2021-08-03 22:49:18 +02:00
armeabi.c arm bits 2025-03-11 22:56:22 +01:00
armflush.c Use arm assembler in lib dir 2021-01-23 19:08:59 +01:00
atomic.S lib/atomic.S: add GNU libatomic copyright notice 2025-07-19 00:30:12 +02:00
bcheck.c Check with clang -fsanitize 2025-07-27 11:22:16 +02:00
bt-dll.c bcheck: remove "tcc_location()" & x86_64 double fix 2023-09-06 22:42:21 +02:00
bt-exe.c make: make shorter command lines 2024-11-30 20:05:02 +01:00
bt-log.c tccrun: review last changes 2024-02-19 17:45:44 +01:00
builtin.c Allow building lib with gcc/clang 2022-12-17 09:37:37 +01:00
dsohandle.c Define __dso_handle in libtcc1.a 2019-06-22 01:38:43 +02:00
lib-arm64.c Add support for apple m1 2022-11-16 12:52:51 -06:00
libtcc1.c cleanups & stuff 2025-03-11 22:56:01 +01:00
Makefile arm bits 2025-03-11 22:56:22 +01:00
runmain.c Fix win64 noreturn problem 2024-02-28 07:37:09 +01:00
stdatomic.c Use asm implements some atomic functions 2025-06-24 22:40:07 +08:00
tcov.c Add tcov support in Makefile 2023-08-31 11:09:49 +02:00
va_list.c Struct va_arg fix 2020-09-17 08:42:28 +02:00