diff options
author | Alexey Neyman <stilor@att.net> | 2019-03-11 00:33:22 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2019-03-11 00:33:22 -0700 |
commit | de36f78f898940e7611b177e9ccd97516f131caf (patch) | |
tree | 468264dc671077e05270674518d3cbcea083dc58 /scripts/build/debug | |
parent | 5332f480e44d2eed46faf3290b385d141ccc2df8 (diff) | |
download | crosstool-ng-de36f78f898940e7611b177e9ccd97516f131caf.tar.gz crosstool-ng-de36f78f898940e7611b177e9ccd97516f131caf.tar.bz2 crosstool-ng-de36f78f898940e7611b177e9ccd97516f131caf.zip |
Allow older GDB to build against newer glibc
Also, fix the subdir used when only gdbserver is built (without native
GDB).
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/debug')
-rw-r--r-- | scripts/build/debug/300-gdb.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh index 14389126..e62e5dff 100644 --- a/scripts/build/debug/300-gdb.sh +++ b/scripts/build/debug/300-gdb.sh @@ -122,7 +122,7 @@ do_debug_gdb_build() gdbserver_extra_config+=("--disable-inprocess-agent") fi if [ "${CT_GDB_NATIVE}" != "y" ]; then - subdir=gdbserver/ + subdir=gdb/gdbserver/ fi fi @@ -175,6 +175,22 @@ do_gdb_backend() esac done + # Starting with glibc 2.25, it now provides a <proc_service.h> header. The + # problem is that GDB releases prior to 7.12 used to implement one of the + # interfaces, ps_get_thread_are with a const qualifier on one of the arguments. + # Therefore, such older versions cannot be compiled against a newer glibc. + # If we detect such a combination, mitigate by creating a local proc_service.h + # with a prototype adjusted for GDB requirements. + if [ -r "${CT_HEADERS_DIR}/proc_service.h" -a "${CT_GDB_CONST_GET_THREAD_AREA}" = "y" ]; then + CT_DoLog DEBUG "Fixing up the prototype in <proc_service.h>" + CT_DoExecLog ALL mkdir -p gdb/gdbserver + CT_DoExecLog ALL cp "${CT_HEADERS_DIR}/proc_service.h" gdb/proc_service.h + CT_DoExecLog ALL sed -i \ + "s/\(ps_get_thread_area *(\).*\(struct ps_prochandle\)/\1const \2/" \ + gdb/proc_service.h + CT_DoExecLog ALL cp gdb/proc_service.h gdb/gdbserver/proc_service.h + fi + if [ "${CT_GDB_HAS_PKGVERSION_BUGURL}" = "y" ]; then [ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}") [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") |