aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tccelf.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/tccelf.c b/tccelf.c
index 648422e..9c2ce6f 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1575,7 +1575,25 @@ ST_FUNC void tcc_add_bcheck(TCCState *s1)
static inline int tcc_add_support(TCCState *s1, const char *filename)
{
char buf[1024];
- snprintf(buf, sizeof(buf), "%s/%s", s1->tcc_lib_path, filename);
+ snprintf(buf, sizeof(buf), "%s/%s/%s", s1->tcc_lib_path,
+ /* an cpu specific path inside tcc_lib_path, mainly for keeping libtcc1.a */
+ #ifdef TCC_TARGET_I386
+ "i386"
+ #endif
+ #ifdef TCC_TARGET_X86_64
+ "x86-64"
+ #endif
+ #ifdef TCC_TARGET_ARM
+ "ARM"
+ #endif
+ #ifdef TCC_TARGET_ARM64
+ "ARM64"
+ #endif
+ #ifdef TCC_TARGET_C67
+ "C67"
+ #endif
+ ,filename);
+
return tcc_add_file(s1, buf);
}