From bea7dcde867123571cc33c98cba6d7fada90df69 Mon Sep 17 00:00:00 2001 From: wanjochan Date: Fri, 18 Sep 2020 06:57:56 +0800 Subject: [PATCH] check strlen(TCC_LIBTCC1) before tcc_add_support(s1, TCC_LIBTCC1) --- tccelf.c | 1 + tccpe.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tccelf.c b/tccelf.c index eb6d78db..e2da08da 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1457,6 +1457,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) tcc_add_btstub(s1); } #endif + if ( strlen ( TCC_LIBTCC1 ) > 0 ) tcc_add_support(s1, TCC_LIBTCC1); #ifndef TCC_TARGET_MACHO /* add crt end if not memory output */ diff --git a/tccpe.c b/tccpe.c index 9734f6e9..68796a4c 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1923,6 +1923,7 @@ static void pe_add_runtime(TCCState *s1, struct pe_info *pe) "msvcrt", "kernel32", "", "user32", "gdi32", NULL }; const char **pp, *p; + if ( strlen ( TCC_LIBTCC1 ) > 0 ) tcc_add_support(s1, TCC_LIBTCC1); for (pp = libs; 0 != (p = *pp); ++pp) { if (*p)