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
40else40else
41ifeq ($(ARCH),x86-64)41ifeq ($(ARCH),x86-64)
42NATIVE_DEFINES=-DTCC_TARGET_X86_6442NATIVE_DEFINES=-DTCC_TARGET_X86_64
43NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
43LIBTCC1=libtcc1.a44LIBTCC1=libtcc1.a
44BCHECK_O=45BCHECK_O=
45ALLOCA_O=alloca86_64.o46ALLOCA_O=alloca86_64.o
libtcc.c+7−1
@@ -944,9 +944,15 @@ LIBTCCAPI TCCState *tcc_new(void) · 943 unmodified lines
944 944
945#ifndef TCC_TARGET_PE945#ifndef TCC_TARGET_PE
946 /* default library paths */946 /* 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
948 tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib");952 tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib");
949 tcc_add_library_path(s, CONFIG_SYSROOT "/lib");953 tcc_add_library_path(s, CONFIG_SYSROOT "/lib");
954 tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib");
955# endif
950#endif956#endif
951 957
952 /* no section zero */958 /* no section zero */
tcc.h+5−1
@@ -136,7 +136,11 @@ typedef int BOOL; · 135 unmodified lines
136 136
137/* path to find crt1.o, crti.o and crtn.o. Only needed when generating137/* path to find crt1.o, crti.o and crtn.o. Only needed when generating
138 executables or dlls */138 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
140 144
141#define INCLUDE_STACK_SIZE 32145#define INCLUDE_STACK_SIZE 32
142#define IFDEF_STACK_SIZE 64146#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
1307#elif defined TCC_ARM_EABI1307#elif defined TCC_ARM_EABI
1308static const char elf_interp[] = "/lib/ld-linux.so.3";1308static const char elf_interp[] = "/lib/ld-linux.so.3";
1309#elif defined(TCC_TARGET_X86_64)1309#elif defined(TCC_TARGET_X86_64)
1310# if defined(TCC_TARGET_X86_64_CENTOS)
1311static const char elf_interp[] = "/lib64/ld-linux-x86-64.so.2";
1312# else
1310static const char elf_interp[] = "/lib/ld-linux-x86-64.so.2";1313static const char elf_interp[] = "/lib/ld-linux-x86-64.so.2";
1314# endif /* TCC_TARGET_X86_64_CENTOS */
1311#elif defined(TCC_UCLIBC)1315#elif defined(TCC_UCLIBC)
1312static const char elf_interp[] = "/lib/ld-uClibc.so.0";1316static const char elf_interp[] = "/lib/ld-uClibc.so.0";
1313#else1317#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