rev 9985 - in branches/qt4-x11/debian: . patches

Fathi Boudra fabo at alioth.debian.org
Fri Apr 4 20:20:20 UTC 2008


Author: fabo
Date: 2008-04-04 20:20:20 +0000 (Fri, 04 Apr 2008)
New Revision: 9985

Added:
   branches/qt4-x11/debian/patches/71_hppa_unaligned_access_fix_458133.diff
Removed:
   branches/qt4-x11/debian/readdir-hppa-test.c
Modified:
   branches/qt4-x11/debian/changelog
   branches/qt4-x11/debian/patches/series
   branches/qt4-x11/debian/rules
Log:
* Add patch to fix unaligned access that cause a bus error on hppa.
* Remove hppa test.


Modified: branches/qt4-x11/debian/changelog
===================================================================
--- branches/qt4-x11/debian/changelog	2008-04-04 18:50:04 UTC (rev 9984)
+++ branches/qt4-x11/debian/changelog	2008-04-04 20:20:20 UTC (rev 9985)
@@ -47,6 +47,8 @@
     architectures listed first. (Closes: #473348)
   * Add architectures availability list to libqt4-sql-ibase package.
     (Closes: #473348)
+  * Add patch to fix unaligned access that cause a bus error on hppa.
+    Thanks to Bernhard R. Link. (Closes: #458133)
 
  -- Fathi Boudra <fabo at debian.org>  Fri, 04 Apr 2008 10:42:06 +0200
 

Added: branches/qt4-x11/debian/patches/71_hppa_unaligned_access_fix_458133.diff
===================================================================
--- branches/qt4-x11/debian/patches/71_hppa_unaligned_access_fix_458133.diff	                        (rev 0)
+++ branches/qt4-x11/debian/patches/71_hppa_unaligned_access_fix_458133.diff	2008-04-04 20:20:20 UTC (rev 9985)
@@ -0,0 +1,91 @@
+author: Bernhard R. Link <brlink at debian.org>
+
+Fix unaligned access that cause a bus error on hppa (ftbfs)
+
+--- a/src/corelib/global/qnumeric_p.h
++++ b/src/corelib/global/qnumeric_p.h
+@@ -64,11 +64,17 @@
+ static const unsigned char qt_armfpa_inf_bytes[] = { 0, 0, 0xf0, 0x7f, 0, 0, 0, 0 };
+ static inline double qt_inf()
+ {
++    union { double d; unsigned char bytes[8]; } val;
++
+ #ifdef QT_ARMFPA
+-    return *reinterpret_cast<const double *>(qt_armfpa_inf_bytes);
++    qMemCopy(val.bytes, qt_armfpa_inf_bytes, 8);
+ #else
+-    return *reinterpret_cast<const double *>(QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_inf_bytes : qt_le_inf_bytes);
++    if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
++        qMemCopy(val.bytes, qt_be_inf_bytes, 8);
++      else
++        qMemCopy(val.bytes, qt_le_inf_bytes, 8);
+ #endif
++    return val.d;
+ }
+ 
+ // Signaling NAN
+@@ -77,11 +83,17 @@
+ static const unsigned char qt_armfpa_snan_bytes[] = { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 };
+ static inline double qt_snan()
+ {
++    union { double d; unsigned char bytes[8]; } val;
++
+ #ifdef QT_ARMFPA
+-    return *reinterpret_cast<const double *>(qt_armfpa_snan_bytes);
++    qMemCopy(val.bytes, qt_armfpa_snan_bytes, 8);
+ #else
+-    return *reinterpret_cast<const double *>(QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_snan_bytes : qt_le_snan_bytes);
++    if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
++        qMemCopy(val.bytes, qt_be_snan_bytes, 8);
++      else
++        qMemCopy(val.bytes, qt_le_snan_bytes, 8);
+ #endif
++    return val.d;
+ }
+ 
+ // Quiet NAN
+@@ -90,11 +102,17 @@
+ static const unsigned char qt_armfpa_qnan_bytes[] = { 0, 0, 0xf8, 0xff, 0, 0, 0, 0 };
+ static inline double qt_qnan()
+ {
++    union { double d; unsigned char bytes[8]; } val;
++
+ #ifdef QT_ARMFPA
+-    return *reinterpret_cast<const double *>(qt_armfpa_qnan_bytes);
++    qMemCopy(val.bytes, qt_armfpa_qnan_bytes, 8);
+ #else
+-    return *reinterpret_cast<const double *>(QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_qnan_bytes : qt_le_qnan_bytes);
++    if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
++        qMemCopy(val.bytes, qt_be_qnan_bytes, 8);
++      else
++        qMemCopy(val.bytes, qt_le_qnan_bytes, 8);
+ #endif
++    return val.d;
+ }
+ 
+ static inline bool qt_is_inf(double d)
+--- a/src/3rdparty/sha1/sha1.cpp
++++ b/src/3rdparty/sha1/sha1.cpp
+@@ -151,10 +151,10 @@
+     quint32 d = state->h3;
+     quint32 e = state->h4;
+ 
+-    quint8 chunkBuffer[64];
+-    memcpy(chunkBuffer, buffer, 64);
++    Sha1Chunk chunkBuffer;
++    memcpy(chunkBuffer.bytes, buffer, 64);
+ 
+-    Sha1Chunk *chunk = reinterpret_cast<Sha1Chunk*>(&chunkBuffer);
++    Sha1Chunk *chunk = &chunkBuffer;
+ 
+     for (int i = 0; i < 16; ++i)
+         chunk->words[i] = qFromBigEndian(chunk->words[i]);
+@@ -190,7 +190,7 @@
+     // Wipe variables
+ #ifdef SHA1_WIPE_VARIABLES
+     a = b = c = d = e = 0;
+-    memset(chunkBuffer, 0, 64);
++    memset(chunkBuffer.bytes, 0, 64);
+ #endif
+ }
+ 

Modified: branches/qt4-x11/debian/patches/series
===================================================================
--- branches/qt4-x11/debian/patches/series	2008-04-04 18:50:04 UTC (rev 9984)
+++ branches/qt4-x11/debian/patches/series	2008-04-04 20:20:20 UTC (rev 9985)
@@ -26,4 +26,5 @@
 50_kfreebsd_build_fix.diff
 60_m68k_inotify_fix.diff
 70_hppa_ldcw_fix.diff
+71_hppa_unaligned_access_fix_458133.diff
 80_hurd_max_path.diff

Deleted: branches/qt4-x11/debian/readdir-hppa-test.c

Modified: branches/qt4-x11/debian/rules
===================================================================
--- branches/qt4-x11/debian/rules	2008-04-04 18:50:04 UTC (rev 9984)
+++ branches/qt4-x11/debian/rules	2008-04-04 20:20:20 UTC (rev 9985)
@@ -53,20 +53,6 @@
 common-configure-arch:: config.status
 
 config.status:
-ifeq ($(DEB_HOST_ARCH),hppa)
-	mkdir -p debian/hppa-tmp
-	echo "Testing whether getdents kernel bug is present on this buildd - see #433768"
-	gcc -o debian/hppa-tmp/hppa-test-program debian/readdir-hppa-test.c
-	cd $(CURDIR)/doc/html && $(CURDIR)/debian/hppa-tmp/hppa-test-program | sort > $(CURDIR)/debian/hppa-tmp/readdir_r-out
-	cd $(CURDIR)/doc/html && ls -a | sort > $(CURDIR)/debian/hppa-tmp/ls-a-out
-	@if ! diff -q $(CURDIR)/debian/hppa-tmp/readdir_r-out $(CURDIR)/debian/hppa-tmp/ls-a-out ; \
-		then \
-		echo "Kernel bug present. This will misbuild qt4 if proceeding. Failing" ; \
-		echo "Please update kernel and test again" ; \
-		exit 5 ; \
-	fi
-endif
-
 	# Create mkspecs/glibc-g++ from mkspecs/linux-g++, needed by GNU/kFreeBSD
 	# we cannot use directly linux-g++ due to src/corelib/io/io.pri
 	rm -rf mkspecs/glibc-g++
@@ -129,9 +115,6 @@
 
 	rm -rf lib/ plugins/ mkspecs/glibc-g++
 
-	# clean up after hppa tests
-	rm -rf debian/hppa-tmp
-
 	find bin/ config.tests/ qmake/ -exec file {} \; | grep ELF | sed 's/:.*//'  | xargs rm -f
 
 	find include/ -type l -print0 | xargs -0r rm -f




More information about the pkg-kde-commits mailing list