Ticket #222 (closed defect: fixed)

Opened 6 years ago

Last modified 3 years ago

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

geos-3.2.0-ARM.patch Download (0.5 KB) - added by wmark 5 years ago.

Change History

follow-up: ↓ 8   Changed 6 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.

  Changed 6 years ago by anonymous

  • milestone 3.0.1 deleted

Milestone 3.0.1 deleted

  Changed 6 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.

follow-up: ↓ 7   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

  Changed 6 years ago by pramsey

  • milestone set to 3.2.0

  Changed 5 years ago by pramsey

  • milestone changed from 3.2.0 to 3.3.0

in reply to: ↑ 4   Changed 5 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

in reply to: ↑ 1   Changed 5 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

  Changed 5 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__

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

  Changed 3 years ago by strk

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

  Changed 3 years ago by strk

  • status changed from new to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.