From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16074 invoked by alias); 10 May 2011 15:03:19 -0000 Received: (qmail 16006 invoked by uid 22791); 10 May 2011 15:03:17 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 May 2011 15:03:01 +0000 Received: by qwa26 with SMTP id 26so5073696qwa.0 for ; Tue, 10 May 2011 08:03:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.193.198 with SMTP id dv6mr7045758qab.156.1305039780802; Tue, 10 May 2011 08:03:00 -0700 (PDT) Received: by 10.229.250.66 with HTTP; Tue, 10 May 2011 08:03:00 -0700 (PDT) Reply-To: vanboxem.ruben@gmail.com In-Reply-To: References: Date: Tue, 10 May 2011 15:03:00 -0000 Message-ID: Subject: Re: [PATCH] 64-bit python support From: Ruben Van Boxem To: Tom Tromey Cc: gdb-patches@sourceware.org, mingw64 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00247.txt.bz2 2011/5/10 Tom Tromey : >>>>>> "Ruben" =3D=3D Ruben Van Boxem writes: > > Ruben> Ah, I didn't know this, that's indeed very handy, but the two > Ruben> occurrences in my patch are actually still a call to Py_InitModule > Ruben> without the "4". Then that probably needs to be patched instead? > > No, there's a later define for that in modsupport.h: > > #define Py_InitModule(name, methods) \ > =C2=A0 =C2=A0 =C2=A0 =C2=A0Py_InitModule4(name, methods, (char *)NULL, (P= yObject *)NULL, \ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 PYTHON_API_VERSION) > > I think the thing to do is track down why the Python headers are picking > the wrong function name for you. > > Tom > OK, found the problem. Apparantly the pyconfig.h header only defined MS_WIN* when _MSC_VER is defined, which is obviously not the case for mingw-w64. I guess people attempted fixing it here (http://bugs.python.org/issue4709), but the patch never landed. Sorry for the noise here. I'll just add "-DMS_WIN64" to the CFLAGS for GDB. Pretty lame of Python devs though, with all the work put into the tiny and overly correct patch. I'll ping them there and work around this locally. Thanks for the quick response here! Ruben