Skip to content
Permalink
Browse files

cmake: gdb: use gdb-multiarch if ${CROSS_COMPILE}gdb is not availiable

Modern versions of GDB support multiple architectures
with the same binary.
In fact, Ubuntu stopped shipping a gdb-arm-none-eabi
package, gdb-multiarch should be used instead.

This fixes a failure on those systems where otherwise CMAKE_GDB will be
assigned to CMAKE_GDB-NOTFOUND.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
  • Loading branch information...
benpicco authored and nashif committed Apr 29, 2019
1 parent 3ac8fa5 commit c2419fc006d8c246707d1ae3e196359cce06d3b0
Showing with 2 additions and 0 deletions.
  1. +1 −0 cmake/compiler/gcc/target.cmake
  2. +1 −0 cmake/compiler/xcc/target.cmake
@@ -13,6 +13,7 @@ find_program(CMAKE_AR ${CROSS_COMPILE}ar PATH ${TOOLCHAIN_HOME} NO_
find_program(CMAKE_RANLIB ${CROSS_COMPILE}ranlib PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
find_program(CMAKE_READELF ${CROSS_COMPILE}readelf PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
find_program(CMAKE_GDB ${CROSS_COMPILE}gdb PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
find_program(CMAKE_GDB gdb-multiarch PATH ${TOOLCHAIN_HOME} )
find_program(CMAKE_NM ${CROSS_COMPILE}nm PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)

if(CONFIG_CPLUSPLUS)
@@ -14,6 +14,7 @@ find_program(CMAKE_AR ${CROSS_COMPILE}ar PATH ${TOOLCHAIN_HOME} NO_
find_program(CMAKE_RANLIB ${CROSS_COMPILE}ranlib PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
find_program(CMAKE_READELF ${CROSS_COMPILE}readelf PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
find_program(CMAKE_GDB ${CROSS_COMPILE}gdb PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
find_program(CMAKE_GDB gdb-multiarch PATH ${TOOLCHAIN_HOME} )
find_program(CMAKE_NM ${CROSS_COMPILE}nm PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)

if(CONFIG_CPLUSPLUS)

0 comments on commit c2419fc

Please sign in to comment.
You can’t perform that action at this time.