History

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.

Thomas Preud'homme committed 16 years ago

Commit 22204671 parent a28b18f2 files · +8 −3Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t