x86_64: fix --with-libgcc and simplify biarch paths

This commit is contained in:
Henry Kroll III 2010-11-25 02:57:19 -08:00
parent 9036c18170
commit f1c9f649da
3 changed files with 8 additions and 15 deletions

View file

@ -970,15 +970,9 @@ LIBTCCAPI TCCState *tcc_new(void)
#ifndef TCC_TARGET_PE #ifndef TCC_TARGET_PE
/* default library paths */ /* default library paths */
# if defined(TCC_TARGET_X86_64_CENTOS) tcc_add_library_path(s, CONFIG_TCC_CRT_PREFIX);
tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib64"); tcc_add_library_path(s, CONFIG_TCC_LDDIR);
tcc_add_library_path(s, CONFIG_SYSROOT "/lib64"); tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local"CONFIG_TCC_LDDIR);
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 #endif
/* no section zero */ /* no section zero */

3
tcc.h
View file

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

View file

@ -1251,7 +1251,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1)
if (!s1->nostdlib) { if (!s1->nostdlib) {
#ifdef CONFIG_USE_LIBGCC #ifdef CONFIG_USE_LIBGCC
tcc_add_library(s1, "c"); tcc_add_library(s1, "c");
tcc_add_file(s1, CONFIG_SYSROOT "/lib/libgcc_s.so.1"); tcc_add_file(s1, CONFIG_TCC_LDDIR"/libgcc_s.so.1");
#else #else
tcc_add_library(s1, "c"); tcc_add_library(s1, "c");
#ifndef WITHOUT_LIBTCC #ifndef WITHOUT_LIBTCC
@ -1337,11 +1337,7 @@ static char elf_interp[] = "/lib/ld.so.1";
#elif defined TCC_ARM_EABI #elif defined TCC_ARM_EABI
static const char elf_interp[] = "/lib/ld-linux.so.3"; static const char elf_interp[] = "/lib/ld-linux.so.3";
#elif defined(TCC_TARGET_X86_64) #elif defined(TCC_TARGET_X86_64)
# if defined(TCC_TARGET_X86_64_CENTOS) static const char elf_interp[] = CONFIG_TCC_LDDIR"/ld-linux-x86-64.so.2";
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) #elif defined(TCC_UCLIBC)
static const char elf_interp[] = "/lib/ld-uClibc.so.0"; static const char elf_interp[] = "/lib/ld-uClibc.so.0";
#else #else