2005-03-17 Jeff Johnston <jjohnstn@redhat.com>
* configure.in: Add new check to see if compiler supports
        aliasing of arrays and define _HAVE_ARRAY_ALIASING if true.
        * configure: Regenerated.
        * Makefile.in: Ditto.
        * newlib.hin: Add _HAVE_ARRAY_ALIASING.
        * libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before
        aliasing the _ctype_ array to _ctype_b.
        * libc/include/ctype.h: Change macros to use __ctype_ptr.  Mark
        _ctype_ as deprecated.
			
			
This commit is contained in:
		| @@ -1,3 +1,15 @@ | |||||||
|  | 2005-03-17  Jeff Johnston  <jjohnstn@redhat.com> | ||||||
|  |  | ||||||
|  | 	* configure.in: Add new check to see if compiler supports | ||||||
|  | 	aliasing of arrays and define _HAVE_ARRAY_ALIASING if true. | ||||||
|  | 	* configure: Regenerated. | ||||||
|  | 	* Makefile.in: Ditto. | ||||||
|  | 	* newlib.hin: Add _HAVE_ARRAY_ALIASING. | ||||||
|  | 	* libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before | ||||||
|  | 	aliasing the _ctype_ array to _ctype_b. | ||||||
|  | 	* libc/include/ctype.h: Change macros to use __ctype_ptr.  Mark | ||||||
|  | 	_ctype_ as deprecated. | ||||||
|  |  | ||||||
| 2005-03-17  Hans-Peter Nilsson  <hp@axis.com> | 2005-03-17  Hans-Peter Nilsson  <hp@axis.com> | ||||||
|  |  | ||||||
| 	* configure.host (newlib_cflags) <cris-*-*, crisv32-*-*>: Add | 	* configure.host (newlib_cflags) <cris-*-*, crisv32-*-*>: Add | ||||||
|   | |||||||
| @@ -103,6 +103,7 @@ SYS_OBJECTLIST = @SYS_OBJECTLIST@ | |||||||
| UNIX_OBJECTLIST = @UNIX_OBJECTLIST@ | UNIX_OBJECTLIST = @UNIX_OBJECTLIST@ | ||||||
| VERSION = @VERSION@ | VERSION = @VERSION@ | ||||||
| aext = @aext@ | aext = @aext@ | ||||||
|  | libc_cv_array_aliasing = @libc_cv_array_aliasing@ | ||||||
| libc_cv_initfinit_array = @libc_cv_initfinit_array@ | libc_cv_initfinit_array = @libc_cv_initfinit_array@ | ||||||
| libm_machine_dir = @libm_machine_dir@ | libm_machine_dir = @libm_machine_dir@ | ||||||
| machine_dir = @machine_dir@ | machine_dir = @machine_dir@ | ||||||
|   | |||||||
							
								
								
									
										29
									
								
								newlib/configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										29
									
								
								newlib/configure
									
									
									
									
										vendored
									
									
								
							| @@ -3459,6 +3459,34 @@ EOF | |||||||
|  |  | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | echo $ac_n "checking for array aliasing support""... $ac_c" 1>&6 | ||||||
|  | echo "configure:3464: checking for array aliasing support" >&5 | ||||||
|  | if eval "test \"`echo '$''{'libc_cv_array_aliasing'+set}'`\" = set"; then | ||||||
|  |   echo $ac_n "(cached) $ac_c" 1>&6 | ||||||
|  | else | ||||||
|  |   cat > conftest.c <<EOF | ||||||
|  | char x3 = { 'a', 'b', 'c' }; | ||||||
|  | extern char y2 __attribute__((alias ("x+1"))); | ||||||
|  | EOF | ||||||
|  | if { ac_try='${CC} $CFLAGS $CPPFLAGS -c conftest.c | ||||||
|  | 		   1>&AS_MESSAGE_LOG_FD'; { (eval echo configure:3473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | ||||||
|  | then | ||||||
|  |   libc_cv_array_aliasing=yes | ||||||
|  | else | ||||||
|  |   libc_cv_array_aliasing=no | ||||||
|  | fi | ||||||
|  | rm -f conftest* | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | echo "$ac_t""$libc_cv_array_aliasing" 1>&6 | ||||||
|  |  | ||||||
|  | if test $libc_cv_array_aliasing = yes; then | ||||||
|  |   cat >> confdefs.h <<EOF | ||||||
|  | #define _HAVE_ARRAY_ALIASING 1 | ||||||
|  | EOF | ||||||
|  |  | ||||||
|  | fi | ||||||
|  |  | ||||||
| trap '' 1 2 15 | trap '' 1 2 15 | ||||||
| cat > confcache <<\EOF | cat > confcache <<\EOF | ||||||
| # This file is a shell script that caches the results of configure | # This file is a shell script that caches the results of configure | ||||||
| @@ -3676,6 +3704,7 @@ s%@UNIX_OBJECTLIST@%$UNIX_OBJECTLIST%g | |||||||
| s%@STDIO64_OBJECTLIST@%$STDIO64_OBJECTLIST%g | s%@STDIO64_OBJECTLIST@%$STDIO64_OBJECTLIST%g | ||||||
| s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g | s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g | ||||||
| s%@libc_cv_initfinit_array@%$libc_cv_initfinit_array%g | s%@libc_cv_initfinit_array@%$libc_cv_initfinit_array%g | ||||||
|  | s%@libc_cv_array_aliasing@%$libc_cv_array_aliasing%g | ||||||
|  |  | ||||||
| CEOF | CEOF | ||||||
| EOF | EOF | ||||||
|   | |||||||
| @@ -354,6 +354,25 @@ if test $libc_cv_initfinit_array = yes; then | |||||||
|   AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY) |   AC_DEFINE_UNQUOTED(HAVE_INITFINI_ARRAY) | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | AC_CACHE_CHECK(for array aliasing support, | ||||||
|  | 	       libc_cv_array_aliasing, [dnl | ||||||
|  | cat > conftest.c <<EOF | ||||||
|  | char x[3] = { 'a', 'b', 'c' }; | ||||||
|  | extern char y[2] __attribute__((alias ("x+1"))); | ||||||
|  | EOF | ||||||
|  | if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -c conftest.c | ||||||
|  | 		   1>&AS_MESSAGE_LOG_FD]) | ||||||
|  | then | ||||||
|  |   libc_cv_array_aliasing=yes | ||||||
|  | else | ||||||
|  |   libc_cv_array_aliasing=no | ||||||
|  | fi | ||||||
|  | rm -f conftest*]) | ||||||
|  | AC_SUBST(libc_cv_array_aliasing) | ||||||
|  | if test $libc_cv_array_aliasing = yes; then | ||||||
|  |   AC_DEFINE_UNQUOTED(_HAVE_ARRAY_ALIASING) | ||||||
|  | fi | ||||||
|  |  | ||||||
| AC_OUTPUT(Makefile, | AC_OUTPUT(Makefile, | ||||||
| [if test -n "$CONFIG_FILES"; then | [if test -n "$CONFIG_FILES"; then | ||||||
|   unset ac_file |   unset ac_file | ||||||
|   | |||||||
| @@ -84,21 +84,40 @@ static _CONST char _ctype_b[128 + 256] = { | |||||||
| 	_CTYPE_DATA_128_256 | 	_CTYPE_DATA_128_256 | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #if defined(__CYGWIN__) | #  if defined(__CYGWIN__) | ||||||
| extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127"))); |  | ||||||
| _CONST char __declspec(dllexport) *__ctype_ptr = _ctype_b + 128; | _CONST char __declspec(dllexport) *__ctype_ptr = _ctype_b + 128; | ||||||
| #else | #  else | ||||||
| extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127"))); |  | ||||||
| _CONST char *__ctype_ptr = _ctype_b + 128; | _CONST char *__ctype_ptr = _ctype_b + 128; | ||||||
| #endif | #  endif | ||||||
|  |  | ||||||
|  | #  if defined(_HAVE_ARRAY_ALIASING) | ||||||
|  |  | ||||||
|  | #    if defined(__CYGWIN__) | ||||||
|  | extern _CONST char __declspec(dllexport) _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127"))); | ||||||
|  | #    else | ||||||
|  | extern _CONST char _ctype_[1 + 256] __attribute__ ((alias ("_ctype_b+127"))); | ||||||
|  | #    endif | ||||||
|  |  | ||||||
|  | #  else /* !_HAVE_ARRAY_ALIASING */ | ||||||
|  |  | ||||||
|  | #    if defined(__CYGWIN__) | ||||||
|  | _CONST char __declspec(dllexport) _ctype_[1 + 256] = { | ||||||
|  | #    else | ||||||
|  | _CONST char _ctype_[1 + 256] = { | ||||||
|  | #    endif | ||||||
|  | 	0, | ||||||
|  | 	_CTYPE_DATA_0_127, | ||||||
|  | 	_CTYPE_DATA_128_256 | ||||||
|  | }; | ||||||
|  | #  endif /* !_HAVE_ARRAY_ALIASING */ | ||||||
|  |  | ||||||
| #else	/* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */ | #else	/* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */ | ||||||
|  |  | ||||||
| #if defined(__CYGWIN__) | # if defined(__CYGWIN__) | ||||||
| _CONST char __declspec(dllexport) _ctype_[1 + 256] = { | _CONST char __declspec(dllexport) _ctype_[1 + 256] = { | ||||||
| #else | # else | ||||||
| _CONST char _ctype_[1 + 256] = { | _CONST char _ctype_[1 + 256] = { | ||||||
| #endif | # endif | ||||||
| 	0, | 	0, | ||||||
| 	_CTYPE_DATA_0_127, | 	_CTYPE_DATA_0_127, | ||||||
| 	_CTYPE_DATA_128_256 | 	_CTYPE_DATA_128_256 | ||||||
|   | |||||||
| @@ -36,20 +36,23 @@ int _EXFUN(_toupper, (int __c)); | |||||||
| #define _X	0100 | #define _X	0100 | ||||||
| #define	_B	0200 | #define	_B	0200 | ||||||
|  |  | ||||||
| extern	__IMPORT _CONST char	_ctype_[]; | extern	__IMPORT _CONST char	*__ctype_ptr; | ||||||
|  |  | ||||||
| #ifndef __cplusplus | #ifndef __cplusplus | ||||||
| #define	isalpha(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L)) | #define	isalpha(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_U|_L)) | ||||||
| #define	isupper(c)	((_ctype_+1)[(unsigned)(c)]&_U) | #define	isupper(c)	((__ctype_ptr+1)[(unsigned)(c)]&_U) | ||||||
| #define	islower(c)	((_ctype_+1)[(unsigned)(c)]&_L) | #define	islower(c)	((__ctype_ptr+1)[(unsigned)(c)]&_L) | ||||||
| #define	isdigit(c)	((_ctype_+1)[(unsigned)(c)]&_N) | #define	isdigit(c)	((__ctype_ptr+1)[(unsigned)(c)]&_N) | ||||||
| #define	isxdigit(c)	((_ctype_+1)[(unsigned)(c)]&(_X|_N)) | #define	isxdigit(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_X|_N)) | ||||||
| #define	isspace(c)	((_ctype_+1)[(unsigned)(c)]&_S) | #define	isspace(c)	((__ctype_ptr+1)[(unsigned)(c)]&_S) | ||||||
| #define ispunct(c)	((_ctype_+1)[(unsigned)(c)]&_P) | #define ispunct(c)	((__ctype_ptr+1)[(unsigned)(c)]&_P) | ||||||
| #define isalnum(c)	((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N)) | #define isalnum(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_U|_L|_N)) | ||||||
| #define isprint(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) | #define isprint(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) | ||||||
| #define	isgraph(c)	((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N)) | #define	isgraph(c)	((__ctype_ptr+1)[(unsigned)(c)]&(_P|_U|_L|_N)) | ||||||
| #define iscntrl(c)	((_ctype_+1)[(unsigned)(c)]&_C) | #define iscntrl(c)	((__ctype_ptr+1)[(unsigned)(c)]&_C) | ||||||
|  |  | ||||||
|  | extern	__IMPORT _CONST char	_ctype_[];  /* Deprecated.  */ | ||||||
|  |  | ||||||
| /* Non-gcc versions will get the library versions, and will be | /* Non-gcc versions will get the library versions, and will be | ||||||
|    slightly slower */ |    slightly slower */ | ||||||
| #ifdef __GNUC__ | #ifdef __GNUC__ | ||||||
|   | |||||||
| @@ -141,5 +141,8 @@ | |||||||
|  * sections.  */ |  * sections.  */ | ||||||
| #undef  HAVE_INITFINI_ARRAY | #undef  HAVE_INITFINI_ARRAY | ||||||
|  |  | ||||||
|  | /* Define if the compiler supports aliasing an array to an address.  */ | ||||||
|  | #undef  _HAVE_ARRAY_ALIASING | ||||||
|  |  | ||||||
| #endif /* !__NEWLIB_H__ */ | #endif /* !__NEWLIB_H__ */ | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user