Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -3296,8 +3296,7 @@ // FIXME: Move backend command line options to the module. // -gsplit-dwarf should turn on -g and enable the backend dwarf // splitting and extraction. - // FIXME: Currently only works on Linux. - if (getToolChain().getTriple().isOSLinux() && + if (getToolChain().getTriple().isOSBinFormatELF() && Args.hasArg(options::OPT_gsplit_dwarf)) { CmdArgs.push_back("-g"); CmdArgs.push_back("-backend-option"); @@ -4616,7 +4615,7 @@ // Add the split debug info name to the command lines here so we // can propagate it to the backend. bool SplitDwarf = Args.hasArg(options::OPT_gsplit_dwarf) && - getToolChain().getTriple().isOSLinux() && + getToolChain().getTriple().isOSBinFormatELF() && (isa(JA) || isa(JA) || isa(JA)); const char *SplitDwarfOut; @@ -5115,9 +5114,8 @@ // Handle the debug info splitting at object creation time if we're // creating an object. - // TODO: Currently only works on linux with newer objcopy. if (Args.hasArg(options::OPT_gsplit_dwarf) && - getToolChain().getTriple().isOSLinux()) + getToolChain().getTriple().isOSBinFormatELF()) SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output, SplitDebugName(Args, Inputs)); } @@ -7420,9 +7418,8 @@ // Handle the debug info splitting at object creation time if we're // creating an object. - // TODO: Currently only works on linux with newer objcopy. if (Args.hasArg(options::OPT_gsplit_dwarf) && - getToolChain().getTriple().isOSLinux()) + getToolChain().getTriple().isOSBinFormatELF()) SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output, SplitDebugName(Args, Inputs)); }