diff options
author | Yao Qi <yao.qi@linaro.org> | 2018-01-08 10:09:32 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2018-01-08 10:09:32 +0000 |
commit | 1e5ded6ce688ddee065fa852053dda07fcce959e (patch) | |
tree | 5e1d593ab7b7e216bc1ee0f05ff367b49009ac8e /gdb/configure.ac | |
parent | Fix second-to-last gdb/testsuite/ChangeLog entry. (diff) | |
download | binutils-gdb-1e5ded6ce688ddee065fa852053dda07fcce959e.tar.gz binutils-gdb-1e5ded6ce688ddee065fa852053dda07fcce959e.tar.bz2 binutils-gdb-1e5ded6ce688ddee065fa852053dda07fcce959e.zip |
Fix GDB build failure when $development is false
We don't build GDB selftests bits when $development is false. However, if
we turn bfd/development.sh:$development to false, common/selftest.c is
compiled which is not expected. It causes the build failure,
selftest.o: In function `selftests::run_tests(char const*)':
binutils-gdb/gdb/common/selftest.c:97: undefined reference to `selftests::reset()'
collect2: error: ld returned 1 exit status
I fix this issue by putting selftest.o selftest-arch.o into CONFIG_OBS
only when $development is true. After this is fixed, there are other
build failures in maint.c, this patch fixes them as well.
In the release mode, the output of these commands are:
(gdb) maintenance selftest
Selftests are not available in a non-development build.
(gdb) maintenance selftest foo
Selftests are not available in a non-development build.
(gdb) maintenance info selftests
Selftests are not available in a non-development build.
gdb:
2018-01-08 Yao Qi <yao.qi@linaro.org>
Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (COMMON_SFILES): Remove selftest-arch.c and
common/selftest.c.
(COMMON_OBS): Remove selftest.o.
* configure.ac: Append selftest-arch.c and common/selftest.c to
CONFIG_SRCS. Append selftest-arch.o and selftest.o to COMMON_OBS.
* configure: Re-generated.
* maint.c (maintenance_selftest): Wrap selftests::run_tests with
GDB_SELF_TEST.
(maintenance_info_selftests): Likewise.
gdb/testsuite:
2018-01-08 Simon Marchi <simon.marchi@ericsson.com>
* gdb.gdb/unittest.exp: Match output in non-development mode.
Diffstat (limited to 'gdb/configure.ac')
-rw-r--r-- | gdb/configure.ac | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/configure.ac b/gdb/configure.ac index 3e073b506ed..3db44ae758e 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2293,8 +2293,8 @@ AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8", if $development; then AC_DEFINE(GDB_SELF_TEST, 1, [Define if self-testing features should be enabled]) - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS)" + CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_UNITTESTS_OBS) selftest.o selftest-arch.o" + CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_UNITTESTS_SRCS) common/selftest.c selftest-arch.c" fi GDB_AC_TRANSFORM([gdb], [GDB_TRANSFORM_NAME]) |