delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/15/15:12:10

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sat, 15 Feb 2003 12:35:56 -0700 (MST)
From: Roger Sayle <roger AT www DOT eyesopen DOT com>
To: cygwin AT cygwin DOT com
Subject: [Problem] mempcpy is missing?
Message-ID: <Pine.LNX.4.44.0302151214040.9768-100000@www.eyesopen.com>
MIME-Version: 1.0

I apologise if this is the wrong list to report bugs.  I have searched
the archive and haven't been able to find a reference to mempcpy.

To summarise, /usr/lib/libc.a doesn't currently define the function
mempcpy even though its prototyped in /usr/include/string.h, and its
described in cygwin's (newlib's) man pages.  I've tested this on
1.3.17, 1.3.18 and 1.3.20 (as downloaded this morning).


Now that GCC's PR bootstrap/9560 is resolved, I've been able to
bootstrap mainline GCC on cygwin.  I then decided to repeat the
bootstrap on a second cygwin machine, but this time the bootstrap
failed with a mempcpy redeclared static error message in GCC's
gcc/intl/dcigettext.c.

The difference is because on my second cygwin box I hadn't installed
cygwin's libintl, hence GCC decided to use its local copy exposing
the failure.  The problem is that with _mempcpy missing from libc.a,
configure correctly detects that this function is missing, and undefs
HAVE_MEMPCPY.  gcc/intl/dcigettext.c then defines a "static" copy of
mempcy #ifndef HAVE_MEMPCPY.  This then conflicts with cygwin's
/usr/include/string.h that prototypes mempcpy as non-static even
though it doesn't provide a working implementation.

The short-term work-around is to configure GCC --disable-nls or install
the libintl package.

The correct fix is for cygwin to either provide an implementation of
mempcpy (as it appears to have done at some point in the past) or
remove the function prototype from string.h.

An intermediate solution might be for libiberty to export a mempcpy
that may be used by gcc/intl, without clashing with cygwin's headers.


I hope this helps.  To repeat the problem attempt to compile the
following program:

int main() { return mempcpy(0,0,0); }

Many thanks in advance,

Roger
--
Roger Sayle,                         E-mail: roger AT eyesopen DOT com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019