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:
		| @@ -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> | 2013-04-22  Sebastian Huber  <sebastian.huber@embedded-brains.de> | ||||||
|  |  | ||||||
| 	* libc/include/sys/cdefs.h: Align with latest FreeBSD file header. | 	* libc/include/sys/cdefs.h: Align with latest FreeBSD file header. | ||||||
|   | |||||||
| @@ -111,14 +111,21 @@ _CONST | |||||||
| char __EXPORT *__ctype_ptr__ = (char *) _ctype_b + 127; | char __EXPORT *__ctype_ptr__ = (char *) _ctype_b + 127; | ||||||
|  |  | ||||||
| #  ifdef __CYGWIN__ | #  ifdef __CYGWIN__ | ||||||
|  | #    ifdef __x86_64__ | ||||||
|  | __asm__ ("					\n\ | ||||||
|  |         .data					\n\ | ||||||
|  | 	.globl  _ctype_				\n\ | ||||||
|  | 	.set    _ctype_,_ctype_b+127		\n\ | ||||||
|  | 	.text                                   \n\ | ||||||
|  | "); | ||||||
|  | #    else | ||||||
| __asm__ ("					\n\ | __asm__ ("					\n\ | ||||||
|         .data					\n\ |         .data					\n\ | ||||||
| 	.globl  __ctype_			\n\ | 	.globl  __ctype_			\n\ | ||||||
| 	.set    __ctype_,__ctype_b+127		\n\ | 	.set    __ctype_,__ctype_b+127		\n\ | ||||||
| 	.text                                   \n\ | 	.text                                   \n\ | ||||||
| "); | "); | ||||||
|  | #    endif | ||||||
| #  else /* !__CYGWIN__ */ | #  else /* !__CYGWIN__ */ | ||||||
|  |  | ||||||
| _CONST char _ctype_[1 + 256] = { | _CONST char _ctype_[1 + 256] = { | ||||||
|   | |||||||
| @@ -68,19 +68,24 @@ _BEGIN_STD_C | |||||||
| #define	_JBLEN	9 | #define	_JBLEN	9 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #if defined(__CYGWIN__) && !defined (_JBLEN) | #ifdef __i386__ | ||||||
| #define _JBLEN (13 * 4) | # if defined(__CYGWIN__) && !defined (_JBLEN) | ||||||
| #elif defined (__i386__) | #  define _JBLEN (13 * 4) | ||||||
| #if defined(__unix__) || defined(__rtems__) | # elif defined(__unix__) || defined(__rtems__) | ||||||
| #  define _JBLEN	9 | #  define _JBLEN	9 | ||||||
| #else | # else | ||||||
| #include "setjmp-dj.h" | #  include "setjmp-dj.h" | ||||||
| #endif | # endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef __x86_64__ | #ifdef __x86_64__ | ||||||
| #define _JBTYPE long long | # ifdef __CYGWIN__ | ||||||
| #define _JBLEN  8 | #  define _JBTYPE long | ||||||
|  | #  define _JBLEN  32 | ||||||
|  | # else | ||||||
|  | #  define _JBTYPE long long | ||||||
|  | #  define _JBLEN  8 | ||||||
|  | # endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef __i960__ | #ifdef __i960__ | ||||||
|   | |||||||
| @@ -163,16 +163,22 @@ extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void | |||||||
|  |  | ||||||
| #ifdef __LARGE64_FILES | #ifdef __LARGE64_FILES | ||||||
|  |  | ||||||
| #if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB) |  | ||||||
| #define stat64 __stat64 |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
|  | #if defined(__CYGWIN__) | ||||||
|  | #define stat64 stat | ||||||
|  | #endif | ||||||
| struct stat64; | struct stat64; | ||||||
|  |  | ||||||
| extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); | extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); | ||||||
| extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); | extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); | ||||||
| extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); | extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); | ||||||
| extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *)); | 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 | ||||||
|  |  | ||||||
| #endif | #endif | ||||||
|   | |||||||
| @@ -173,12 +173,18 @@ extern "C" { | |||||||
| #define _POSIX2_SW_DEV				200112L | #define _POSIX2_SW_DEV				200112L | ||||||
| #define _POSIX2_UPE				200112L | #define _POSIX2_UPE				200112L | ||||||
| #define _POSIX_V6_ILP32_OFF32			    -1 | #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 _POSIX_V6_ILP32_OFFBIG			     1 | ||||||
| #define _XBS5_ILP32_OFFBIG			_POSIX_V6_ILP32_OFFBIG |  | ||||||
| #define _POSIX_V6_LP64_OFF64			    -1 | #define _POSIX_V6_LP64_OFF64			    -1 | ||||||
| #define _XBS5_LP64_OFF64			_POSIX_V6_LP64_OFF64 |  | ||||||
| #define _POSIX_V6_LPBIG_OFFBIG			    -1 | #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 _XBS5_LPBIG_OFFBIG			_POSIX_V6_LPBIG_OFFBIG | ||||||
| #define _XOPEN_CRYPT				     1 | #define _XOPEN_CRYPT				     1 | ||||||
| #define _XOPEN_ENH_I18N				     1 | #define _XOPEN_ENH_I18N				     1 | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ extern "C" { | |||||||
| #ifdef __CYGWIN__ | #ifdef __CYGWIN__ | ||||||
| #include <cygwin/stat.h> | #include <cygwin/stat.h> | ||||||
| #ifdef _COMPILING_NEWLIB | #ifdef _COMPILING_NEWLIB | ||||||
| #define stat64 __stat64 | #define stat64 stat | ||||||
| #endif | #endif | ||||||
| #else | #else | ||||||
| struct	stat  | struct	stat  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user