Port newlib to x86_64-pc-cygwin.

* libc/include/sys/features.h: Redefine compilation environment
	definitions for Cygwin to cover 64 bit Cygwin.
	* libc/ctype/ctype_.c (_ctype_): Fix definition for 64 bit Cygwin.
	* libc/include/machine/setjmp.h: Change definition of _JBLEN to allow
	different values for 32 bit and 64 bit Cygwin.
	* libc/include/reent.h (stat64): Define as stat under Cygwin, instead
	of as __stat64.  Undef stat64 if not building Newlib.
	* libc/include/sys/stat.h (stat64): Define as stat under Cygwin.
This commit is contained in:
Corinna Vinschen 2013-04-23 09:42:25 +00:00
parent bca6ce4282
commit 1875ee55d3
6 changed files with 55 additions and 19 deletions

View File

@ -1,3 +1,15 @@
2013-04-23 Corinna Vinschen <vinschen@redhat.com>
Port newlib to x86_64-pc-cygwin.
* libc/include/sys/features.h: Redefine compilation environment
definitions for Cygwin to cover 64 bit Cygwin.
* libc/ctype/ctype_.c (_ctype_): Fix definition for 64 bit Cygwin.
* libc/include/machine/setjmp.h: Change definition of _JBLEN to allow
different values for 32 bit and 64 bit Cygwin.
* libc/include/reent.h (stat64): Define as stat under Cygwin, instead
of as __stat64. Undef stat64 if not building Newlib.
* libc/include/sys/stat.h (stat64): Define as stat under Cygwin.
2013-04-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/cdefs.h: Align with latest FreeBSD file header.

View File

@ -111,14 +111,21 @@ _CONST
char __EXPORT *__ctype_ptr__ = (char *) _ctype_b + 127;
# ifdef __CYGWIN__
# ifdef __x86_64__
__asm__ (" \n\
.data \n\
.globl _ctype_ \n\
.set _ctype_,_ctype_b+127 \n\
.text \n\
");
# else
__asm__ (" \n\
.data \n\
.globl __ctype_ \n\
.set __ctype_,__ctype_b+127 \n\
.text \n\
");
# endif
# else /* !__CYGWIN__ */
_CONST char _ctype_[1 + 256] = {

View File

@ -68,19 +68,24 @@ _BEGIN_STD_C
#define _JBLEN 9
#endif
#if defined(__CYGWIN__) && !defined (_JBLEN)
#define _JBLEN (13 * 4)
#elif defined (__i386__)
#if defined(__unix__) || defined(__rtems__)
# define _JBLEN 9
#else
#include "setjmp-dj.h"
#endif
#ifdef __i386__
# if defined(__CYGWIN__) && !defined (_JBLEN)
# define _JBLEN (13 * 4)
# elif defined(__unix__) || defined(__rtems__)
# define _JBLEN 9
# else
# include "setjmp-dj.h"
# endif
#endif
#ifdef __x86_64__
#define _JBTYPE long long
#define _JBLEN 8
# ifdef __CYGWIN__
# define _JBTYPE long
# define _JBLEN 32
# else
# define _JBTYPE long long
# define _JBLEN 8
# endif
#endif
#ifdef __i960__

View File

@ -163,16 +163,22 @@ extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void
#ifdef __LARGE64_FILES
#if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB)
#define stat64 __stat64
#endif
#if defined(__CYGWIN__)
#define stat64 stat
#endif
struct stat64;
extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int));
extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *));
extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int));
extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *));
/* Don't pollute namespace if not building newlib. */
#if defined (__CYGWIN__) && !defined (_COMPILING_NEWLIB)
#undef stat64
#endif
#endif
#endif

View File

@ -173,12 +173,18 @@ extern "C" {
#define _POSIX2_SW_DEV 200112L
#define _POSIX2_UPE 200112L
#define _POSIX_V6_ILP32_OFF32 -1
#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32
#ifdef __LP64__
#define _POSIX_V6_ILP32_OFFBIG -1
#define _POSIX_V6_LP64_OFF64 1
#define _POSIX_V6_LPBIG_OFFBIG 1
#else
#define _POSIX_V6_ILP32_OFFBIG 1
#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG
#define _POSIX_V6_LP64_OFF64 -1
#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64
#define _POSIX_V6_LPBIG_OFFBIG -1
#endif
#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32
#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG
#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64
#define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG
#define _XOPEN_CRYPT 1
#define _XOPEN_ENH_I18N 1

View File

@ -19,7 +19,7 @@ extern "C" {
#ifdef __CYGWIN__
#include <cygwin/stat.h>
#ifdef _COMPILING_NEWLIB
#define stat64 __stat64
#define stat64 stat
#endif
#else
struct stat