diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2469,6 +2469,12 @@ PersonalityEncoding = 0; LSDAEncoding = 0; CallSiteEncoding = dwarf::DW_EH_PE_udata4; + + // AIX debug for thread local location is not ready. And for integrated as + // mode, the relocatable address for the thread local variable will cause + // linker error. So disable the location attribute generation for thread local + // variables for now. + SupportDebugThreadLocalLocation = false; } MCSection *TargetLoweringObjectFileXCOFF::getStaticCtorSection( diff --git a/llvm/test/CodeGen/PowerPC/tls-debug-aix.ll b/llvm/test/CodeGen/PowerPC/tls-debug-aix.ll --- a/llvm/test/CodeGen/PowerPC/tls-debug-aix.ll +++ b/llvm/test/CodeGen/PowerPC/tls-debug-aix.ll @@ -8,8 +8,8 @@ ; ASM: .dwsect 0x10000 ; ASM-NEXT: .dwinfo: ; ASM: .byte{{.*}}DW_TAG_variable -; ASM: .byte{{.*}}DW_AT_location -; ASM: .vbyte{{.*}}i[TL] +; ASM-NOT: .byte{{.*}}DW_AT_location +; ASM-NOT: .vbyte{{.*}}i[TL] ; ASM: .byte{{.*}}DW_TAG_ ; OBJ: DW_TAG_variable @@ -18,7 +18,7 @@ ; OBJ-NEXT: DW_AT_external ; OBJ-NEXT: DW_AT_decl_file ; OBJ-NEXT: DW_AT_decl_line -; OBJ-NEXT: DW_AT_location{{.*}}DW_OP_form_tls_address +; OBJ-NOT: DW_AT_location{{.*}}DW_OP_form_tls_address ; OBJ: DW_TAG_ @i = thread_local global i32 20, align 4, !dbg !0