Opened 15 years ago

Closed 13 years ago

#222 closed defect (fixed)

GEOS 3.0 won't link on ARM-EABI platform

Reported by: jcrepetto Owned by: geos-devel@…
Priority: major Milestone: 3.3.0
Component: Default Version: 3.1.1
Severity: Critical Keywords:
Cc:

Description

I am trying to compile geos-3.0.3 for the ARM architecture. I am using GCC 4.2.1 and GLIBC 2.5, the toolchain can be freely downloaded at http://www.codesourcery.com/gnu_toolchains/arm/portal/release313.

I have used the following commands :

./configure --host=arm-none-linux-gnueabi --prefix=/home/jcr/arm-2007q3
make

All the files are compiled, but there is a problem with linking :

/bin/sh ../libtool --tag=CXX --mode=link arm-none-linux-gnueabi-g++  -g
-O2 -DGEOS_INLINE -Wall -ansi -pedantic -Wno-long-long   -o libgeos.la
-rpath /home/jcr/arm-2007q3/lib -release 3.0.3 -no-undefined
inlines.lo algorithm/libalgorithm.la geom/libgeom.la
geomgraph/libgeomgraph.la index/libindex.la io/libio.la
noding/libnoding.la operation/liboperation.la
planargraph/libplanargraph.la precision/libprecision.la
simplify/libsimplify.la util/libutil.la
arm-none-linux-gnueabi-g++ -shared -nostdlib
/home/jcr/arm-2007q3/bin/../arm-none-linux-gnueabi/libc/usr/lib/crti.o
/home/jcr/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/crtbeginS.o
 .libs/inlines.o -Wl,--whole-archive algorithm/.libs/libalgorithm.a
geom/.libs/libgeom.a geomgraph/.libs/libgeomgraph.a
index/.libs/libindex.a io/.libs/libio.a noding/.libs/libnoding.a
operation/.libs/liboperation.a planargraph/.libs/libplanargraph.a
precision/.libs/libprecision.a simplify/.libs/libsimplify.a
util/.libs/libutil.a -Wl,--no-whole-archive
-L/home/jcr/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1
-L/home/jcr/arm-2007q3/bin/../lib/gcc
-L/home/jcr/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/lib
-L/home/jcr/arm-2007q3/bin/../arm-none-linux-gnueabi/libc/lib
-L/home/jcr/arm-2007q3/bin/../arm-none-linux-gnueabi/libc/usr/lib
-lstdc++ -lm -lc -lgcc_s
/home/jcr/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/crtendS.o
/home/jcr/arm-2007q3/bin/../arm-none-linux-gnueabi/libc/usr/lib/crtn.o
 -Wl,-soname -Wl,libgeos-3.0.3.so -o .libs/libgeos-3.0.3.so
noding/.libs/libnoding.a(MCIndexSnapRounder.o):(.data.rel.ro+0x0):
multiple definition of `vtable for
geos::noding::snapround::MCIndexSnapRounder'
.libs/inlines.o:(.data.rel.ro+0x0): first defined here
noding/.libs/libnoding.a(MCIndexSnapRounder.o): In function `.LANCHOR1':
MCIndexSnapRounder.cpp:(.rodata+0xdc): multiple definition of `typeinfo
name for geos::noding::snapround::MCIndexSnapRounder'
.libs/inlines.o:inlines.cpp:(.rodata+0x338): first defined here
noding/.libs/libnoding.a(MCIndexSnapRounder.o):(.data.rel.ro+0x18):
multiple definition of `typeinfo for
geos::noding::snapround::MCIndexSnapRounder'
.libs/inlines.o:(.data.rel.ro+0xb0): first defined here
collect2: ld returned 1 exit status 

Attachments (1)

geos-3.2.0-ARM.patch (530 bytes ) - added by wmark 14 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by pramsey, 15 years ago

Sorry, we need a patch on this that you like, we don't have ARM systems lying around to re-create it.

comment:2 by (none), 15 years ago

Milestone: 3.0.1

Milestone 3.0.1 deleted

comment:3 by jcrepetto, 15 years ago

You don't need an ARM system to recreate it. The toolchain mentioned above is a cross-compiler. You just have to install it on your PC, then use it to compile GEOS.

comment:4 by mloskot, 15 years ago

I *suppose* it's directly related to a-little-non-standard ARM EABI optimization. Here is the problem described in details, with GCC 4.2.x:

C++ PATCH: Key methods for ARM EABI

See comment 20 from Andrew Pinski for the GCC Bug 25908

I'd suggest to check if this is the same problem you're dealing with. I guess it is, and I'm afraid GEOS has nothing to do with it.

BTW, it's not been planned to be fixed for milestone 3.1.0

comment:5 by pramsey, 15 years ago

Milestone: 3.2.0

comment:6 by pramsey, 15 years ago

Milestone: 3.2.03.3.0

in reply to:  4 comment:7 by letop, 15 years ago

Version: 3.0.03.1.1

I'd suggest to check if this is the same problem you're dealing with. I guess it is, and I'm afraid GEOS has nothing to do with it.

I have the same problem (on Synology platform). I do not the problem is the same as the one you reference. It is rather a double definition in the .o files . I did not pinpoint the exact problem but commenting the line in inlines.cpp: #include <geos/noding/snapround/MCIndexSnapRounder.inl>

fixes the issue.

I have this issue in 3.1.1

in reply to:  1 comment:8 by letop, 14 years ago

Replying to pramsey:

Sorry, we need a patch on this that you like, we don't have ARM systems lying around to re-create it.

I already made a description of the fix in my post, but here is one that I had to redo on 'geos-3.2.0' to make it build:

--- inlines-3.2.0.cpp 2009-12-20 11:38:18.000000000 +0100 +++ build/geos-3.2.0/source/inlines.cpp 2009-12-20 11:43:48.000000000 +0100 @@ -59,7 +59,17 @@

#include <geos/geom/CoordinateArraySequenceFactory.inl> #include <geos/noding/SegmentString.inl> #include <geos/noding/snapround/HotPixel.inl>

-#include <geos/noding/snapround/MCIndexSnapRounder.inl> + + Include MCIndexSnapRounder.inl line commented. + Resolves double definition of geos::noding::snapround::MCIndexSnapRounder + on ARM platform. + The header inclusion does not just include, but also creates code for + MCIndexSnapRounder. + osgeo.org Ticket #222 + Fix suggested by Mario De Weerd. + Impact must be analysed on other platforms. + +#include <geos/noding/snapround/MCIndexSnapRounder.inl>

#include <geos/noding/MCIndexNoder.inl>

#endif defined CYGWIN

comment:9 by letop, 14 years ago

Same patch without WikiFormatting breaking it:

--- inlines-3.2.0.cpp   2009-12-20 11:38:18.000000000 +0100
+++ build/geos-3.2.0/source/inlines.cpp 2009-12-20 11:43:48.000000000 +0100
@@ -59,7 +59,17 @@
 #include <geos/geom/CoordinateArraySequenceFactory.inl>
 #include <geos/noding/SegmentString.inl>
 #include <geos/noding/snapround/HotPixel.inl>
-#include <geos/noding/snapround/MCIndexSnapRounder.inl>
+//
+// Include MCIndexSnapRounder.inl line commented.
+//  Resolves double definition of geos::noding::snapround::MCIndexSnapRounder
+//  on ARM platform.
+//  The header inclusion does not just include, but also creates code for
+//  MCIndexSnapRounder.
+// osgeo.org Ticket #222
+// Fix suggested by Mario De Weerd.
+// Impact must be analysed on other platforms.
+//
+//#include <geos/noding/snapround/MCIndexSnapRounder.inl>
 #include <geos/noding/MCIndexNoder.inl>

 #endif // defined __CYGWIN__

comment:10 by wmark, 14 years ago

Above patch helped me compile GEOS-3.2.0 on armv5tel-softfloat-linux-gnueabi with:

  • GCC 4.4.1, -Os -march=armv5te -pipe -combine -fomit-frame-pointer -ftree-builtin-call-dce
  • binutils 2.19.1-r1
  • glibc 2.11-r1
  • Gentoo

Thank you!

by wmark, 14 years ago

Attachment: geos-3.2.0-ARM.patch added

comment:11 by strk, 13 years ago

wmark, jcrepetto: could you try building r3368 from trunk ?

comment:12 by strk, 13 years ago

Resolution: fixed
Status: newclosed

r3372 should have fixed this. Feel free to reopen if not.

Note: See TracTickets for help on using tickets.