From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25379 invoked by alias); 18 Jul 2008 19:32:51 -0000 Received: (qmail 25368 invoked by uid 22791); 18 Jul 2008 19:32:50 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 18 Jul 2008 19:32:23 +0000 Received: (qmail 26920 invoked from network); 18 Jul 2008 19:32:20 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Jul 2008 19:32:20 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [gdbserver] compiling latest server.c (rev. 1.76) with MinGW for running on win32 Date: Fri, 18 Jul 2008 19:32:00 -0000 User-Agent: KMail/1.9.9 Cc: "Dr. Rolf Jansen" References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200807182032.31901.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2008-07/txt/msg00366.txt.bz2 Hi Rolf, On Friday 18 July 2008 18:32:32, Dr. Rolf Jansen wrote: > The latest server.c rev 1.76 does produce warnings when compiled with =C2= =A0 > the MinGW tools: > > server.c: In function 'start_inferior': > server.c:107: warning: implicit declaration of function 'alloca' > server.c:107: warning: incompatible implicit declaration of built-in =C2= =A0 > function 'alloca' > server.c: In function 'handle_search_memory_1': > server.c:356: warning: implicit declaration of function 'memmem' > server.c:356: warning: assignment makes pointer from integer without a = =C2=A0 > cast > MinGW defines alloca() in and memmem() is not built-in. I =C2= =A0 > think this should eventually be addressed in the configure script, =C2=A0 > however, as a quick fix, I added at the top of server.c: > #if USE_WIN32API > #include This bit be done with... #if HAVE_MALLOC_H #include #endif ... instead. We're already doing that in utils.c. > void *memmem (const void *haystack_start, size_t haystack_len, const =C2= =A0 > void *needle_start, size_t needle_len); > #endif Hmmm, shouldn't we be picking up memmem's definition from gnulib's string.h, since we're using memmem from gnulib? > In addition, linking of gdbserver.exe fails because of undefined=20=20 > references: > > remote-utils.o:remote-utils.c:(.text+0x1057): undefined reference to=20=20 > `_disable_packet_Tthread' > In order to resolve the linking errors, the definition of the =C2=A0 > respective variables must be moved out of the conditional block =C2=A0 > (#ifdef SIGTTOU ... #endif), because they are used also within non- > conditional code in remote-utils.c and in server.c. > Ooops. Yes, it should move out of the #if block. It was just an oversight. No need to add the SIGTTOU checks around the --disable-packet handling. --=20 Pedro Alves