ports/90077: [PATCH] devel/ode and devel/ode-devel: unbreak on 64bit platforms
Dmitry Marakasov
amdmi3 at mail.ru
Wed Dec 7 16:20:20 UTC 2005
>Number: 90077
>Category: ports
>Synopsis: [PATCH] devel/ode and devel/ode-devel: unbreak on 64bit platforms
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Dec 07 16:20:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Dmitry Marakasov
>Release: FreeBSD 6.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Nov 23 05:48:39 MSK 2005 amdmi3 at hades.panopticon:/usr/obj/usr/src/sys/HADES i386
>Description:
devel/ode and devel/ode-devel ports are marked broken on non-i386
archs (i.e. amd64, ia64), because ode fail to build on these systems
with following errors:
c++ -Iinclude -c -fno-exceptions -fomit-frame-pointer -O -pipe -I/usr/X11R6/include
+-DdNODEBUG -o ode/src/timer.o ode/src/timer.cpp
{standard input}: Assembler messages:
{standard input}:62: Error: `(%esi)' is not a valid 64 bit base/index expression
{standard input}:63: Error: `4(%esi)' is not a valid 64 bit base/index expression
{standard input}:86: Error: `(%esi)' is not a valid 64 bit base/index expression
{standard input}:87: Error: `4(%esi)' is not a valid 64 bit base/index expression
{standard input}:172: Error: `(%esi)' is not a valid 64 bit base/index expression
{standard input}:173: Error: `4(%esi)' is not a valid 64 bit base/index expression
{standard input}:194: Error: `(%esi)' is not a valid 64 bit base/index expression
{standard input}:195: Error: `4(%esi)' is not a valid 64 bit base/index expression
{standard input}:234: Error: `(%esi)' is not a valid 64 bit base/index expression
{standard input}:235: Error: `4(%esi)' is not a valid 64 bit base/index expression
gmake: *** [ode/src/timer.o] Error 1
*** Error code 2
Stop in /usr/ports/devel/ode.
After some investigation, I think I've solved the problem, and it would
be great to unbreak ode at last.
The build on 64 bit platforms fails because some 32 bit assembly
gets included in the ode/src/timer.cpp file.
That, on it's turn, happens because ode's configurator (simple
configure analogue written in C) has too weak checking for `pentium
compatibility' of host system - it just tries to compile following
assembly code: `mov $0, %eax' as a test. That compiles well on 64
bit platforms, but because addressing scheme is now 64bit,
above-mentioned errors occur when compiling ode's source itself.
The fix is to add a patch to configurator.c that makes `pentium
compatibility' test more strict. Thus, test will fail on 64 bit
ystems and i386 assembly won't be used (ode will use more portable
routines instead).
This patch is not well tested, as I myself have no 64 bit machines
in the vicinity, but it surely doesn't break ode on x86 :)
I've mailed it to ode author, it's now also in ODE's CVS.
>How-To-Repeat:
On 64 bit machine (amd64, for example):
cd /usr/ports/devel/ode && make
>Fix:
--- ode.patch begins here ---
diff -ruN ode.orig/Makefile ode/Makefile
--- ode.orig/Makefile Wed Dec 7 19:03:26 2005
+++ ode/Makefile Wed Dec 7 19:03:44 2005
@@ -28,10 +28,6 @@
.include <bsd.port.pre.mk>
-.if ${ARCH} == "amd64"
-BROKEN= "Does not build on amd64"
-.endif
-
post-patch:
@${REINPLACE_CMD} -e \
's|malloc.h|stdlib.h|g' \
diff -ruN ode.orig/files/patch-configurator.c ode/files/patch-configurator.c
--- ode.orig/files/patch-configurator.c Thu Jan 1 03:00:00 1970
+++ ode/files/patch-configurator.c Wed Dec 7 19:03:49 2005
@@ -0,0 +1,11 @@
+--- configurator.c.orig Sat May 29 21:46:03 2004
++++ configurator.c Tue Dec 6 03:48:15 2005
+@@ -222,7 +222,7 @@
+ write_header_comment (file,"is this a pentium on a gcc-based platform?");
+ write_to_file ("ctest.cpp",
+ "int main() {\n"
+- " asm (\"mov $0,%%eax\\n cpuid\\n\" : : : \"%eax\");\n"
++ " asm (\"mov $0,%%eax\\n mov %%eax,(%%esi)\\n cpuid\\n\" : : : \"%eax\");\n"
+ " return 0;\n"
+ "}\n");
+ delete_file ("ctest.exe");
--- ode.patch ends here ---
--- ode-devel.patch begins here ---
diff -ruN ode-devel.orig/Makefile ode-devel/Makefile
--- ode-devel.orig/Makefile Wed Dec 7 19:03:36 2005
+++ ode-devel/Makefile Wed Dec 7 19:03:59 2005
@@ -28,10 +28,6 @@
.include <bsd.port.pre.mk>
-.if ${ARCH} == "amd64" || ${ARCH} == "ia64" || ${ARCH} == "sparc64"
-BROKEN= "Does not compile."
-.endif
-
post-patch:
@${REINPLACE_CMD} -e 's|malloc.h|stdlib.h|g' \
${WRKSRC}/configurator.c
diff -ruN ode-devel.orig/files/patch-configurator.c ode-devel/files/patch-configurator.c
--- ode-devel.orig/files/patch-configurator.c Thu Jan 1 03:00:00 1970
+++ ode-devel/files/patch-configurator.c Wed Dec 7 19:04:04 2005
@@ -0,0 +1,11 @@
+--- configurator.c.orig Sat May 29 21:46:03 2004
++++ configurator.c Tue Dec 6 03:48:15 2005
+@@ -222,7 +222,7 @@
+ write_header_comment (file,"is this a pentium on a gcc-based platform?");
+ write_to_file ("ctest.cpp",
+ "int main() {\n"
+- " asm (\"mov $0,%%eax\\n cpuid\\n\" : : : \"%eax\");\n"
++ " asm (\"mov $0,%%eax\\n mov %%eax,(%%esi)\\n cpuid\\n\" : : : \"%eax\");\n"
+ " return 0;\n"
+ "}\n");
+ delete_file ("ctest.exe");
--- ode-devel.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list