aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2010-04-27 20:13:19 +0200
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2010-05-01 17:20:28 +0200
commit2220467fcf27dbdf6b0d6d8cc56eb65bc35a78ab (patch)
treeda1dd07473f10d07b54c23a77941f9d0ed574311 /tccelf.c
parenta28b18fa16edaeb6bc7d34cf1ddac690b27ba610 (diff)
downloadtinycc-2220467fcf27dbdf6b0d6d8cc56eb65bc35a78ab.tar.gz
tinycc-2220467fcf27dbdf6b0d6d8cc56eb65bc35a78ab.tar.bz2
Don't load libtcc1 on arch where it doesn't exist
ARM architecture doesn't have any libtcc1 implementation but tcc load libtcc1.a in all case. This patch add a conditional preprocessor instruction to load libtcc1.a only when there is an implementation for the target architecture.
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tccelf.c b/tccelf.c
index 91a203e..4ea8dc8 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1232,10 +1232,14 @@ ST_FUNC void tcc_add_runtime(TCCState *s1)
tcc_add_library(s1, "c");
tcc_add_file(s1, CONFIG_SYSROOT "/lib/libgcc_s.so.1");
#else
- char buf[1024];
tcc_add_library(s1, "c");
- snprintf(buf, sizeof(buf), "%s/%s", s1->tcc_lib_path, "libtcc1.a");
- tcc_add_file(s1, buf);
+#ifndef WITHOUT_LIBTCC
+ {
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "%s/%s", s1->tcc_lib_path, "libtcc1.a");
+ tcc_add_file(s1, buf);
+ }
+#endif
#endif
}
/* add crt end if not memory output */