From 9e79b18bca641b12b6b12e5cec46202f6d6fad65 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 3 Jan 2014 18:17:52 +0800 Subject: Use libtcc.a for static link even with USE_LIBGCC When statically linking, runtime library should be static as well. tcc could link with libgcc.a but it's in a gcc version specific directory. Another solution, followed by this patch, is to use libtcc.a when statically linking, even if USE_LIBGCC was configured. --- tccelf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tccelf.c') diff --git a/tccelf.c b/tccelf.c index 91155e3..caa8281 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1363,7 +1363,12 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) if (!s1->nostdlib) { tcc_add_library(s1, "c"); #ifdef CONFIG_USE_LIBGCC - tcc_add_file(s1, TCC_LIBGCC); + if (!s1->static_link) + tcc_add_file(s1, TCC_LIBGCC); +#if !defined WITHOUT_LIBTCC + else + tcc_add_support(s1, "libtcc1.a"); +#endif #elif !defined WITHOUT_LIBTCC tcc_add_support(s1, "libtcc1.a"); #endif -- cgit v1.3.1