mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-02 08:20:06 +08:00
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.
This commit is contained in:
parent
a28b18fa16
commit
2220467fcf
1
Makefile
1
Makefile
@ -49,6 +49,7 @@ endif
|
||||
|
||||
ifeq ($(ARCH),arm)
|
||||
NATIVE_DEFINES=-DTCC_TARGET_ARM
|
||||
NATIVE_TARGET=-DWITHOUT_LIBTCC
|
||||
NATIVE_DEFINES+=$(if $(wildcard /lib/ld-linux.so.3),-DTCC_ARM_EABI)
|
||||
NATIVE_DEFINES+=$(if $(shell grep -l "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo),-DTCC_ARM_VFP)
|
||||
endif
|
||||
|
10
tccelf.c
10
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 */
|
||||
|
Loading…
Reference in New Issue
Block a user