mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Driver: do not generate a dSYM bundle for static archives
When building a static library with debug information, do not create a dSYM generation job as it cannot be executed on a non-image target. This is important for the case where the single invocation is both the compile and link job. This was detected in conjunction with @gottesmm.
This commit is contained in:
@@ -2222,13 +2222,25 @@ void Driver::buildActions(SmallVectorImpl<const Action *> &TopLevelActions,
|
||||
}
|
||||
TopLevelActions.push_back(LinkAction);
|
||||
|
||||
if (TC.getTriple().isOSDarwin() &&
|
||||
OI.DebugInfoLevel > IRGenDebugInfoLevel::None) {
|
||||
auto *dSYMAction = C.createAction<GenerateDSYMJobAction>(LinkAction);
|
||||
TopLevelActions.push_back(dSYMAction);
|
||||
if (Args.hasArg(options::OPT_verify_debug_info)) {
|
||||
TopLevelActions.push_back(
|
||||
C.createAction<VerifyDebugInfoJobAction>(dSYMAction));
|
||||
if (TC.getTriple().isOSDarwin()) {
|
||||
switch (OI.LinkAction) {
|
||||
case LinkKind::Executable:
|
||||
case LinkKind::DynamicLibrary:
|
||||
if (OI.DebugInfoLevel > IRGenDebugInfoLevel::None) {
|
||||
auto *dSYMAction = C.createAction<GenerateDSYMJobAction>(LinkAction);
|
||||
TopLevelActions.push_back(dSYMAction);
|
||||
if (Args.hasArg(options::OPT_verify_debug_info)) {
|
||||
TopLevelActions.push_back(
|
||||
C.createAction<VerifyDebugInfoJobAction>(dSYMAction));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LinkKind::None:
|
||||
LLVM_FALLTHROUGH;
|
||||
case LinkKind::StaticLibrary:
|
||||
// Cannot build the DSYM bundle for non-image targets.
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user