Index: clang/lib/Driver/ToolChains/AIX.cpp =================================================================== --- clang/lib/Driver/ToolChains/AIX.cpp +++ clang/lib/Driver/ToolChains/AIX.cpp @@ -99,8 +99,7 @@ } // Specify PGO linker option without LTO - if (!D.isUsingLTO() && - (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, + if (Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs, false) || Args.hasFlag(options::OPT_fprofile_generate, options::OPT_fno_profile_generate, false) || @@ -115,7 +114,7 @@ Args.hasFlag(options::OPT_fcs_profile_generate_EQ, options::OPT_fno_profile_generate, false) || Args.hasArg(options::OPT_fcreate_profile) || - Args.hasArg(options::OPT_coverage))) + Args.hasArg(options::OPT_coverage)) CmdArgs.push_back("-bdbg:namedsects"); // Specify linker output file. Index: clang/test/Driver/aix-ld.c =================================================================== --- clang/test/Driver/aix-ld.c +++ clang/test/Driver/aix-ld.c @@ -692,7 +692,7 @@ // CHECK-PGO-LTO: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" // CHECK-PGO-LTO: "-isysroot" "[[SYSROOT:[^"]+]]" // CHECK-PGO-LTO: "{{.*}}ld{{(.exe)?}}" -// CHECK-PGO-LTO-NOT: "-bdbg:namedsects" +// CHECK-PGO-LTO: "-bdbg:namedsects" // CHECK-PGO-LTO: "-b32" // CHECK-PGO-LTO: "-bpT:0x10000000" "-bpD:0x20000000" // CHECK-PGO-LTO: "[[SYSROOT]]/usr/lib{{/|\\\\}}crt0.o"