pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/emulators/palmosemulator Fix the build of the Palm OS ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5ac54a423084
branches:  trunk
changeset: 534495:5ac54a423084
user:      dsainty <dsainty%pkgsrc.org@localhost>
date:      Wed Oct 24 14:28:14 2007 +0000

description:
Fix the build of the Palm OS Emulator with GCC 4.1.2.

patch-ar was sourced from http://www.freebsd.org/cgi/cvsweb.cgi/ports/palm/pose/files/patch-SrcShared-EmPalmStructs.h

Changes to patch-ap were determined by getting gcc 3.4 and gcc 4.1.2 to
fight until the bug was forced to reveal itself!

Don't need to bump the revision.  Either it built under gcc 3 and worked, or
didn't build at all under gcc 4.

Addresses PR pkg/37188.

diffstat:

 emulators/palmosemulator/distinfo         |   5 ++-
 emulators/palmosemulator/patches/patch-ap |  28 ++++++++++++++++++++++----
 emulators/palmosemulator/patches/patch-ar |  32 +++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 7 deletions(-)

diffs (96 lines):

diff -r a582f0e3e575 -r 5ac54a423084 emulators/palmosemulator/distinfo
--- a/emulators/palmosemulator/distinfo Wed Oct 24 09:51:20 2007 +0000
+++ b/emulators/palmosemulator/distinfo Wed Oct 24 14:28:14 2007 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2006/06/28 15:56:10 joerg Exp $
+$NetBSD: distinfo,v 1.8 2007/10/24 14:28:14 dsainty Exp $
 
 SHA1 (palmosemulator/emulator_src_3.5.tar.gz) = 2debd7690736397d0af41f7b2d482df65391fc65
 RMD160 (palmosemulator/emulator_src_3.5.tar.gz) = fbb6761e4c43ecc9fb20d90d2ae0ec6ccf1c3f27
@@ -21,5 +21,6 @@
 SHA1 (patch-am) = 2790c8b567a94d86bced52d59cf62b4448b62731
 SHA1 (patch-an) = 93e326e3ab9f532d5bab1cc987c179e8337a823d
 SHA1 (patch-ao) = 9ace708f71d33802059db53c9242f0d89a77e4da
-SHA1 (patch-ap) = 7cb159b84f8ad0638c49285ea5140aae93623f96
+SHA1 (patch-ap) = 1fe9bf4a1d70230f2abb9375b9e439a3a163b4d7
 SHA1 (patch-aq) = f3d3a6bf278f71573fb7d45021305561c3dcc114
+SHA1 (patch-ar) = 50562522b9625e034b858439bd409b177f819f85
diff -r a582f0e3e575 -r 5ac54a423084 emulators/palmosemulator/patches/patch-ap
--- a/emulators/palmosemulator/patches/patch-ap Wed Oct 24 09:51:20 2007 +0000
+++ b/emulators/palmosemulator/patches/patch-ap Wed Oct 24 14:28:14 2007 +0000
@@ -1,8 +1,26 @@
-$NetBSD: patch-ap,v 1.1 2006/04/28 13:52:06 joerg Exp $
+$NetBSD: patch-ap,v 1.2 2007/10/24 14:28:14 dsainty Exp $
+
+The buffer "buffer" has to be aligned on a 2 byte boundary.  On an odd byte
+boundary we get the error at startup:
+
+    Hardware exception #3 occurred while the emulator was
+    calling the Palm OS function "DlkDispatchRequest". The
+    emulator is now in an unstable state and will reset.
+
+An odd byte boundary (and the above error) is typical with gcc 4.1.2 on x86.
 
---- SrcShared/Miscellaneous.cpp.orig   2006-04-28 13:19:44.000000000 +0000
-+++ SrcShared/Miscellaneous.cpp
-@@ -2687,7 +2687,7 @@ void FormatInteger (char* dest, uint32 i
+--- SrcShared/Miscellaneous.cpp.orig   2002-03-30 01:11:15.000000000 +1200
++++ SrcShared/Miscellaneous.cpp        2007-10-25 02:41:24.000000000 +1300
+@@ -1370,7 +1370,7 @@
+       char    buffer[ sizeof (DlpReqHeaderType) +
+                                       sizeof (DlpTinyArgWrapperType) +
+                                       sizeof (DlpWriteUserInfoReqHdrType) +
+-                                      dlpMaxUserNameSize];
++                                      dlpMaxUserNameSize] __attribute__((__aligned__(2)));
+ 
+       // Get handy pointers to all of the above.
+       DlpReqHeaderType*                       reqHdr          = (DlpReqHeaderType*) buffer;
+@@ -2687,7 +2687,7 @@
        // Get the thousands separator character(s).
  
        struct lconv*   locale_data = localeconv ();
@@ -11,7 +29,7 @@
  
        if (strlen (thousands_sep) == 0)
        {
-@@ -2747,7 +2747,7 @@ string FormatInteger (uint32 integer)
+@@ -2747,7 +2747,7 @@
        // Get the thousands separator character(s).
  
        struct lconv*   locale_data = localeconv ();
diff -r a582f0e3e575 -r 5ac54a423084 emulators/palmosemulator/patches/patch-ar
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/palmosemulator/patches/patch-ar Wed Oct 24 14:28:14 2007 +0000
@@ -0,0 +1,32 @@
+$NetBSD: patch-ar,v 1.1 2007/10/24 14:28:14 dsainty Exp $
+
+Fix build with gcc41.
+
+--- SrcShared/EmPalmStructs.h.orig     Thu Oct  5 15:19:20 2006
++++ SrcShared/EmPalmStructs.h  Thu Oct  5 15:19:43 2006
+@@ -577,9 +577,9 @@
+       template <class A>                                                                                                                              \
+       INLINE_ EmAlias##type<A>& EmAlias##type<A>::operator= (rhs_type val)                    \
+       {                                                                                                                                                               \
+-              if (sizeof (asType) == 1)               A::PutByte (this->GetPtr (), (unsigned char) (asType) val);             \
+-              else if (sizeof (asType) == 2)  A::PutWord (this->GetPtr (), (unsigned short) (asType) val);    \
+-              else if (sizeof (asType) == 4)  A::PutLong (this->GetPtr (), (unsigned long) (asType) val);             \
++              if (sizeof (asType) == 1)               A::PutByte (this->GetPtr (), (unsigned char) (asType) (long) val);              \
++              else if (sizeof (asType) == 2)  A::PutWord (this->GetPtr (), (unsigned short) (asType) (long) val);     \
++              else if (sizeof (asType) == 4)  A::PutLong (this->GetPtr (), (unsigned long) (asType) (long) val);              \
+               else BadSetter ();                                                                                                                      \
+                                                                                                                                                                       \
+               return *this;                                                                                                                           \
+@@ -589,9 +589,9 @@
+                                                                                                                                                                       \
+       INLINE_ EmProxy##type& EmProxy##type::operator= (rhs_type val)                                  \
+       {                                                                                                                                                               \
+-              if (sizeof (asType) == 1)               LAS::PutByte (this->GetPtr (), (unsigned char) (asType) val);   \
+-              else if (sizeof (asType) == 2)  LAS::PutWord (this->GetPtr (), (unsigned short) (asType) val);  \
+-              else if (sizeof (asType) == 4)  LAS::PutLong (this->GetPtr (), (unsigned long) (asType) val);   \
++              if (sizeof (asType) == 1)               LAS::PutByte (this->GetPtr (), (unsigned char) (asType) (long) val);    \
++              else if (sizeof (asType) == 2)  LAS::PutWord (this->GetPtr (), (unsigned short) (asType) (long) val);   \
++              else if (sizeof (asType) == 4)  LAS::PutLong (this->GetPtr (), (unsigned long) (asType) (long) val);    \
+               else BadSetter ();                                                                                                                      \
+                                                                                                                                                                       \
+               return *this;                                                                                                                           \



Home | Main Index | Thread Index | Old Index