config/debug/gdb.in.cross
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
parent 2784 258160822e35
child 3150 1d6fd9bde73c
permissions -rw-r--r--
scripts: refine static linking check to better guide the user

The current mechanism to check if static linking is possible, and the mesage
displayed on failure, can be puzzling to the unsuspecting user.

Also, the current implementation is not using the existing infrastructure,
and is thus difficult to enhance with new tests.

So, switch to using the standard CT_DoExecLog infra, and use four tests to
check for the host compiler:
- check we can run it
- check it can build a trivial program
- check it can statically link that program
- check if it statically link with libstdc++

That should cover most of the problems. Hopefully.

(At the same time, fix a typo in a comment)

Signed-off-by: Daniel Price <daniel.price@gmail.com>
[yann.morin.1998@free.fr: split original patch for self-contained changes]
[yann.morin.1998@free.fr: use steps to better see gcc's output]
[yann.morin.1998@free.fr: commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com>
Patchwork-Id: 200536
     1 # Menu for the cross GDB
     2 
     3 config STATIC_TOOLCHAIN
     4     select GDB_CROSS_STATIC if GDB_CROSS
     5 
     6 config GDB_CROSS
     7     bool
     8     prompt "Cross-gdb"
     9     default y
    10     select GDB_GDBSERVER if ! BARE_METAL
    11     help
    12       Build and install a cross-gdb for the target, to run on host.
    13 
    14 if GDB_CROSS
    15 
    16 config GDB_CROSS_STATIC
    17     bool
    18     prompt "Build a static cross gdb"
    19     select WANTS_STATIC_LINK
    20     help
    21       A static cross gdb can be usefull if you debug on a machine that is
    22       not the one that is used to compile the toolchain.
    23       
    24       That way, you can share the cross-gdb without installing a toolchain
    25       on every machine that will be used to debug target programs.
    26 
    27 config GDB_CROSS_SIM
    28     bool
    29     prompt "Enable 'sim'"
    30     depends on EXPERIMENTAL
    31     help
    32       Say 'y' here if you want to build the 'sim' emulator.
    33       You probably don't want it, unless you are building for bare-metal.
    34       The default is 'n'.
    35 
    36 config GDB_CROSS_PYTHON
    37     bool
    38     prompt "Enable python scripting"
    39     depends on ! GDB_CROSS_STATIC
    40     default y
    41     help
    42       Say 'y' if you want to use Python scripting inside gdb.
    43       Say 'n' if you do not want to.
    44       
    45       Beware that enabling Python scripting could render the gdb
    46       executable non-functional if you move it to another machine.
    47       Building a static gdb can help in this regard, although there
    48       have been reports of problems when linking gdb to the static
    49       libpython.a. This should be fixed in gdb >=7.3. YMMV.
    50 
    51 config GDB_CROSS_EXTRA_CONFIG_ARRAY
    52     string
    53     prompt "Cross-gdb extra config"
    54     default ""
    55     help
    56       Extra flags to pass onto ./configure when configuring the gdb cross.
    57 
    58 endif # GDB_CROSS