[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#444580: [PATCH] set correct WCHAR_MIN and WCHAR_MAX on armel port



Package: glibc
Version: 2.6.1-5
Severity: normal
Tags: patch
User: debian-arm@lists.debian.org
Usertags: eabi

Unlike other architectures, on Arm EABI, wchar_t is "unsigned int".
thus the default glibc definitions are incorrect:

#define __WCHAR_MIN     (-2147483647 - 1)
#define __WCHAR_MAX     (2147483647)

This causes miscompilation of atleast libidn, and possibly other
packages that use gnulib tests that check the correctness of wchar_t.
The attached adds a eabi specific bits.h.

-- 
"rm -rf" only sounds scary if you don't have backups
diff -u glibc-2.6.1/debian/patches/series glibc-2.6.1/debian/patches/series
--- glibc-2.6.1/debian/patches/series
+++ glibc-2.6.1/debian/patches/series
@@ -46,6 +46,7 @@
 arm/local-ioperm.diff -p0
 arm/local-no-hwcap.diff -p0
 arm/submitted-RTLD_SINGLE_THREAD_P.diff -p0
+arm/eabi-wchar.diff
 
 hppa/submitted-atomic_h.diff -p0
 hppa/submitted-fadvise64_64.diff -p0
only in patch2:
unchanged:
--- glibc-2.6.1.orig/debian/patches/arm/eabi-wchar.diff
+++ glibc-2.6.1/debian/patches/arm/eabi-wchar.diff
@@ -0,0 +1,31 @@
+Index: glibc-2.6.1/ports/sysdeps/arm/eabi/bits/wchar.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ glibc-2.6.1/ports/sysdeps/arm/eabi/bits/wchar.h	2007-09-28 21:56:24.000000000 +0000
+@@ -0,0 +1,26 @@
++/* wchar_t type related definitions.
++   Copyright (C) 2000 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _BITS_WCHAR_H
++#define _BITS_WCHAR_H	1
++
++#define __WCHAR_MIN	( 0 )
++#define __WCHAR_MAX	( (wchar_t) - 1 )
++
++#endif	/* bits/wchar.h */

Attachment: signature.asc
Description: Digital signature


Reply to: