Unified · Split
| @@ -970,15 +970,9 @@ LIBTCCAPI TCCState *tcc_new(void) · 969 unmodified lines | ||
| 970 | 970 | |
| 971 | 971 | #ifndef TCC_TARGET_PE |
| 972 | 972 | /* default library paths */ |
| 973 | −# if defined(TCC_TARGET_X86_64_CENTOS) | |
| 974 | − tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib64"); | |
| 975 | − tcc_add_library_path(s, CONFIG_SYSROOT "/lib64"); | |
| 976 | − tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib64"); | |
| 977 | −# else | |
| 978 | − tcc_add_library_path(s, CONFIG_SYSROOT "/usr/lib"); | |
| 979 | − tcc_add_library_path(s, CONFIG_SYSROOT "/lib"); | |
| 980 | − tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local/lib"); | |
| 981 | −# endif | |
| 973 | + tcc_add_library_path(s, CONFIG_TCC_CRT_PREFIX); | |
| 974 | + tcc_add_library_path(s, CONFIG_TCC_LDDIR); | |
| 975 | + tcc_add_library_path(s, CONFIG_SYSROOT "/usr/local"CONFIG_TCC_LDDIR); | |
| 982 | 976 | #endif |
| 983 | 977 | |
| 984 | 978 | /* no section zero */ |
| @@ -140,10 +140,13 @@ typedef int BOOL; · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | /* path to find crt1.o, crti.o and crtn.o. Only needed when generating |
| 142 | 142 | executables or dlls */ |
| 143 | + | |
| 143 | 144 | #if defined(TCC_TARGET_X86_64_CENTOS) |
| 144 | 145 | # define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib64" |
| 146 | +# define CONFIG_TCC_LDDIR "/lib64" | |
| 145 | 147 | #else |
| 146 | 148 | # define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib" |
| 149 | +# define CONFIG_TCC_LDDIR "/lib" | |
| 147 | 150 | #endif |
| 148 | 151 | |
| 149 | 152 | #define INCLUDE_STACK_SIZE 32 |
| @@ -1251,7 +1251,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1250 unmodified lines | ||
| 1251 | 1251 | if (!s1->nostdlib) { |
| 1252 | 1252 | #ifdef CONFIG_USE_LIBGCC |
| 1253 | 1253 | tcc_add_library(s1, "c"); |
| 1254 | − tcc_add_file(s1, CONFIG_SYSROOT "/lib/libgcc_s.so.1"); | |
| 1254 | + tcc_add_file(s1, CONFIG_TCC_LDDIR"/libgcc_s.so.1"); | |
| 1255 | 1255 | #else |
| 1256 | 1256 | tcc_add_library(s1, "c"); |
| 1257 | 1257 | #ifndef WITHOUT_LIBTCC |
| @@ -1337,11 +1337,7 @@ static char elf_interp[] = "/lib/ld.so.1"; · 79 unmodified lines | ||
| 1337 | 1337 | #elif defined TCC_ARM_EABI |
| 1338 | 1338 | static const char elf_interp[] = "/lib/ld-linux.so.3"; |
| 1339 | 1339 | #elif defined(TCC_TARGET_X86_64) |
| 1340 | −# if defined(TCC_TARGET_X86_64_CENTOS) | |
| 1341 | −static const char elf_interp[] = "/lib64/ld-linux-x86-64.so.2"; | |
| 1342 | −# else | |
| 1343 | −static const char elf_interp[] = "/lib/ld-linux-x86-64.so.2"; | |
| 1344 | −# endif /* TCC_TARGET_X86_64_CENTOS */ | |
| 1340 | +static const char elf_interp[] = CONFIG_TCC_LDDIR"/ld-linux-x86-64.so.2"; | |
| 1345 | 1341 | #elif defined(TCC_UCLIBC) |
| 1346 | 1342 | static const char elf_interp[] = "/lib/ld-uClibc.so.0"; |
| 1347 | 1343 | #else |