[PATCH] D99023: [lld-macho][wip] Make stabs.s work on Windows
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 16 07:19:41 PDT 2021
thakis added a comment.
Maybe using `%/t` (see https://llvm.org/docs/CommandGuide/lit.html#substitutions) in the test could work?
IIRC backslashes doesn't work great with the `-D` FileCheck due to lit not knowing what the right escape level is. I vaguely remember hitting this somewhere not too long ago. I can't remember what I did about it though :/
================
Comment at: lld/MachO/SyntheticSections.cpp:632
// in an absolute path. `append` would give us a relative path for that case.
- if (!dir.endswith(sep))
- dir += sep;
+ // FIXME: This assumes that the source was compiled on a POSIX machine.
+ if (!dir.endswith("/"))
----------------
Hm, it assumes that the source was compiled with a mach-o triple. Clang hopefully uses slashes when targeting mach-o even on Windows -- if not, that's a bug, right? The host machine shouldn't leak into the target machine. And assuming mach-o slashiness in a mach-o linker seems sensible. So this change here looks good to me, just the FIXME doesn't.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99023/new/
https://reviews.llvm.org/D99023
More information about the llvm-commits
mailing list