debug/gdb: add option to enable/disable the IPA lib for gdbserver
author"Yann E. MORIN" <yann.morin.1998@free.fr>
Thu May 17 17:56:27 2012 +0200 (2012-05-17)
changeset 2986c301df1af7cb
parent 2985 2c13e5ce38fd
child 2987 366637520035
debug/gdb: add option to enable/disable the IPA lib for gdbserver

gdbserver >= 7.2 comes with an optional library to use tracepoints, the
In Process Agent (IPA) library, libinproctrace.so.

Currently, we build gdbserver staticaly, but that breaks the build of
the IPA lib.

Add an option to biuld the IPA lib, but not if statically linking.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
config/debug/gdb.in.gdbserver
scripts/build/debug/300-gdb.sh
     1.1 --- a/config/debug/gdb.in.gdbserver	Thu May 17 18:07:28 2012 +0200
     1.2 +++ b/config/debug/gdb.in.gdbserver	Thu May 17 17:56:27 2012 +0200
     1.3 @@ -9,6 +9,11 @@
     1.4  
     1.5  if GDB_GDBSERVER
     1.6  
     1.7 +config GDB_GDBSERVER_HAS_IPA_LIB
     1.8 +    bool
     1.9 +    depends on GDB_7_2_or_later
    1.10 +    default y
    1.11 +
    1.12  config GDB_GDBSERVER_STATIC
    1.13      bool
    1.14      prompt "Build a static gdbserver"
    1.15 @@ -17,6 +22,21 @@
    1.16        In case you have trouble with dynamic loading of shared libraries,
    1.17        you will find that a static gdbserver comes in handy.
    1.18  
    1.19 +config GDB_GDBSERVER_BUILD_IPA_LIB
    1.20 +    bool
    1.21 +    prompt "Build the IPA library"
    1.22 +    depends on GDB_GDBSERVER_HAS_IPA_LIB && !GDB_GDBSERVER_STATIC
    1.23 +    help
    1.24 +      gdbserver >= 7.2 comes with an optional library to use tracepoints,
    1.25 +      the In Process Agent (IPA) library, libinproctrace.so.
    1.26 +      
    1.27 +      Say 'y' if you indend to use tracepoints when debugging your
    1.28 +      programs with gdbserver.
    1.29 +      
    1.30 +      Note: Currently, building this library is not possible when the
    1.31 +            gdbserver is built statically. This is a limitation in
    1.32 +            crosstool-NG, so do not bug upstream about it...
    1.33 +
    1.34  endif # GDB_GDBSERVER
    1.35  
    1.36  if BARE_METAL
     2.1 --- a/scripts/build/debug/300-gdb.sh	Thu May 17 18:07:28 2012 +0200
     2.2 +++ b/scripts/build/debug/300-gdb.sh	Thu May 17 17:56:27 2012 +0200
     2.3 @@ -369,6 +369,14 @@
     2.4  
     2.5          gdbserver_extra_config=("${extra_config[@]}")
     2.6  
     2.7 +        if [ "${CT_GDB_GDBSERVER_HAS_IPA_LIB}" = "y" ]; then
     2.8 +            if [ "${CT_GDB_GDBSERVER_BUILD_IPA_LIB}" = "y" ]; then
     2.9 +                gdbserver_extra_config+=( --enable-inprocess-agent )
    2.10 +            else
    2.11 +                gdbserver_extra_config+=( --disable-inprocess-agent )
    2.12 +            fi
    2.13 +        fi
    2.14 +
    2.15          CT_DoExecLog CFG                                \
    2.16          LDFLAGS="${gdbserver_LDFLAGS}"                  \
    2.17          "${gdb_src_dir}/gdb/gdbserver/configure"        \