]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Detect and report incompatible gdb_compile options
authorGary Benson <gbenson@redhat.com>
Mon, 2 Nov 2020 14:19:29 +0000 (14:19 +0000)
committerGary Benson <gbenson@redhat.com>
Mon, 2 Nov 2020 14:19:29 +0000 (14:19 +0000)
commit6539a36d0e1a949f66ee2d58bb16c8db133c96a5
tree3e4a8174d3156bf3d6443caf5261c861ba77aff3
parent7ea44a51faeb81644eeb14f06db15cfb4a65d59e
Detect and report incompatible gdb_compile options

In commits 221db974e653659edb280787af1b3efdd1615083 and
68d654afdfcff840ebb3ae432ed72dca0521d670, these patches:

    2020-06-24  Pedro Alves  <palves@redhat.com>

* lib/gdb.exp (gdb_compile): Pass "-x c++" explicitly when
compiling C++ programs.

    2020-09-25  Gary Benson <gbenson@redhat.com>

* lib/gdb.exp (gdb_compile): Pass "-x c++" earlier, and only
for .c files.

attempted to fix problems with testcases that compile .c files
using the C++ compiler.  These patches cause gdb_compile to add
"-x c++" to the compiler options when using Clang.  This fix does
not work for gdb.base/print-file-var.exp, however, which attempts
to compile a .c input file to an executable linked with shared
libraries: the resulting command caused the compiler to attempt
to parse the .so files as C++.  This commit causes gdb_compile
to reject this combination of options.

gdb/testsuite/ChangeLog:

* lib/gdb.exp (gdb_compile): Inhibit passing "-x c++"
for .c files compiled as C++ with Clang if any shared
libraries are specified.
gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp