summaryrefslogtreecommitdiff
path: root/scripts/build/debug/300-gdb.sh
AgeCommit message (Collapse)AuthorFilesLines
2021-09-21gdb: Remove old milestonesChris Packham1-21/+17
Now that the oldest supported version of gdb is 7.11.1 we can make some parts of the build unconditional and remove the associated config vars. Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-19Merge branch 'gdb-enable-tui' of ↵Chris Packham1-4/+2
https://github.com/foss-for-synopsys-dwc-arc-processors/crosstool-ng Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-09-19gdb: Realy decouple building of native/target GDB & gdbserverAlexey Brodkin1-0/+8
Back in the day gdbserver was treated as a subproject of GDB and even was located in "gdb/gdbserver" and so to build gdbserver we had to go into "gdb/gdbserver" and there run configure. That way full GDB was out of the picture. Now starting from GDB 10.1 where gdbserver was promoted to the top-level we're supposed to run top-level's configure script for all the tools provided by the unified binutils-gdb tree. That said if we only want to build gdbserver (and that's what we want since we build one tool at a build step) we have to be explicit: ----------------->8---------------- --enable-gdbserver --disable--gdb ----------------->8---------------- Ah, and so far we used to build full native GDB when only wanted gdbserver if it was GDB v10.x ;) Ironically full native/target GDB also enabled gdbserver by default so we need to also disable it explicitly with "--disable-gdbserver". Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-09-16gdb: Enable TUI for full target/native GDBAlexey Brodkin1-4/+2
Since we have curses built for target anyway now, why don't allow users to use very convenient pseudo-GUI operating mode? And while at it, there's no use of TUI in naturally headless gdbserver. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-08-24gdb: Add gdb-10.2Alexey Brodkin1-30/+91
In GDB 10.x gdbserver was promoted to the top-level folder, see https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=919adfe8409211c726c1d05b47ca59890ee648f1 Which means it is no longer a subfolder in "gdb" and so we have to build gdbserver now exactly in the same way as normal native GDB. One interesting detail is gdbserver doesn't need to deal with target description in .xml so it doesn't depend on libexpat on target, thus we need to move libexpat explicit selection from do_gdb_backend() to its callers when building native [full] gdb as well as cross-gdb for the host. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> [cp: support old/new layout, regenerate patches] Signed-off-by: Chris Packham <judge.packham@gmail.com>
2021-07-18Disable source-highlighting for static buildQBos071-0/+6
Fixes #1487
2021-04-15gdb: Don't mess with gdbserver config permissionsAlexey Brodkin1-5/+0
Some really old GDB releases did have gdbserver's configure script w/o execution permissions, so there was a need in the fix. As per Yann most likely it could have been true for GDB versions in between v5.3 & 6.6. Moreover it could have been fixed on re-release of GDB tarballs done in 2011, see [1]. And given we no longer support such old GDB versions in CT-NG (as of today we have 6.8 - 9.2, moreover it's not clear which of 6.8-7.x versions are still being actively used) we'll revert that old hack for now in a hope that it won't hurt anybody. Though if somebody sees that problem again we'll be able to revert this again ;) [1] https://sourceware.org/legacy-ml/gdb/2011-09/msg00002.html Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2020-05-26Enable static libgcc when CT_GDB_NATIVE_STATIC_LIBSTDCXX is setStephanos Ioannidis1-0/+1
This commit updates the GDB build script to specify `-static-libgcc` when `CT_GDB_NATIVE_STATIC_LIBSTDCXX` is enabled. Both libgcc and libstdc++ are considered to be part of the "standard libraries," and should be specified by the same flag (the configuration symbol could potentially use a better name and/or further indirection). This also semantically aligns the `CT_GDB_NATIVE_STATIC_LIBSTDCXX` with the equivalent GCC configuration `CT_CC_GCC_STATIC_LIBSTDCXX`, which also enables static linking of both libgcc and libstdc++. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-26Fix CT_GDB_NATIVE_STATIC_LIBSTDCXX referenceStephanos Ioannidis1-2/+2
This commit fixes an incorrect reference to the configuration `CT_GDB_NATIVE_STATIC_LIBSTDCXX` in the GDB build script. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-04-05Rename JOBSFLAGS -> CT_JOBSFLAGSAlexey Neyman1-2/+2
... so that it is saved/restored when restarting the build. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-04-05An artifact of merging native/gdbserver backendsAlexey Neyman1-5/+5
... resulted in an attempt to build libinproctrace.so whenever any of the {gdbserver, native gdb} was enabled. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-03-13Make the proc_service.h workaround apply to gdbserverAlexey Neyman1-6/+15
... when it is compiled without the native GDB. Also, fix the gdbserver to be installed without a program prefix in this case, as it was before the unification of the GDB backend. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-03-11Allow older GDB to build against newer glibcAlexey Neyman1-1/+17
Also, fix the subdir used when only gdbserver is built (without native GDB). Signed-off-by: Alexey Neyman <stilor@att.net>
2019-03-10Move GDB build into a common backend functionAlexey Neyman1-267/+155
... needed to create a common runtime test for an incompatible change in glibc API. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-03-02Fix build of glibc 2.29 on systems with obsolete host programsAlexey Neyman1-9/+6
- Force building make as a companion tool if host make is older than 4.0 (CentOS 7 currently has 3.82) - Disable 2.29 as a choice if host python is older than 3.4 (CentOS 7 has 2.6 unless python from EPEL is installed) - Python2 emits its version information to STDERR. Ugh. While there, also use the detected host Python for GDB configuration. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-02-13Use CFLAGS for both CFLAGS/CXXFLAGS in GDBAlexey Neyman1-22/+6
These config variables are documented as such anyway. Signed-off-by: Alexey Neyman <stilor@att.net>
2019-02-13decouple darwin/clang here as per #712Roy Storey1-12/+11
https://github.com/crosstool-ng/crosstool-ng/issues/712#issuecomment-300891861
2018-09-27Use 'chmod a-x' instead of 'chmod -x'Alexey Neyman1-1/+1
There is a subtle difference when executable bit is a part of the umask. And at least some versions (Debian/stretch) fail if the resulting mode would've been different if not for the umask setting. Fixes #998. Although, with such chmods/umasks it is likely that some package installation will break anyway. But I'll leave it until somebody complains. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-06-05Avoid adding arch/cpu/tune flags for target to GCC buildAlexey Neyman1-19/+10
... as it may need to override them for building runtime-selectable code. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-05-06Restore a missing GDB optionAlexey Neyman1-2/+6
(whether GDB has --disable-build-with-cxx) and use it. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-12-17Fix gdb build flags formingSergey Korolev1-10/+12
Build flags are scalar variables. Signed-off-by: Sergey Korolev <s.korolev@ndmsystems.com>
2017-12-17Merge pull request #882 from ksergeyv/gdb-linkAlexey Neyman1-80/+106
Fix variables passing to gdb configure scripts
2017-12-14Fix variables passing to gdb configure scriptsSergey Korolev1-80/+106
These changes mainly fix static linking errors when building static native gdb and gdbserver (tested with gcc 7.2.0 + uClibc-ng 1.0.27 + binutils 2.29.1 for MIPS): [ALL ] .../lib/libstdc++.a(eh_throw.o): In function `__cxa_throw': [ALL ] (.text.__cxa_throw+0x64): undefined reference to `_Unwind_RaiseException' [ALL ] (.text.__cxa_throw+0x6c): undefined reference to `_Unwind_RaiseException' [ALL ] .../lib/libstdc++.a(eh_throw.o): In function `__cxa_rethrow': [ALL ] (.text.__cxa_rethrow+0x78): undefined reference to `_Unwind_Resume_or_Rethrow' [ALL ] (.text.__cxa_rethrow+0x80): undefined reference to `_Unwind_Resume_or_Rethrow' ... The problem is in mixing of CPP, CC, CXX, and LD with CPPFLAGS, CFLAGS, CXXFLAGS, and LDFLAGS before passing to configure scripts. gcc is sensitive to argument order and the scripts are normally responsible to combine the variables in a proper way. Signed-off-by: Sergey Korolev <s.korolev@ndmsystems.com>
2017-12-13Do not build a native gdbserver automaticallySergey Korolev1-0/+4
Signed-off-by: Sergey Korolev <s.korolev@ndmsystems.com>
2017-10-01Add -D__GLIBC__ to target CFLAGSAlexey Neyman1-12/+21
... when using musl to compile strace. Also, honor CT_TARGET_CFLAGS in scripts compiling target libs/binaries. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-09-01config: Add package versioning flexibilityNathan Chancellor1-1/+1
Some users (like myself) may want to omit the crosstool-NG version from the binaries' versioning output, as it can be incredibly long and not too helpful. Add a config option to disable it. The possible combinations are as follows: - crosstool-NG version (default) - crosstool-NG version - custom toolchain ID - Custom toolchain ID - No crosstool-NG version OR custom toolchain ID Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-07-08Separate the notions of package name/labelAlexey Neyman1-1/+0
Also, remove resolved TBDs. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-07-08Fix the references to old config variablesAlexey Neyman1-29/+8
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-06-17Add option to build gdbserver for target that does not require libstdc++.soNye Liu1-0/+4
2017-06-16Honor CFLAGS_FOR_BUILDAlexey Neyman1-3/+6
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-06-05Add GDB 8.0 ...Alexey Neyman1-2/+7
... which now requires C++. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-04-02CC_FOR_BUILD in gdb.shAlexey Neyman1-0/+6
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-04-02Handle Python with non-default namesAlexey Neyman1-2/+15
Check for python2/python3 and if found, pass them to --with-python. Allow user to override the choice via a new config option. This fixes systems where there is no "python", only "python2" or "python3". Signed-off-by: Alexey Neyman <stilor@att.net>
2017-03-07Disable format warnings for clangAlexey Neyman1-0/+5
It picks up gettext string and results in [ERROR] messages from ct-ng when gettext strings happen inside an error() call. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-27Revert "Determine whether -E/-r option selects extended regexp"Alexey Neyman1-2/+2
This reverts commit 7bcf18bfab84374d3305c7a088f95ac1219ddf93.
2017-02-14Determine whether -E/-r option selects extended regexpAlexey Neyman1-2/+2
... and then use the right option. See the note in scripts/functions on where we should use ${foo} and where just 'foo'; this boils down to whether we can expect the build tools override to be in effect (e.g. in the actual build scripts) or not (i.e. outside of scripts/build). While running in scripts/functions, or in scripts/crosstool-NG.sh the build tools override directory (.build/tools/bin) may have not been set up (yet, or at all). Also, modify the installed scripts (populate, xldd) accordingly. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-11Merge pull request #584 from stilor/disallow-gold-for-elf2fltAlexey Neyman1-4/+0
Require BFD linker if building for flat format
2017-02-10Supply --disable-build-with-cxx instead of requiring C++Alexey Neyman1-0/+6
... when building native GDB/gdbserver. Suggested by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2017-02-10Remove wrapping if in 300-gdb.shAlexey Neyman1-4/+0
If GDB is turned off, the script will not be even sourced. Otherwise, if GDB checkbox is set but none of the cross/native/gdbserver are selected, debug.sh gives a bogus error message. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-25Run all configure scripts using ${CONFIG_SHELL}Alexey Neyman1-0/+3
... as its help message says in menuconfig. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-14GDB 7.12 needs c++.Alexey Neyman1-9/+20
Also, minor fixes in 300-gdb.sh Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-13Unify fetching Linaro components.Alexey Neyman1-20/+11
Add CT_GetLinaro, use it from gcc/binutils/gdb/glibc/newlib. Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-10Shut clang's warning that confuses configure.Alexey Neyman1-0/+6
Warning causes gdb's configure to not detect <limit.h> declarations of LONG_MIN/MAX. Found-by: Kirill Smirnov <kirill.k.smirnov@gmail.com> Signed-off-by: Alexey Neyman <stilor@att.net>
2016-12-06Merge pull request #443 from KirillSmirnov/gdb-nativeAlexey Neyman1-2/+21
debug/gdb: properly link with expat
2016-12-05debug/gdb: restore commentsKirill K. Smirnov1-0/+12
There are two separate issues with gdb configure usage: 1) inspecting build system libraries while cross-compiling; 2) preferring a shared library over static one. The first usage issue is described and fixed now. The second issue was described but the notes were removed for some reason. This patch restores those notes. Suggested-by: Alexey Neyman <stilor@att.net> Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-11-21Partially revert 6f8e89cb5ca061e899bf3feaaf3fecf30d366c3e.Alexey Neyman1-13/+13
The referenced commit replaced 'make' with '${make}' everywhere. This is wrong for at least the utilities that we may build as companion tools (make, libtool): this will always invoke the version detected by configure by supplying the absolute path. In other words, the wrappers in .build/tools/bin are not fallbacks - they are either temporary (in case a respective companion tool is built) or permanent redirectors. This is the reason why the PATH= has .build/*/buildtools/bin at higher precedence than .build/tools/bin; the latter has the versions detected by configure and the former has the versions built as companion tools. Revert the rest of the gang (grep/sed/...) for consistency. After all, we may decide to supply some of them as well (awk, for instance). Signed-off-by: Alexey Neyman <stilor@att.net>
2016-09-11debug/gdb: Add comments for untrivial flags.Kirill K. Smirnov1-0/+14
The necessity of --without-libexpat-prefix is not obvious and needs comments. Signed-off-by: Kirill K. Smirnov <kirill.k.smirnov@gmail.com>
2016-09-09debug/gdb: properly link with expatKirill Smirnov1-10/+3
This patch fixes libexpat detection for gdb-native and gdb-cross static builds. For gdb-native build configure should not touch system /usr/{lib,include} directories while looking for libexpat. To fix this we pass --without-libexpat-prefix flag to configure script. For gdb-cross build configure is allowed to investigate system /usr/{lib,include} directories, but it does not hurt to disable this behavior. In this case configure falls back to -lexpat, which works as expected. For more info: http://marc.info/?l=gnulib-bug&m=129660262901148&w=2 Signed-off-by: Kirill Smirnov <kirill.k.smirnov@gmail.com>
2016-04-02Work-around another quirk in GDB configure.Alexey Neyman1-4/+11
Previous fix for cross-gdb broke powerpc-unknown_nofpu-linux-gnu which uses an old GDB (6.8a). That GDB's configure chokes on $CC values with multiple consecutive spaces; see the comment in 300-gdb.sh. Signed-off-by: Alexey Neyman <stilor@att.net>
2016-04-02Unbreak static cross-gdb.Alexey Neyman1-5/+14
GDB's configure mishandles the libexpat.{so,a} libraries when it is given -static in CFLAGS AND --with-libexpat-prefix in configure's args: it checks for <prefix>/lib/libexpat.so and finding that, attempts to link it as `gcc -static .. conftest.c <prefix>/lib/libexpat.so`; this obviously fails (.so cannot be statically linked), so configure assumes libexpat is unusable. Thus, --with-libexpat-prefix is dangerous and should be avoided; instead, configure should find the libraries via the supplied CC/LD definitions.