From 1e5ded6ce688ddee065fa852053dda07fcce959e Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Mon, 8 Jan 2018 10:09:32 +0000 Subject: 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 Simon Marchi * 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 * gdb.gdb/unittest.exp: Match output in non-development mode. --- gdb/Makefile.in | 3 --- 1 file changed, 3 deletions(-) (limited to 'gdb/Makefile.in') diff --git a/gdb/Makefile.in b/gdb/Makefile.in index c0486c4..17b71c6 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1050,7 +1050,6 @@ COMMON_SFILES = \ remote-notif.c \ reverse.c \ rust-lang.c \ - selftest-arch.c \ sentinel-frame.c \ ser-event.c \ serial.c \ @@ -1139,7 +1138,6 @@ SFILES = \ common/ptid.c \ common/rsp-low.c \ common/run-time-clock.c \ - common/selftest.c \ common/signals.c \ common/signals-state-save-restore.c \ common/vec.c \ @@ -1555,7 +1553,6 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ ptid.o \ rsp-low.o \ run-time-clock.o \ - selftest.o \ signals.o \ signals-state-save-restore.o \ vec.o \ -- cgit v1.1