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.
Unified · Split
| @@ -49,6 +49,7 @@ endif · 48 unmodified lines | ||
| 49 | 49 | |
| 50 | 50 | ifeq ($(ARCH),arm) |
| 51 | 51 | NATIVE_DEFINES=-DTCC_TARGET_ARM |
| 52 | +NATIVE_TARGET=-DWITHOUT_LIBTCC | |
| 52 | 53 | NATIVE_DEFINES+=$(if $(wildcard /lib/ld-linux.so.3),-DTCC_ARM_EABI) |
| 53 | 54 | NATIVE_DEFINES+=$(if $(shell grep -l "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo),-DTCC_ARM_VFP) |
| 54 | 55 | endif |
| @@ -1232,10 +1232,14 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1231 unmodified lines | ||
| 1232 | 1232 | tcc_add_library(s1, "c"); |
| 1233 | 1233 | tcc_add_file(s1, CONFIG_SYSROOT "/lib/libgcc_s.so.1"); |
| 1234 | 1234 | #else |
| 1235 | − char buf[1024]; | |
| 1236 | 1235 | tcc_add_library(s1, "c"); |
| 1237 | − snprintf(buf, sizeof(buf), "%s/%s", s1->tcc_lib_path, "libtcc1.a"); | |
| 1238 | − tcc_add_file(s1, buf); | |
| 1236 | +#ifndef WITHOUT_LIBTCC | |
| 1237 | + { | |
| 1238 | + char buf[1024]; | |
| 1239 | + snprintf(buf, sizeof(buf), "%s/%s", s1->tcc_lib_path, "libtcc1.a"); | |
| 1240 | + tcc_add_file(s1, buf); | |
| 1241 | + } | |
| 1242 | +#endif | |
| 1239 | 1243 | #endif |
| 1240 | 1244 | } |
| 1241 | 1245 | /* add crt end if not memory output */ |