mirror of
https://github.com/frida/tinycc
synced 2024-11-24 00:29:38 +03:00
Added patch to detect and use the paths for 64bit libraries as
used by CentOS (affects X86_64 only).
This commit is contained in:
parent
900871ca8d
commit
253bad7993
1
Makefile
1
Makefile
@ -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
|
||||
|
8
libtcc.c
8
libtcc.c
@ -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
6
tcc.h
@ -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
|
||||
|
4
tccelf.c
4
tccelf.c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user