openbsd-ports/devel/llvm/patches/patch-lib_MC_MCParser_AsmParser_cpp
2022-03-10 00:04:05 +00:00

23 lines
764 B
Plaintext

make clang include a FILE symbol for .(s|S) files
This is mostly needed by syspatch at the moment to be
to be able to re-link in the same order as the original
libraries were linked with by relying on the readelf(1)
and without this .(s|S) assembly files were not getting
a file directive.
Index: lib/MC/MCParser/AsmParser.cpp
--- lib/MC/MCParser/AsmParser.cpp.orig
+++ lib/MC/MCParser/AsmParser.cpp
@@ -975,6 +975,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool No
(void)InsertResult;
}
+ StringRef Filename = getContext().getMainFileName();
+ if (!Filename.empty() && (Filename.compare(StringRef("-")) != 0))
+ Out.emitFileDirective(Filename);
+
getTargetParser().onBeginOfFile();
// While we have input, parse each statement.