Added patch to detect and use the paths for 64bit libraries as

used by CentOS (affects X86_64 only).
master
Nikos Mavrogiannopoulos 2010-01-28 08:27:38 +01:00
parent 900871ca8d
commit 253bad7993
4 changed files with 17 additions and 2 deletions

View File

@ -40,6 +40,7 @@ ALLOCA_O=alloca86.o alloca86-bt.o
else
ifeq ($(ARCH),x86-64)
NATIVE_DEFINES=-DTCC_TARGET_X86_64
NATIVE_DEFINES+=$(if $(wildcard /lib64/ld-linux-x86-64.so.2),-DTCC_TARGET_X86_64_CENTOS)
LIBTCC1=libtcc1.a
BCHECK_O=
ALLOCA_O=alloca86_64.o

View File

@ -944,9 +944,15 @@ LIBTCCAPI TCCState *tcc_new(void)
#ifndef TCC_TARGET_PE
/* default library paths */
tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib");
# if defined(TCC_TARGET_X86_64_CENTOS)
tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib64");
tcc_add_library_path(s, CONFIG_SYSROOT "/lib64");
tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib64");
# else
tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib");
tcc_add_library_path(s, CONFIG_SYSROOT "/lib");
tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib");
# endif
#endif
/* no section zero */

6
tcc.h
View File

@ -136,7 +136,11 @@ typedef int BOOL;
/* path to find crt1.o, crti.o and crtn.o. Only needed when generating
executables or dlls */
#define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
#if defined(TCC_TARGET_X86_64_CENTOS)
# define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib64"
#else
# define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
#endif
#define INCLUDE_STACK_SIZE 32
#define IFDEF_STACK_SIZE 64

View File

@ -1307,7 +1307,11 @@ static const char elf_interp[] = "/libexec/ld-elf.so.1";
#elif defined TCC_ARM_EABI
static const char elf_interp[] = "/lib/ld-linux.so.3";
#elif defined(TCC_TARGET_X86_64)
# if defined(TCC_TARGET_X86_64_CENTOS)
static const char elf_interp[] = "/lib64/ld-linux-x86-64.so.2";
# else
static const char elf_interp[] = "/lib/ld-linux-x86-64.so.2";
# endif /* TCC_TARGET_X86_64_CENTOS */
#elif defined(TCC_UCLIBC)
static const char elf_interp[] = "/lib/ld-uClibc.so.0";
#else