History

Added patch to detect and use the paths for 64bit libraries as used by CentOS (affects X86_64 only).

Nikos Mavrogiannopoulos committed 16 years ago

Commit 253bad71 parent 900871c4 files · +17 −2Browse files

Unified · Split

4 files
  1. Makefile +1 −0
  2. libtcc.c +7 −1
  3. tcc.h +5 −1
  4. tccelf.c +4 −0
Makefile+1−0
@@ -40,6 +40,7 @@ ALLOCA_O=alloca86.o alloca86-bt.o · 39 unmodified lines
4040 else
4141 ifeq ($(ARCH),x86-64)
4242 NATIVE_DEFINES=-DTCC_TARGET_X86_64
43+NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
4344 LIBTCC1=libtcc1.a
4445 BCHECK_O=
4546 ALLOCA_O=alloca86_64.o
libtcc.c+7−1
@@ -944,9 +944,15 @@ LIBTCCAPI TCCState *tcc_new(void) · 943 unmodified lines
944944
945945 #ifndef TCC_TARGET_PE
946946 /* default library paths */
947− tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib");
947+# if defined(TCC_TARGET_X86_64_CENTOS)
948+ tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib64");
949+ tcc_add_library_path(s, CONFIG_SYSROOT "/lib64");
950+ tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib64");
951+# else
948952 tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib");
949953 tcc_add_library_path(s, CONFIG_SYSROOT "/lib");
954+ tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib");
955+# endif
950956 #endif
951957
952958 /* no section zero */
tcc.h+5−1
@@ -136,7 +136,11 @@ typedef int BOOL; · 135 unmodified lines
136136
137137 /* path to find crt1.o, crti.o and crtn.o. Only needed when generating
138138 executables or dlls */
139−#define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
139+#if defined(TCC_TARGET_X86_64_CENTOS)
140+# define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib64"
141+#else
142+# define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
143+#endif
140144
141145 #define INCLUDE_STACK_SIZE 32
142146 #define IFDEF_STACK_SIZE 64
tccelf.c+4−0
@@ -1307,7 +1307,11 @@ static const char elf_interp[] = "/libexec/ld-elf.so.1"; · 1306 unmodified lines
13071307 #elif defined TCC_ARM_EABI
13081308 static const char elf_interp[] = "/lib/ld-linux.so.3";
13091309 #elif defined(TCC_TARGET_X86_64)
1310+# if defined(TCC_TARGET_X86_64_CENTOS)
1311+static const char elf_interp[] = "/lib64/ld-linux-x86-64.so.2";
1312+# else
13101313 static const char elf_interp[] = "/lib/ld-linux-x86-64.so.2";
1314+# endif /* TCC_TARGET_X86_64_CENTOS */
13111315 #elif defined(TCC_UCLIBC)
13121316 static const char elf_interp[] = "/lib/ld-uClibc.so.0";
13131317 #else

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