Opened 7 years ago

Closed 4 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 6 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 follow-up: Changed 7 years ago by pramsey

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

comment:2 Changed 7 years ago by anonymous

  • Milestone 3.0.1 deleted

Milestone 3.0.1 deleted

comment:3 Changed 7 years ago by jcrepetto

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 follow-up: Changed 6 years ago by mloskot

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 Changed 6 years ago by pramsey

  • Milestone set to 3.2.0

comment:6 Changed 6 years ago by pramsey

  • Milestone changed from 3.2.0 to 3.3.0

comment:7 in reply to: ↑ 4 Changed 6 years ago by letop

  • Version changed from 3.0.0 to 3.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

comment:8 in reply to: ↑ 1 Changed 6 years ago by letop

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 Changed 6 years ago by letop

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 Changed 6 years ago by wmark

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!

Changed 6 years ago by wmark

comment:11 Changed 4 years ago by strk

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

comment:12 Changed 4 years ago by strk

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.