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
4949
5050 ifeq ($(ARCH),arm)
5151 NATIVE_DEFINES=-DTCC_TARGET_ARM
52+NATIVE_TARGET=-DWITHOUT_LIBTCC
5253 NATIVE_DEFINES+=$(if $(wildcard /lib/ld-linux.so.3),-DTCC_ARM_EABI)
5354 NATIVE_DEFINES+=$(if $(shell grep -l "^Features.* \(vfp\|iwmmxt\) " /proc/cpuinfo),-DTCC_ARM_VFP)
5455 endif
tccelf.c+7−3
@@ -1232,10 +1232,14 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1231 unmodified lines
12321232 tcc_add_library(s1, "c");
12331233 tcc_add_file(s1, CONFIG_SYSROOT "/lib/libgcc_s.so.1");
12341234 #else
1235− char buf[1024];
12361235 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
12391243 #endif
12401244 }
12411245 /* 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