diff options
author | Yao Qi <yao.qi@linaro.org> | 2018-01-08 10:09:33 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2018-01-08 10:16:35 +0000 |
commit | f464485579f8e0a22e87aaa568b7ed4b3ec13ee3 (patch) | |
tree | 85dc03f2d60a01d5ee9634f6726ca94fe8af75a7 /gdb/gdbserver/configure.ac | |
parent | 6caf4baae5fc2ea553b981eeb9533ce287e7b86c (diff) |
Fix GDBserver build failure when $development is false
When we set bfd/development.sh:$development to false, GDBserver failed to
build,
selftest.o: In function `selftests::run_tests(char const*)':
binutils-gdb/gdb/gdbserver/../common/selftest.c:97:undefined reference to `selftests::reset()'
collect2: error: ld returned 1 exit status
selftest.o shouldn't be compiled and linked when $development is false.
With this patch, in release mode, GDBserver doesn't nothing with option
--selftest,
$ ./gdbserver --selftest=foo
Selftests are not available in a non-development build.
$ ./gdbserver --selftest
Selftests are not available in a non-development build.
gdb/gdbserver:
2018-01-08 Yao Qi <yao.qi@linaro.org>
Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (OBS): Remove selftest.o.
* configure.ac: Set srv_selftest_objs if $development is true.
(GDBSERVER_DEPFILES): Append $srv_selftest_objs.
* configure: Re-generated.
* server.c (captured_main): Wrap variable selftest_filter with
GDB_SELF_TEST.
gdb/testsuite:
2018-01-08 Simon Marchi <simon.marchi@ericsson.com>
* gdb.server/unittest.exp: Match the output in non-development
mode.
Diffstat (limited to 'gdb/gdbserver/configure.ac')
-rw-r--r-- | gdb/gdbserver/configure.ac | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 916384ea62..7ea3654f63 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -57,6 +57,7 @@ fi GDB_AC_LIBMCHECK(${libmcheck_default}) if $development; then + srv_selftest_objs="selftest.o" AC_DEFINE(GDB_SELF_TEST, 1, [Define if self-testing features should be enabled]) fi @@ -410,7 +411,7 @@ if test "$srv_xmlfiles" != ""; then done fi -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_host_obs" +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_host_obs $srv_selftest_objs" GDBSERVER_LIBS="$srv_libs" dnl Check whether the target supports __sync_*_compare_and_swap. |