* [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker)
@ 2008-12-05 18:42 Joel Brobecker
2008-12-05 19:08 ` Tom Tromey
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Joel Brobecker @ 2008-12-05 18:42 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]
Hello,
We noticed that GDB does not build on x86-macos and x86_64-macos when
configured --without-python (we found this out because one of our
machine no longer has python installed on it). The problem is that
the linker complains that it cannot file values_in_python, referenced
from value.c. This is a bug, since we verified that the symbol was
defined inside python-value.o which was also part of the archive.
We think that this might be related to the fact that the symbol is
defined as "C" (common). We changed the code to add an initial value
of NULL (which in C is strictly equivalent to the current code),
which changed our variable to the Data section and, ta da, allowed
GDB to link.
2008-12-05 Joel Brobecker <brobecker@adacore.com>
* python/python-value.c (values_in_python): Add specific initialization
to NULL to work-around a MacOS linker bug.
Tested on x86-linux, both using --with-python and --without-python.
No regression.
I think this is pretty safe and safe contained, and doesn't reduce
the quality of the code, so I'm planning on committing this on Monday
when back from weekend holiday (I'm in Europe). Any objection? Should
I add a comment?
Thanks,
--
Joel
[-- Attachment #2: python-value.diff --]
[-- Type: text/plain, Size: 429 bytes --]
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
index 8bf4ec8..c17fb3b 100644
--- a/gdb/python/python-value.c
+++ b/gdb/python/python-value.c
@@ -30,7 +30,7 @@
can copy the values' types if needed. This is declared
unconditionally to reduce the number of uses of HAVE_PYTHON in the
generic code. */
-struct value *values_in_python;
+struct value *values_in_python = NULL;
#ifdef HAVE_PYTHON
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker)
2008-12-05 18:42 [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker) Joel Brobecker
@ 2008-12-05 19:08 ` Tom Tromey
2008-12-06 15:31 ` Mark Kettenis
2008-12-08 17:14 ` Joel Brobecker
2 siblings, 0 replies; 5+ messages in thread
From: Tom Tromey @ 2008-12-05 19:08 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I think this is pretty safe and safe contained, and doesn't reduce
Joel> the quality of the code, so I'm planning on committing this on Monday
Joel> when back from weekend holiday (I'm in Europe). Any objection?
Not from me. This is so small that I have trouble picturing anybody
objecting.
Joel> Should I add a comment?
I would appreciate that.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker)
2008-12-05 18:42 [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker) Joel Brobecker
2008-12-05 19:08 ` Tom Tromey
@ 2008-12-06 15:31 ` Mark Kettenis
2008-12-08 15:18 ` Joel Brobecker
2008-12-08 17:14 ` Joel Brobecker
2 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2008-12-06 15:31 UTC (permalink / raw)
To: brobecker; +Cc: gdb-patches
> Date: Fri, 5 Dec 2008 19:41:23 +0100
> From: Joel Brobecker <brobecker@adacore.com>
>
> Hello,
>
> We noticed that GDB does not build on x86-macos and x86_64-macos when
> configured --without-python (we found this out because one of our
> machine no longer has python installed on it). The problem is that
> the linker complains that it cannot file values_in_python, referenced
> from value.c. This is a bug, since we verified that the symbol was
> defined inside python-value.o which was also part of the archive.
> We think that this might be related to the fact that the symbol is
> defined as "C" (common). We changed the code to add an initial value
> of NULL (which in C is strictly equivalent to the current code),
> which changed our variable to the Data section and, ta da, allowed
> GDB to link.
>
> 2008-12-05 Joel Brobecker <brobecker@adacore.com>
>
> * python/python-value.c (values_in_python): Add specific initialization
> to NULL to work-around a MacOS linker bug.
>
> Tested on x86-linux, both using --with-python and --without-python.
> No regression.
>
> I think this is pretty safe and safe contained, and doesn't reduce
> the quality of the code, so I'm planning on committing this on Monday
> when back from weekend holiday (I'm in Europe). Any objection? Should
> I add a comment?
Ugh, Yuck. Any idea if this is fixed in more recent versions of Mac OS X?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker)
2008-12-06 15:31 ` Mark Kettenis
@ 2008-12-08 15:18 ` Joel Brobecker
0 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2008-12-08 15:18 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
> Ugh, Yuck. Any idea if this is fixed in more recent versions of Mac OS X?
According to our sysadmin, we have the latest updates for Leopard,
and the latest stable release of Xcode. There might be a fix in the
latest developer patches released by Apple, but we're not sure.
--
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker)
2008-12-05 18:42 [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker) Joel Brobecker
2008-12-05 19:08 ` Tom Tromey
2008-12-06 15:31 ` Mark Kettenis
@ 2008-12-08 17:14 ` Joel Brobecker
2 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2008-12-08 17:14 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
> 2008-12-05 Joel Brobecker <brobecker@adacore.com>
>
> * python/python-value.c (values_in_python): Add specific initialization
> to NULL to work-around a MacOS linker bug.
Now checked in as attached (added a comment).
--
Joel
[-- Attachment #2: python-value.diff --]
[-- Type: text/plain, Size: 692 bytes --]
Index: python/python-value.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python-value.c,v
retrieving revision 1.5
diff -u -p -r1.5 python-value.c
--- python/python-value.c 28 Oct 2008 17:19:57 -0000 1.5
+++ python/python-value.c 8 Dec 2008 17:12:08 -0000
@@ -30,7 +30,9 @@
can copy the values' types if needed. This is declared
unconditionally to reduce the number of uses of HAVE_PYTHON in the
generic code. */
-struct value *values_in_python;
+/* This variable is unnecessarily initialized to NULL in order to
+ work around a linker bug on MacOS. */
+struct value *values_in_python = NULL;
#ifdef HAVE_PYTHON
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-12-08 17:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-05 18:42 [RFA/commit] pre-initialize python-value.c:values_in_python (bug in MacOS linker) Joel Brobecker
2008-12-05 19:08 ` Tom Tromey
2008-12-06 15:31 ` Mark Kettenis
2008-12-08 15:18 ` Joel Brobecker
2008-12-08 17:14 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox