Lines 267-284
Link Here
|
267 |
|
267 |
|
268 |
template <typename E> |
268 |
template <typename E> |
269 |
std::string find_dso(Context<E> &ctx, const std::string &self) { |
269 |
std::string find_dso(Context<E> &ctx, const std::string &self) { |
270 |
// Look for mold-wrapper.so from the same directory as the executable is. |
270 |
return "/usr/lib64/mold/mold-wrapper.so"; |
271 |
std::string path = std::string(path_dirname(self)) + "/mold-wrapper.so"; |
|
|
272 |
if (is_regular_file(path)) |
273 |
return path; |
274 |
|
275 |
// If not exist, mold might be installed as $PREFIX/bin/mold and the |
276 |
// DSO as $PREFIX/lib/mold/mold-wrapper.so. |
277 |
path = path_clean(self + "/../../lib/mold/mold-wrapper.so"); |
278 |
if (is_regular_file(path)) |
279 |
return path; |
280 |
|
281 |
Fatal(ctx) << "mold-wrapper.so is missing"; |
282 |
} |
271 |
} |
283 |
|
272 |
|
284 |
template <typename E> |
273 |
template <typename E> |