History

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

Henry Kroll III committed 15 years ago

Commit f1c9f641 parent 9036c183 files · +8 −15Browse files

Unified · Split

3 files
  1. libtcc.c +3 −9
  2. tcc.h +3 −0
  3. tccelf.c +2 −6
libtcc.c+3−9
@@ -970,15 +970,9 @@ LIBTCCAPI TCCState *tcc_new(void) · 969 unmodified lines
970970
971971 #ifndef TCC_TARGET_PE
972972 /* 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);
982976 #endif
983977
984978 /* no section zero */
tcc.h+3−0
@@ -140,10 +140,13 @@ typedef int BOOL; · 139 unmodified lines
140140
141141 /* path to find crt1.o, crti.o and crtn.o. Only needed when generating
142142 executables or dlls */
143+
143144 #if defined(TCC_TARGET_X86_64_CENTOS)
144145 # define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib64"
146+# define CONFIG_TCC_LDDIR "/lib64"
145147 #else
146148 # define CONFIG_TCC_CRT_PREFIX CONFIG_SYSROOT "/usr/lib"
149+# define CONFIG_TCC_LDDIR "/lib"
147150 #endif
148151
149152 #define INCLUDE_STACK_SIZE 32
tccelf.c+2−6
@@ -1251,7 +1251,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1250 unmodified lines
12511251 if (!s1->nostdlib) {
12521252 #ifdef CONFIG_USE_LIBGCC
12531253 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");
12551255 #else
12561256 tcc_add_library(s1, "c");
12571257 #ifndef WITHOUT_LIBTCC
@@ -1337,11 +1337,7 @@ static char elf_interp[] = "/lib/ld.so.1"; · 79 unmodified lines
13371337 #elif defined TCC_ARM_EABI
13381338 static const char elf_interp[] = "/lib/ld-linux.so.3";
13391339 #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";
13451341 #elif defined(TCC_UCLIBC)
13461342 static const char elf_interp[] = "/lib/ld-uClibc.so.0";
13471343 #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