Skip to content

Commit 9f06b28

Browse files
aditya-chaudhary1Aditya Chaudhary
andauthored
[AIX] Disable -gsplit-dwarf as it is unsupported at the moment on AIX (#158199)
**-gsplit-dwarf** flag causes an internal compiler error on AIX. This PR aims to disable the -gsplit-dwarf flag on the AIX platform, as it is unsupported at the moment. Co-authored-by: Aditya Chaudhary <[email protected]>
1 parent 1aa7159 commit 9f06b28

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4393,6 +4393,13 @@ renderDebugOptions(const ToolChain &TC, const Driver &D, const llvm::Triple &T,
43934393
// object file generation and no IR generation, -gN should not be needed. So
43944394
// allow -gsplit-dwarf with either -gN or IR input.
43954395
if (IRInput || Args.hasArg(options::OPT_g_Group)) {
4396+
// FIXME: -gsplit-dwarf on AIX is currently unimplemented.
4397+
if (TC.getTriple().isOSAIX() && Args.hasArg(options::OPT_gsplit_dwarf)) {
4398+
D.Diag(diag::err_drv_unsupported_opt_for_target)
4399+
<< Args.getLastArg(options::OPT_gsplit_dwarf)->getSpelling()
4400+
<< TC.getTriple().str();
4401+
return;
4402+
}
43964403
Arg *SplitDWARFArg;
43974404
DwarfFission = getDebugFissionKind(D, Args, SplitDWARFArg);
43984405
if (DwarfFission != DwarfFissionKind::None &&
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Verify error message is emitted for `-gsplit-dwarf` on AIX
2+
// as it's unsupported at the moment.
3+
4+
// RUN: not %clang -target powerpc-ibm-aix -gdwarf-4 -gsplit-dwarf %s 2>&1 \
5+
// RUN: | FileCheck %s --check-prefix=UNSUP_OPT_AIX
6+
// RUN: not %clang -target powerpc64-ibm-aix -gdwarf-4 -gsplit-dwarf %s 2>&1 \
7+
// RUN: | FileCheck %s --check-prefix=UNSUP_OPT_AIX64
8+
9+
// UNSUP_OPT_AIX: error: unsupported option '-gsplit-dwarf' for target 'powerpc-ibm-aix'
10+
// UNSUP_OPT_AIX64: error: unsupported option '-gsplit-dwarf' for target 'powerpc64-ibm-aix'
11+
12+
int main(){return 0;}

0 commit comments

Comments
 (0)