aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2023-03-29 13:21:20 +0100
committerPedro Alves <pedro@palves.net>2023-04-06 16:52:34 +0100
commitb4f767131f75179df4f47fc40e177f2607fb1003 (patch)
tree3a4b18f9c65636de44f113cab692666df1487d75 /gdb/python/python.c
parenta52aeef9237096bbde1c3092a4860d12c3778ffb (diff)
downloadbinutils-b4f767131f75179df4f47fc40e177f2607fb1003.zip
binutils-b4f767131f75179df4f47fc40e177f2607fb1003.tar.gz
binutils-b4f767131f75179df4f47fc40e177f2607fb1003.tar.bz2
Fix gdb.base/align-*.exp and Clang + LTO and AIX GCC
Clang with LTO (clang -flto) garbage collects unused global variables, Thus, gdb.base/align-c.exp and gdb.base/align-c++.exp fail with hundreds of FAILs like so: $ make check \ TESTS="gdb.*/align-*.exp" \ RUNTESTFLAGS="CC_FOR_TARGET='clang -flto' CXX_FOR_TARGET='clang++ -flto'" ... FAIL: gdb.base/align-c.exp: get integer valueof "a_char" FAIL: gdb.base/align-c.exp: print _Alignof(char) FAIL: gdb.base/align-c.exp: get integer valueof "a_char_x_char" FAIL: gdb.base/align-c.exp: print _Alignof(struct align_pair_char_x_char) FAIL: gdb.base/align-c.exp: get integer valueof "a_char_x_unsigned_char" ... AIX GCC has the same issue, and there the easier way of adding __attribute__((used)) to globals does not help. So add explicit uses of all globals to the generated code. For the C++ test, that reveals that the static variable members of the generated structs are not defined anywhere, leading to undefined references. Fixed by emitting initialization for all static members. Lastly, I noticed that CXX_FOR_TARGET was being ignored -- that's because the align-c++.exp testcase is compiling with the C compiler driver. Fixed by passing "c++" as option to prepare_for_testing. Change-Id: I874b717afde7b6fb1e45e526912b518a20a12716
Diffstat (limited to 'gdb/python/python.c')
0 files changed, 0 insertions, 0 deletions