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>
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>
Similar to commit ca45a8f9 ("Add -D__GLIBC__ to target CFLAGS") newer
versions of strace bundle the kernel headers which cause build errors
such as:
[ALL ] In file included from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/in6.h:26,
[ALL ] from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/if_bridge.h:19,
[ALL ] from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:16:
[ERROR] /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/bundled/linux/include/uapi/linux/libc-compat.h:109: error: "__UAPI_DEF_IN6_ADDR_ALT" redefined [-Werror]
[ALL ] 109 | #define __UAPI_DEF_IN6_ADDR_ALT 1
[ALL ] |
[ALL ] In file included from /home/x-tool/.build/arm-unknown-linux-musleabi/src/strace/src/rtnl_mdb.c:15:
[ALL ] /home/x-tool/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr/include/netinet/in.h:401: note: this is the location of the previous definition
[ALL ] 401 | #define __UAPI_DEF_IN6_ADDR_ALT 0
[ALL ] |
[ALL ] cc1: all warnings being treated as errors
By defining __USE_MISC we get __UAPI_DEF_IN6_ADDR_ALT defined in a
compatible manner.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
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>
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>
... 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>
... 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>
- 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>
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>
... which now defaults to --enable-mpers=yes, which attempts to
invoke aarch64-*-gcc with -m32 and fails.
Signed-off-by: Alexey Neyman <stilor@att.net>
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>
... 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>
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>
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>
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>
... 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>
... when building native GDB/gdbserver.
Suggested by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Alexey Neyman <stilor@att.net>
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>
This serves two purposes:
- installs its manpage
- installs headers, without them it does not make sense to install a
static library
Unfortunately, there's no way to select shared-only build of DUMA.
Hence, disable selection for static library.
Also, allow user to select whether to use stock or ct-ng's wrapper.
Signed-off-by: Alexey Neyman <stilor@att.net>
The correct solution was checked in to strace GIT; will be part of the
next release. Backport patch to 4.10..4.15, and remove the workaround
from 500-strace.sh. Versions 4.9 and older should build fine even
without the workaround (they would be picking up wrong definitions,
but they need different patch and I don't feel like spending any time
on these versions).
Signed-off-by: Alexey Neyman <stilor@att.net>
- No new releases in almost 10 year.
- No public bug tracker or VCS.
- No responses from maintainer over sent patches.
RIP, dmalloc.
Signed-off-by: Alexey Neyman <stilor@att.net>