diff options
author | Enze Li <lienze2010@hotmail.com> | 2021-11-25 18:05:46 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2021-11-25 18:05:46 +0000 |
commit | 9e99facd6cae1a94923166bd02f716d96395c19f (patch) | |
tree | 8f46df6d9dfba36d7eb0bb90effb36b9413b824a | |
parent | 7719facb311657f8927c12481ccfc22fe84d5589 (diff) | |
download | binutils-9e99facd6cae1a94923166bd02f716d96395c19f.zip binutils-9e99facd6cae1a94923166bd02f716d96395c19f.tar.gz binutils-9e99facd6cae1a94923166bd02f716d96395c19f.tar.bz2 |
gdb: ensure extension_language_python is always defined
In this commit:
commit c6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0
Date: Mon Oct 25 17:25:45 2021 +0100
gdb/python: make some global variables static
building without Python was broken. The extension_language_python
global was moved from being always defined, to only being defined when
the HAVE_PYTHON macro was defined. As a consequence, building without
Python support would result in errors like:
/usr/bin/ld: extension.o:(.rodata+0x120): undefined reference to `extension_language_python'
This commit fixes the problem by moving the definition of
extension_language_python outside of the HAVE_PYTHON macro protection.
-rw-r--r-- | gdb/python/python.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index d8a6a59..bfb691f 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -164,6 +164,8 @@ static const struct extension_language_ops python_extension_ops = gdbpy_colorize, }; +#endif /* HAVE_PYTHON */ + /* The main struct describing GDB's interface to the Python extension language. */ const struct extension_language_defn extension_language_python = @@ -186,6 +188,8 @@ const struct extension_language_defn extension_language_python = #endif }; +#ifdef HAVE_PYTHON + /* Architecture and language to be used in callbacks from the Python interpreter. */ struct gdbarch *python_gdbarch; |