diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2019-10-09 10:42:00 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-06-26 15:56:38 +0100 |
commit | 1776e3e59ca6200dff981894361b8b49cb453766 (patch) | |
tree | bc9088101bf5941ecfb9455f668af46beaf53484 /gdb/testsuite | |
parent | d1c361252ba4902046fd7725f880fa166e88e3e4 (diff) | |
download | gdb-1776e3e59ca6200dff981894361b8b49cb453766.zip gdb-1776e3e59ca6200dff981894361b8b49cb453766.tar.gz gdb-1776e3e59ca6200dff981894361b8b49cb453766.tar.bz2 |
Fix --enable-libctf and --disable-static
This fixes test runs and compilation when --disable-libctf,
--disable-static, or --enable-shared are passed.
Changes since v2: Use GCC_ENABLE and fix indentation. Fix prototype
using 'void'. Use 'unsupported' and gdb_caching_proc.
Changes since v3: Adapt to upstream changes providing skip_ctf_tests.
Changes since v4: Adapt to upstream changes in the seven months (!)
since I last looked at this.
gdb/ChangeLog
* configure.ac: Add --enable-libctf: handle --disable-static
properly.
* acinclude.m4: sinclude ../config/enable.m4.
* Makefile.in (aclocal_m4_deps): Adjust accordingly.
(LIBCTF): Substitute in.
(CTF_DEPS): New, likewise.
(CLIBS): libctf needs symbols from libbfd: move earlier.
(CDEPS): Use CTF_DEPS, not LIBCTF, now LIBCTF can include rpath
flags.
* ctfread.c: Surround in ENABLE_LIBCTF.
(elfctf_build_psymtabs) [!ENABLE_LIBCTF]: New stub.
* configure: Regenerate.
* config.in: Likewise.
gdb/testsuite/ChangeLog
* configure.ac: Add --enable-libctf.
* aclocal.m4: sinclude ../config/enable.m4.
* Makefile.in (site.exp): Add enable_libctf to site.exp.
* lib/gdb.exp (skip_ctf_tests): Use it.
* gdb.base/ctf-constvars.exp: Error message tweak.
* gdb.base/ctf-ptype.exp: Likewise.
* configure: Regenerate.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/testsuite/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/testsuite/aclocal.m4 | 1 | ||||
-rwxr-xr-x | gdb/testsuite/configure | 18 | ||||
-rw-r--r-- | gdb/testsuite/configure.ac | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ctf-constvars.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/ctf-ptype.exp | 3 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 9 |
8 files changed, 45 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a01a065..bf9d2c4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2020-06-26 Nick Alcock <nick.alcock@oracle.com> + + * configure.ac: Add --enable-libctf. + * aclocal.m4: sinclude ../config/enable.m4. + * Makefile.in (site.exp): Add enable_libctf to site.exp. + * lib/gdb.exp (skip_ctf_tests): Use it. + * gdb.base/ctf-constvars.exp: Error message tweak. + * gdb.base/ctf-ptype.exp: Likewise. + * configure: Regenerate. + 2020-06-26 Gary Benson <gbenson@redhat.com> * gdb.cp/try_catch.cc: Include string.h. diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index dbe95b3..61209d8 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -28,6 +28,7 @@ program_transform_name = @program_transform_name@ build_canonical = @build@ host_canonical = @host@ target_canonical = @target@ +enable_libctf = @enable_libctf@ SHELL = @SHELL@ EXEEXT = @EXEEXT@ @@ -131,6 +132,7 @@ $(abs_builddir)/site.exp site.exp: ./config.status Makefile @echo "set build_triplet ${build_canonical}" >> ./tmp0 @echo "set srcdir ${abs_srcdir}" >> ./tmp0 @echo "set tool gdb" >> ./tmp0 + @echo "set enable_libctf ${enable_libctf}" >> ./tmp0 @echo 'source $${srcdir}/lib/append_gdb_boards_dir.exp' >> ./tmp0 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 @cat ./tmp0 > site.exp diff --git a/gdb/testsuite/aclocal.m4 b/gdb/testsuite/aclocal.m4 index 5061eef..c5d3ba5 100644 --- a/gdb/testsuite/aclocal.m4 +++ b/gdb/testsuite/aclocal.m4 @@ -1,5 +1,6 @@ m4_include(../../config/acx.m4) m4_include(../../config/override.m4) +m4_include(../../config/enable.m4) m4_include(../transform.m4) # AM_CONDITIONAL -*- Autoconf -*- diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure index cc00f8d..0de6074 100755 --- a/gdb/testsuite/configure +++ b/gdb/testsuite/configure @@ -638,6 +638,7 @@ LDFLAGS CFLAGS CC RPATH_ENVVAR +enable_libctf subdirs target_noncanonical target_os @@ -694,6 +695,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_gdbtk +enable_libctf enable_shared ' ac_precious_vars='build_alias @@ -1323,6 +1325,7 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-gtk enable gdbtk graphical user interface (GUI) + --enable-libctf Handle .ctf type-info sections [default=yes] --enable-shared build shared libraries deault=yes Some influential environment variables: @@ -2189,6 +2192,21 @@ subdirs="$subdirs gdb.gdbtk" fi + # Check whether --enable-libctf was given. +if test "${enable_libctf+set}" = set; then : + enableval=$enable_libctf; + case "$enableval" in + yes|no) ;; + *) as_fn_error $? "Argument to enable/disable libctf must be yes or no" "$LINENO" 5 ;; + esac + +else + enable_libctf=yes +fi + + + + # Enable shared libraries. # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac index b387efe..cc62c3f 100644 --- a/gdb/testsuite/configure.ac +++ b/gdb/testsuite/configure.ac @@ -43,6 +43,9 @@ if test $enable_gdbtk = yes; then AC_CONFIG_SUBDIRS(gdb.gdbtk) fi +GCC_ENABLE([libctf], [yes], [], [Handle .ctf type-info sections]) +AC_SUBST(enable_libctf) + # Enable shared libraries. AC_ARG_ENABLE(shared, [ --enable-shared build shared libraries [deault=yes]],, diff --git a/gdb/testsuite/gdb.base/ctf-constvars.exp b/gdb/testsuite/gdb.base/ctf-constvars.exp index b52ba71..38ee052 100644 --- a/gdb/testsuite/gdb.base/ctf-constvars.exp +++ b/gdb/testsuite/gdb.base/ctf-constvars.exp @@ -25,7 +25,7 @@ # with mixed types. if [skip_ctf_tests] { - unsupported "no ctf debug format support" + unsupported "no CTF debug format support, or CTF disabled in GDB" return 0 } diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp index dd1621b..f981477 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -16,7 +16,7 @@ # This file is a subset of ptype.exp written by Rob Savoye. (rob@cygnus.com) if [skip_ctf_tests] { - unsupported "no ctf debug format support" + unsupported "no CTF debug format support, or CTF disabled in GDB" return 0 } @@ -24,6 +24,7 @@ standard_testfile .c # Using `-gt` generates full-fledged CTF debug information. set opts "additional_flags=-gt" + if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile] [list $opts nowarnings]] } { return 0 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 8dbfa7e..e34513f 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -7169,9 +7169,16 @@ proc cmp_file_string { file str msg } { } # Does the compiler support CTF debug output using '-gt' compiler -# flag? If not then we should skip these tests. +# flag? If not then we should skip these tests. We should also +# skip them if libctf was explicitly disabled. gdb_caching_proc skip_ctf_tests { + global enable_libctf + + if {$enable_libctf eq "no"} { + return 1 + } + return ![gdb_can_simple_compile ctfdebug { int main () { return 0; |