This is the mail archive of the mailing list for the Cygwin 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]

[Problem] mempcpy is missing?

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

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 Sayle,                         E-mail:
OpenEye Scientific Software,         WWW:
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833

Unsubscribe info:
Bug reporting:

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