This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][wip] Make stabs.s work on Windows
AbandonedPublic

Authored by int3 on Mar 20 2021, 10:39 AM.

Details

Reviewers
gkm
Group Reviewers
Restricted Project
Summary

Attempting this after @thakis's comment: https://reviews.llvm.org/D98395#2639561

Diff Detail

Unit TestsFailed

Event Timeline

int3 created this revision.Mar 20 2021, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2021, 10:39 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
int3 requested review of this revision.Mar 20 2021, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2021, 10:39 AM
int3 removed a reviewer: Restricted Project.Mar 20 2021, 2:54 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptMar 20 2021, 2:54 PM
int3 retitled this revision from [lld-macho] Make stabs.s work on Windows to [lld-macho][wip] Make stabs.s work on Windows.Mar 22 2021, 6:52 AM
int3 edited the summary of this revision. (Show Details)
int3 added a subscriber: thakis.

Something weird seems to be happening with the escaping of slashes on the Windows command line... @thakis, any idea why that might happen?

int3 planned changes to this revision.Mar 26 2021, 11:05 AM

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 :/

lld/MachO/SyntheticSections.cpp
632

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.

int3 added a comment.Apr 16 2021, 8:02 AM

Something weird seems to be happening with the escaping of slashes on the Windows command line

I think that's actually a red herring, it's just an artifact of how llvm-lit is printing out stuff. The reason the paths don't match is that lib/Object/Archive.h isn't using the host path separators, so we end up with a mixture of "/" and "\" on Windows. Didn't get around to pinpointing the exact function responsible though.

lld/MachO/SyntheticSections.cpp
632

I guess it depends if we think the main use case after for linking Mach-O on Windows is to do remote debugging or to copy all the files (source and all) to the target machine. I think remote debugging is more likely, in which case the change here is probably wrong...

int3 added a comment.Apr 16 2021, 8:11 AM

Maybe using %/t (see https://llvm.org/docs/CommandGuide/lit.html#substitutions) in the test could work?

Ah yeah I stumbled across this yesterday... but due to the aforementioned mixed-separator issue it doesn't solve things.

int3 abandoned this revision.Jul 17 2021, 1:51 PM