ports/108994: [MAINTAINER] devel/py-ode: fix gcc4x build

Dmitry Marakasov amdmi3 at amdmi3.ru
Fri Feb 9 21:50:01 UTC 2007


>Number:         108994
>Category:       ports
>Synopsis:       [MAINTAINER] devel/py-ode: fix gcc4x build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 09 21:50:00 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 6.1-RELEASE-p12 i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 6.1-RELEASE-p12 FreeBSD 6.1-RELEASE-p12 #0: Tue Jan 16 23:12:21 MSK 2007 amdmi3 at hades.panopticon:/usr/obj/usr/src/sys/HADES i386


>Description:
Here's detailed description, maybe this PR should be referenced in the wiki: http://wiki.freebsd.org/gcc4

py-ode fails to build with gcc4x, with following errors:

gcc41:
ode_notrimesh.c:3776: error: invalid lvalue in assignment
ode_notrimesh.c:3784: error: invalid lvalue in assignment

gcc42:
ode_notrimesh.c:3776: error: lvalue required as left operand of assignment
ode_notrimesh.c:3784: error: lvalue required as left operand of assignment

All errors point to expressions like this:

((PyObject*)__pyx_v_m) = Py_None; /* __pyx_v_m is pointer to some struct /*

Actual cause of the problem is that erroneous code was generated by old version of pyrex (0.9.3) (while pyrex 0.9.4.1 gives correct code), so this error may be encountered in not-updated-for-a-long-time python modules. I've notified upstream developers via py-ode maillist, and made a patch (don't want to add pyrex dependancy) to change above mentioned code like that:

__pyx_v_m = (struct somestruct*)Py_None;

, which solves the problem and also matches pyrex 0.9.4.1 output.

>How-To-Repeat:
Build py-ode with gcc4x
>Fix:

--- py-ode.patch begins here ---
diff -ruN py-ode.orig/Makefile py-ode/Makefile
--- py-ode.orig/Makefile	Sat Feb 10 00:25:09 2007
+++ py-ode/Makefile	Sat Feb 10 00:24:29 2007
@@ -26,5 +26,10 @@
 
 post-patch:
 	@${REINPLACE_CMD} -e '/^#ODE_BASE/ s|.*|ODE_BASE="${X11BASE}"|' ${WRKSRC}/setup.py
+# gcc4x compatibility
+	@${REINPLACE_CMD} -e 's|((PyObject *\*)__pyx_v_sp) = |__pyx_v_sp = (struct __pyx_obj_3ode_SpaceBase*)|' ${WRKSRC}/ode_notrimesh.c
+	@${REINPLACE_CMD} -e 's|((PyObject *\*)__pyx_v_m) = |__pyx_v_m = (struct __pyx_obj_3ode_Mass*)|' ${WRKSRC}/ode_notrimesh.c
+	@${REINPLACE_CMD} -e 's|((PyObject *\*)__pyx_v_jg) = |__pyx_v_jg = (struct __pyx_obj_3ode_JointGroup*)|' ${WRKSRC}/ode_notrimesh.c
+	@${REINPLACE_CMD} -e 's|((PyObject *\*)__pyx_v_cont) = |__pyx_v_cont = (struct __pyx_obj_3ode_Contact*)|' ${WRKSRC}/ode_notrimesh.c
 
 .include <bsd.port.mk>
--- py-ode.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list