History

Add rpath to the library paths instead of state->rpath

Riccardo Schirone committed 4 years ago

Commit 027b8fb1 parent d88857b2 files · +5 −10Browse files

Unified · Split

2 files
  1. libtcc.c +4 −9
  2. tccelf.c +1 −1
libtcc.c+4−9
@@ -1134,7 +1134,7 @@ LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname) · 1133 unmodified lines
1134}1134}
1135 1135
1136static int tcc_add_library_internal(TCCState *s, const char *fmt,1136static int tcc_add_library_internal(TCCState *s, const char *fmt,
1137 const char *filename, int flags, char **paths, int nb_paths, const char *rpath)1137 const char *filename, int flags, char **paths, int nb_paths)
1138{1138{
1139 char buf[1024];1139 char buf[1024];
1140 int i;1140 int i;
@@ -1144,11 +1144,6 @@ static int tcc_add_library_internal(TCCState *s, const char *fmt, · 3 unmodified lines
1144 if (tcc_add_file_internal(s, buf, flags | AFF_TYPE_BIN) == 0)1144 if (tcc_add_file_internal(s, buf, flags | AFF_TYPE_BIN) == 0)
1145 return 0;1145 return 0;
1146 }1146 }
1147 if (rpath) {
1148 snprintf(buf, sizeof(buf), fmt, rpath, filename);
1149 if (tcc_add_file_internal(s, buf, flags | AFF_TYPE_BIN) == 0)
1150 return 0;
1151 }
1152 return -1;1147 return -1;
1153}1148}
1154 1149
@@ -1157,7 +1152,7 @@ static int tcc_add_library_internal(TCCState *s, const char *fmt, · 2 unmodified lines
1157ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags)1152ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags)
1158{1153{
1159 return tcc_add_library_internal(s, "%s/%s", filename, flags,1154 return tcc_add_library_internal(s, "%s/%s", filename, flags,
1160 s->library_paths, s->nb_library_paths, s->rpath);1155 s->library_paths, s->nb_library_paths);
1161}1156}
1162#endif1157#endif
1163 1158
@@ -1165,7 +1160,7 @@ ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags) · 1 unmodified line
1165ST_FUNC int tcc_add_crt(TCCState *s1, const char *filename)1160ST_FUNC int tcc_add_crt(TCCState *s1, const char *filename)
1166{1161{
1167 if (-1 == tcc_add_library_internal(s1, "%s/%s",1162 if (-1 == tcc_add_library_internal(s1, "%s/%s",
1168 filename, 0, s1->crt_paths, s1->nb_crt_paths, NULL))1163 filename, 0, s1->crt_paths, s1->nb_crt_paths))
1169 tcc_error_noabort("file '%s' not found", filename);1164 tcc_error_noabort("file '%s' not found", filename);
1170 return 0;1165 return 0;
1171}1166}
@@ -1190,7 +1185,7 @@ LIBTCCAPI int tcc_add_library(TCCState *s, const char *libraryname) · 18 unmodified lines
1190 int flags = s->filetype & AFF_WHOLE_ARCHIVE;1185 int flags = s->filetype & AFF_WHOLE_ARCHIVE;
1191 while (*pp) {1186 while (*pp) {
1192 if (0 == tcc_add_library_internal(s, *pp,1187 if (0 == tcc_add_library_internal(s, *pp,
1193 libraryname, flags, s->library_paths, s->nb_library_paths, NULL))1188 libraryname, flags, s->library_paths, s->nb_library_paths))
1194 return 0;1189 return 0;
1195 ++pp;1190 ++pp;
1196 }1191 }
tccelf.c+1−1
@@ -3488,7 +3488,7 @@ ST_FUNC int tcc_load_dll(TCCState *s1, int fd, const char *filename, int level) · 3487 unmodified lines
3488 if (dt->d_tag == DT_SONAME) {3488 if (dt->d_tag == DT_SONAME) {
3489 soname = dynstr + dt->d_un.d_val;3489 soname = dynstr + dt->d_un.d_val;
3490 } else if (dt->d_tag == DT_RPATH) {3490 } else if (dt->d_tag == DT_RPATH) {
3491 s1->rpath = tcc_strdup(dynstr + dt->d_un.d_val);3491 tcc_add_library_path(s1, dynstr + dt->d_un.d_val);
3492 }3492 }
3493 }3493 }
3494 3494

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