AIX does not support undefined weak. Skip those tests in the testsuite. Also, select COFF as AIX file format without requiring objdump.
* gcc.dg/attr-weakref-1.c: Skip on AIX. * gcc.dg/torture/pr53922.c: Skip on AIX. * lib/file-format.exp (gcc_target_object_format): AIX is COFF. Bootstrapped on powerpc-ibm-aix7.1.0.0. Thanks, David Index: gcc.dg/attr-weakref-1.c =================================================================== --- gcc.dg/attr-weakref-1.c (revision 202260) +++ gcc.dg/attr-weakref-1.c (working copy) @@ -4,7 +4,7 @@ // This test requires support for undefined weak symbols. This support // is not available on hppa*-*-hpux*. The test is skipped rather than // xfailed to suppress the warning that would otherwise arise. -// { dg-skip-if "" { "*-*-darwin*" "hppa*-*-hpux*" } "*" { "" } } +// { dg-skip-if "" { "*-*-darwin*" "hppa*-*-hpux*" "*-*-aix*" } "*" { "" } } // For kernel modules and static RTPs, the loader treats undefined weak // symbols in the same way as undefined strong symbols. The test // therefore fails to load, so skip it.Index: gcc.dg/torture/pr53922.c =================================================================== --- gcc.dg/torture/pr53922.c (revision 202260) +++ gcc.dg/torture/pr53922.c (working copy) @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-require-weak "" } */ /* { dg-skip-if "No undefined" { *-*-mingw* } { "*" } { "" } } */ +/* { dg-skip-if "No undefined weak" { *-*-aix* } { "*" } { "" } } */ /* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } { "*" } { "" } } */ /* { dg-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */ Index: lib/file-format.exp =================================================================== --- lib/file-format.exp (revision 202260) +++ lib/file-format.exp (working copy) @@ -38,6 +38,9 @@ } else { set gcc_target_object_format_saved som } + } elseif { [istarget *-*-aix*] } { + # AIX doesn't necessarily have objdump, so hand-code it. + set gcc_target_object_format_saved coff } else { set objdump_name [find_binutils_prog objdump] set open_file [open objfmtst.c w]