Previously if you passed -oso_prefix path/to/foo/ with a trailing
slash at the end, using real_path would remove that slash, but that
slash is necessary to make sure OSO prefix paths end up as valid
relative paths instead of starting with /.
Details
- Reviewers
int3 oontvoo gkm thevinster - Group Reviewers
Restricted Project - Commits
- rGeb6f9f3123e6: [lld-macho] Fix trailing slash in oso_prefix
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/MachO/Driver.cpp | ||
---|---|---|
1164 | Maybe the second half of the conditional here isn't necessary? |
LG Thanks!
lld/MachO/Driver.cpp | ||
---|---|---|
1164 | I guess it's not needed if we can count on real_path to NOT change its behaviour. |
lld/MachO/Driver.cpp | ||
---|---|---|
1164 | Given that realpath is a POSIX API with very wide use, I think it is extremely unlikely to ever change its behavior... I guess this means we can remove the check on line 1160 too |
Nice find!
lld/MachO/Driver.cpp | ||
---|---|---|
1160–1163 | We can simplify this with a || in the first if? Could we also document the behavior of real_path here (that it removes the trailing slash)? |
We can simplify this with a || in the first if? Could we also document the behavior of real_path here (that it removes the trailing slash)?