This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: py-breakpoint.c fails to compile with MinGW GCC


2011/7/28 Tom Tromey <tromey@redhat.com>:
> Joel> It does compile for me too. Could be a compiler age issue?
>
> I asked Kai and that is what he thinks.
>
> The Python docs don't say much:
>
> ? ?We’d like to just assign this to the tp_new slot, but we can’t, for
> ? ?portability sake, On some platforms or compilers, we can’t statically
> ? ?initialize a structure member with a function defined in another C
> ? ?module, so, instead, we’ll assign the tp_new slot in the module
> ? ?initialization function just before calling PyType_Ready():
>
> See http://docs.python.org/extending/newtypes.html
>
> Joel> Just wondering out loud - if we were to use a C++ compiler, would
> Joel> it allow us to use non-static initializers like in this case?
> Joel> I'm under the impression that C++ provides elaboration, so
> Joel> non-static initialization should be do-able...
>
> That would work; and while I want to do this, I think it is simpler to
> just fix the initializations. ?Or, just require people to use a newer
> GCC; 3.4 is 5 years old at this point.
>
> Tom

I looked a bit more in detail on this issue and indeed it is a
compiler age issue.  Newer compilers with pseudo-relocation support
are able to handle DLL-imported symbols in assignments for
global/static variables.
This is for older gcc versions (and indeed 3.4 is pretty old one) not possible.

Regards,
Kai


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]