| @@ -1134,7 +1134,7 @@ LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname) · 1133 unmodified lines |
| 1134 | } | 1134 | } |
| 1135 | | 1135 | |
| 1136 | static int tcc_add_library_internal(TCCState *s, const char *fmt, | 1136 | static 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 |
| 1157 | ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags) | 1152 | ST_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 | #endif | 1157 | #endif |
| 1163 | | 1158 | |
| @@ -1165,7 +1160,7 @@ ST_FUNC int tcc_add_dll(TCCState *s, const char *filename, int flags) · 1 unmodified line |
| 1165 | ST_FUNC int tcc_add_crt(TCCState *s1, const char *filename) | 1160 | ST_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 | } |