aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@celest.fr>2011-08-01 22:32:44 +0200
committerThomas Preud'homme <thomas.preudhomme@celest.fr>2011-08-02 00:31:17 +0200
commit76adc5770f4ab5b1aaa2e5dde6104efc06431fe2 (patch)
treea3d2f62a38009d395f0b95538946b487e5764470 /tccelf.c
parent5e954fef32ec8b630132c230793e0f3faca34e0a (diff)
downloadtinycc-76adc5770f4ab5b1aaa2e5dde6104efc06431fe2.tar.gz
tinycc-76adc5770f4ab5b1aaa2e5dde6104efc06431fe2.tar.bz2
Add a --multiarch-triplet switch to configure
Add a --multiarch-triplet switch to configure. The switch will allow files to be search for each default path in path/<triplet> and then path. Default paths handled that way: - CONFIG_TCC_SYSINCLUDE_PATHS - CONFIG_TCC_LIBPATH - path to crt*.o - path to libgcc_s.so.1 Path missing: elf interpreter path (will be handled in another commit)
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tccelf.c b/tccelf.c
index c0f1c94..f58ae83 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -1238,7 +1238,10 @@ ST_FUNC void tcc_add_runtime(TCCState *s1)
if (!s1->nostdlib) {
#ifdef CONFIG_USE_LIBGCC
tcc_add_library(s1, "c");
- tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_LDDIR"/libgcc_s.so.1");
+#ifdef CONFIG_TCC_MULTIARCH_TRIPLET
+ if (tcc_add_file_internal(s1, CONFIG_SYSROOT CONFIG_TCC_LDDIR "/" CONFIG_TCC_MULTIARCH_TRIPLET "/libgcc_s.so.1", 0))
+#endif
+ tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_LDDIR"/libgcc_s.so.1");
#else
tcc_add_library(s1, "c");
#ifndef WITHOUT_LIBTCC
@@ -1252,7 +1255,10 @@ ST_FUNC void tcc_add_runtime(TCCState *s1)
}
/* add crt end if not memory output */
if (s1->output_type != TCC_OUTPUT_MEMORY && !s1->nostdlib) {
- tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crtn.o");
+#ifdef CONFIG_TCC_MULTIARCH_TRIPLET
+ if (tcc_add_file_internal(s1, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/" CONFIG_TCC_MULTIARCH_TRIPLET "/crtn.o", 0))
+#endif
+ tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crtn.o");
}
}