ports/devel/clang-tools-extra/patches/patch-lib_MC_MCParser_AsmParser_cpp

23 lines
764 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
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.