@@ -2043,9 +2043,12 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2043
2043
for (const Action *A : AllLinkerInputs)
2044
2044
if (A->getType () == file_types::TY_Object)
2045
2045
AutolinkExtractInputs.push_back (A);
2046
- if (!AutolinkExtractInputs.empty () &&
2047
- (TC.getTriple ().getObjectFormat () == llvm::Triple::ELF ||
2048
- TC.getTriple ().isOSCygMing ())) {
2046
+ const auto &Triple = TC.getTriple ();
2047
+ const bool AutolinkExtractRequired =
2048
+ (Triple.getObjectFormat () == llvm::Triple::ELF && !Triple.isPS4 ()) ||
2049
+ Triple.getObjectFormat () == llvm::Triple::Wasm ||
2050
+ Triple.isOSCygMing ();
2051
+ if (!AutolinkExtractInputs.empty () && AutolinkExtractRequired) {
2049
2052
auto *AutolinkExtractAction =
2050
2053
C.createAction <AutolinkExtractJobAction>(AutolinkExtractInputs);
2051
2054
// Takes the same inputs as the linker...
@@ -2055,8 +2058,9 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
2055
2058
2056
2059
if (MergeModuleAction) {
2057
2060
if (OI.DebugInfoLevel == IRGenDebugInfoLevel::Normal) {
2058
- if (TC.getTriple ().getObjectFormat () == llvm::Triple::ELF ||
2059
- TC.getTriple ().getObjectFormat () == llvm::Triple::COFF) {
2061
+ const bool ModuleWrapRequired =
2062
+ Triple.getObjectFormat () != llvm::Triple::MachO;
2063
+ if (ModuleWrapRequired) {
2060
2064
auto *ModuleWrapAction =
2061
2065
C.createAction <ModuleWrapJobAction>(MergeModuleAction);
2062
2066
LinkAction->addInput (ModuleWrapAction);
0 commit comments