- various fixes, as GCC would generate incorrect code (what's new..)

from Alexander Shiryaev (MAINTAINER)
ok landry@
This commit is contained in:
jasper 2011-01-18 12:03:19 +00:00
parent fe14c11641
commit 2b652e0076
4 changed files with 46 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.2 2011/01/17 09:25:23 jasper Exp $
# $OpenBSD: Makefile,v 1.3 2011/01/18 12:03:19 jasper Exp $
ONLY_FOR_ARCHS= i386
@ -7,6 +7,7 @@ COMMENT = optimizing Oberon-2 to C compiler
SHARED_ONLY = Yes
DISTNAME = oo2c_32-2.1.11
REVISION = 0
SHARED_LIBS = oo2c 3.0
CATEGORIES = lang
@ -34,7 +35,7 @@ USE_LIBTOOL = Yes
USE_GMAKE = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ENV = CFLAGS="${CFLAGS} -I${LOCALBASE}/include -DGC_PTR='void*'" \
CONFIGURE_ENV = CFLAGS="${CFLAGS} -O0 -I${LOCALBASE}/include -DGC_PTR='void*'" \
LDFLAGS="-L${LOCALBASE}/lib -pthread"
FAKE_FLAGS = prefix="${WRKINST}${PREFIX}" \

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-lib_src___oo2c_h,v 1.1 2011/01/18 12:03:19 jasper Exp $
--- lib/src/__oo2c.h.orig Sat Dec 24 15:55:21 2005
+++ lib/src/__oo2c.h Tue Jan 18 13:47:55 2011
@@ -152,7 +152,7 @@ extern OOC_INT32 _cmp32(const OOC_CHAR32* l, const OOC
/* def: _x MOD _y >= 0 for _y>0, and undefined otherwise */
#define _div(_x,_y) ({ \
typeof(_x) _quot = _x / _y; \
- if ((_x<0) && (_y>0) && (_quot*_y!=_x)) _quot--; \
+ if ((((_x<0) && (_y>0)) || ((_x>0) && (_y<0))) && (_quot*_y!=_x)) _quot--; \
_quot; })
/* MOD(integer, integer) -- note: macro uses gcc style expression statement */
@@ -164,7 +164,7 @@ extern OOC_INT32 _cmp32(const OOC_CHAR32* l, const OOC
/* def: _x MOD _y >= 0 for _y>0, and undefined otherwise */
#define _mod(_x,_y) ({ \
typeof(_x) _rem = _x % _y; \
- if ((_x<0) && (_y>0) && (_rem != 0)) _rem += _y; \
+ if ((((_x<0) && (_y>0)) || ((_x>0) && (_y<0))) && (_rem != 0)) _rem += _y; \
_rem; })
/* i IN s */

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-tests_lib_LibWeakRef1_Mod,v 1.1 2011/01/18 12:03:19 jasper Exp $
--- tests/lib/LibWeakRef1.Mod.orig Mon Jan 12 08:38:59 2004
+++ tests/lib/LibWeakRef1.Mod Tue Jan 18 13:49:14 2011
@@ -19,7 +19,7 @@ VAR
r : ARRAY count OF T;
wr : ARRAY count OF WeakRef.WeakRef(T);
-PROCEDURE (t : T) INIT(i : LONGINT);
+PROCEDURE (t : T) INIT*(i : LONGINT);
BEGIN
t.i := i;
END INIT;

View File

@ -0,0 +1,10 @@
$OpenBSD: patch-tests_ssa_VTable3_cpp,v 1.1 2011/01/18 12:03:19 jasper Exp $
--- tests/ssa/VTable3.cpp.orig Wed Dec 15 15:47:37 2004
+++ tests/ssa/VTable3.cpp Tue Jan 18 13:49:47 2011
@@ -29,3 +29,6 @@ extern "C" T * VTable3__NewT(void) {
extern "C" void OOC_VTable3_open(void) {
}
+
+extern "C" void OOC_VTable3_close(void) {
+}