From d34a6bd8a0222fadfc86795f65ca9a7df232324d Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 13 Jan 2017 19:54:08 -0800 Subject: GDB 7.12 needs c++. Also, minor fixes in 300-gdb.sh Signed-off-by: Alexey Neyman diff --git a/config/debug/gdb.in b/config/debug/gdb.in index dd8239f..a835b28 100644 --- a/config/debug/gdb.in +++ b/config/debug/gdb.in @@ -6,15 +6,13 @@ source "config/debug/gdb.in.cross" source "config/debug/gdb.in.native" source "config/debug/gdb.in.gdbserver" -if GDB_CROSS || GDB_NATIVE || GDB_GDBSERVER - comment "gdb version" config GDB_CUSTOM bool prompt "Custom gdb" depends on EXPERIMENTAL - select GDB_7_2_or_later + select GDB_7_12_or_later help The choosen gdb version shall be not downloaded. Instead use a custom location to get the source. @@ -71,7 +69,7 @@ choice config GDB_V_7_12 bool prompt "7.12" - select GDB_7_2_or_later + select GDB_7_12_or_later config GDB_V_7_11 bool @@ -224,6 +222,10 @@ endchoice endif # ! GDB_CUSTOM +config GDB_7_12_or_later + bool + select GDB_7_2_or_later + config GDB_7_2_or_later bool select GDB_7_0_or_later @@ -280,6 +282,3 @@ config GDB_VERSION default "6.8a" if GDB_V_6_8a endif # ! GDB_CUSTOM - -endif # GDB_CROSS || GDB_NATIVE || GDB_GDBSERVER - diff --git a/config/debug/gdb.in.native b/config/debug/gdb.in.native index 915debd..634b13b 100644 --- a/config/debug/gdb.in.native +++ b/config/debug/gdb.in.native @@ -5,6 +5,7 @@ config GDB_NATIVE prompt "Native gdb" depends on ! BARE_METAL depends on ! BACKEND + depends on CC_LANG_CXX || !GDB_7_12_or_later select EXPAT_TARGET select NCURSES_TARGET help diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index dabd81a..fe7787b 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -90,16 +90,20 @@ do_debug_gdb_build() { cross_extra_config+=("--disable-nls") fi + CPP_for_gdb="${CT_HOST}-cpp ${CT_CFLAGS_FOR_HOST}" CC_for_gdb="${CT_HOST}-gcc ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST}" + CXX_for_gdb="${CT_HOST}-g++ ${CT_CFLAGS_FOR_HOST} ${CT_LDFLAGS_FOR_HOST}" LD_for_gdb="${CT_HOST}-ld ${CT_LDFLAGS_FOR_HOST}" if [ "${CT_GDB_CROSS_STATIC}" = "y" ]; then CC_for_gdb+=" -static" + CXX_for_gdb+=" -static" LD_for_gdb+=" -static" fi case "${CT_HOST}" in *darwin*) # FIXME: Really, we should be testing for host compiler being clang. CC_for_gdb+=" -Qunused-arguments" + CXX_for_gdb+=" -Qunused-arguments" ;; esac @@ -107,7 +111,9 @@ do_debug_gdb_build() { # are multiple consecutive spaces: sub-configure scripts replace them with a # single space and then complain that $CC value changed from that in # the master directory. + CPP_for_gdb=`echo $CPP_for_gdb` CC_for_gdb=`echo $CC_for_gdb` + CXX_for_gdb=`echo $CXX_for_gdb` LD_for_gdb=`echo $LD_for_gdb` # Disable binutils options when building from the binutils-gdb repo. @@ -118,7 +124,9 @@ do_debug_gdb_build() { CT_DoLog DEBUG "Extra config passed: '${cross_extra_config[*]}'" CT_DoExecLog CFG \ + CPP="${CPP_for_gdb}" \ CC="${CC_for_gdb}" \ + CXX="${CXX_for_gdb}" \ LD="${LD_for_gdb}" \ "${gdb_src_dir}/configure" \ --build=${CT_BUILD} \ @@ -165,7 +173,6 @@ do_debug_gdb_build() { if [ "${CT_GDB_NATIVE}" = "y" ]; then local -a native_extra_config - local -a gdb_native_CFLAGS CT_DoStep INFO "Installing native gdb" @@ -208,12 +215,14 @@ do_debug_gdb_build() { [ "${CT_TOOLCHAIN_ENABLE_NLS}" != "y" ] && \ native_extra_config+=("--disable-nls") + CPP_for_gdb="${CT_TARGET}-cpp" + CC_for_gdb="${CT_TARGET}-${CT_CC}" + CXX_for_gdb="${CT_TARGET}-g++" + LD_for_gdb="${CT_TARGET}-ld" if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then - CC_for_gdb="${CT_TARGET}-gcc -static" - LD_for_gdb="${CT_TARGET}-ld -static" - else - CC_for_gdb="${CT_TARGET}-gcc" - LD_for_gdb="${CT_TARGET}-ld" + CC_for_gdb+=" -static" + CXX_for_gdb+=" -static" + LD_for_gdb+=" -static" fi export ac_cv_func_strncmp_works=yes @@ -226,9 +235,10 @@ do_debug_gdb_build() { CT_DoLog DEBUG "Extra config passed: '${native_extra_config[*]}'" CT_DoExecLog CFG \ + CPP="${CPP_for_gdb}" \ CC="${CC_for_gdb}" \ + CXX="${CXX_for_gdb}" \ LD="${LD_for_gdb}" \ - CFLAGS="${gdb_native_CFLAGS[*]}" \ "${gdb_src_dir}/configure" \ --build=${CT_BUILD} \ --host=${CT_TARGET} \ @@ -246,7 +256,7 @@ do_debug_gdb_build() { "${native_extra_config[@]}" CT_DoLog EXTRA "Building native gdb" - CT_DoExecLog ALL make ${JOBSFLAGS} CC=${CT_TARGET}-${CT_CC} + CT_DoExecLog ALL make ${JOBSFLAGS} CT_DoLog EXTRA "Installing native gdb" CT_DoExecLog ALL make DESTDIR="${CT_DEBUGROOT_DIR}" install @@ -261,6 +271,7 @@ do_debug_gdb_build() { if [ "${CT_GDB_GDBSERVER}" = "y" ]; then local -a gdbserver_extra_config + local gdbserver_LDFLAGS CT_DoStep INFO "Installing gdbserver" CT_DoLog EXTRA "Configuring gdbserver" @@ -294,7 +305,7 @@ do_debug_gdb_build() { gdbserver_extra_config+=("--disable-gas") CT_DoExecLog CFG \ - CC="${CT_TARGET}-gcc" \ + CC="${CT_TARGET}-${CT_CC}" \ CPP="${CT_TARGET}-cpp" \ LD="${CT_TARGET}-ld" \ LDFLAGS="${gdbserver_LDFLAGS}" \ -- cgit v0.10.2-6-g49f6