Opened 5 years ago

Closed 16 months ago

#993 closed defect (fixed)

Build failure for 3.8.0rc2 on 32 bit raspberry pi. Multiple def of BasicSegmentString

Reported by: bowguy Owned by: strk
Priority: blocker Milestone: 3.8.2
Component: Build/Install Version: 3.8.0
Severity: Unassigned Keywords:
Cc:

Description

Error: make[3]: Entering directory '/home/pi/geos-3.8.0rc2/src' /bin/bash ../libtool --tag=CXX --mode=link g++ -DGEOS_INLINE -Wsuggest-override -pedantic -Wall -Wno-long-long -ffloat-store -DUSE_UNSTABLE_GEOS_CPP_API -g -O2 -release 3.8.0 -no-undefined -o libgeos.la -rpath /usr/local/lib inlines.lo algorithm/libalgorithm.la geom/libgeom.la geomgraph/libgeomgraph.la index/libindex.la io/libio.la linearref/liblinearref.la noding/libnoding.la operation/liboperation.la planargraph/libplanargraph.la precision/libprecision.la simplify/libsimplify.la triangulate/libtriangulate.la util/libutil.la libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crti.o /usr/lib/gcc/arm-linux-gnueabihf/8/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 linearref/.libs/liblinearref.a noding/.libs/libnoding.a operation/.libs/liboperation.a planargraph/.libs/libplanargraph.a precision/.libs/libprecision.a simplify/.libs/libsimplify.a triangulate/.libs/libtriangulate.a util/.libs/libutil.a -Wl,--no-whole-archive -L/usr/lib/gcc/arm-linux-gnueabihf/8 -L/usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/8/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/arm-linux-gnueabihf/8/crtendS.o /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crtn.o -O2 -Wl,-soname -Wl,libgeos-3.8.0.so -o .libs/libgeos-3.8.0.so /usr/bin/ld: noding/.libs/libnoding.a(BasicSegmentString.o):(.rodata+0x0): multiple definition of `typeinfo name for geos::noding::BasicSegmentString'; .libs/inlines.o:(.rodata+0x6f0): first defined here /usr/bin/ld: noding/.libs/libnoding.a(BasicSegmentString.o):(.data.rel.ro+0x0): multiple definition of `typeinfo for geos::noding::BasicSegmentString'; .libs/inlines.o:(.data.rel.ro+0x2c): first defined here /usr/bin/ld: noding/.libs/libnoding.a(BasicSegmentString.o):(.data.rel.ro+0xc): multiple definition of `vtable for geos::noding::BasicSegmentString'; .libs/inlines.o:(.data.rel.ro+0xdc): first defined here collect2: error: ld returned 1 exit status make[3]: * [Makefile:541: libgeos.la] Error 1 make[3]: Leaving directory '/home/pi/geos-3.8.0rc2/src' make[2]: * [Makefile:585: install-recursive] Error 1 make[2]: Leaving directory '/home/pi/geos-3.8.0rc2/src' make[1]: * [Makefile:469: install-recursive] Error 1 make[1]: Leaving directory '/home/pi/geos-3.8.0rc2' make: * [Makefile:760: install] Error 2

Change History (13)

comment:1 by bowguy, 5 years ago

Grabbed the latest got and tried it with CMake. Same error.

/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.rodata+0x0): multiple definition of `typeinfo name for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.rodata+0x9c): first defined here /usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0x2c): first defined here /usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0xc): multiple definition of `vtable for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0xdc): first defined here collect2: error: ld returned 1 exit status make[2]: * [CMakeFiles/geos.dir/build.make:4569: lib/libgeos.so.3.9.0] Error 1 make[1]: * [CMakeFiles/Makefile2:585: CMakeFiles/geos.dir/all] Error 2 make: * [Makefile:163: all] Error 2

comment:2 by bowguy, 5 years ago

Grabbed the latest git and tried it with CMake. Same error.

/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.rodata+0x0): multiple definition of `typeinfo name for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.rodata+0x9c): first defined here /usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0x2c): first defined here /usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0xc): multiple definition of `vtable for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0xdc): first defined here collect2: error: ld returned 1 exit status make[2]: * [CMakeFiles/geos.dir/build.make:4569: lib/libgeos.so.3.9.0] Error 1 make[1]: * [CMakeFiles/Makefile2:585: CMakeFiles/geos.dir/all] Error 2 make: * [Makefile:163: all] Error 2

comment:3 by robe, 5 years ago

This is similar to issue I have when building with cmake under mingw64

(.text$_ZNK4geos6noding18BasicSegmentString13getCoordinateEy[_ZNK4geos6noding18BasicSegmentString13getCoordinateEy]+0x0): first defined here
CMakeFiles/geos.dir/objects.a(inlines.cpp.obj):inlines.cpp:(.text+0x40): multiple definition of `geos::noding::BasicSegmentString::getCoordinates() const'
CMakeFiles/geos.dir/objects.a(EdgeNodingValidator.cpp.obj):EdgeNodingValidator.cpp:(.text$_ZNK4geos6noding18BasicSegmentString14getCoordinatesEv[_ZNK4geos6noding18BasicSegmentString14getCoordinatesEv]+0x0): first defined here

unless I have inlining turned off with:

-DDISABLE_GEOS_INLINE=ON

comment:4 by bowguy, 5 years ago

Adding -DDISABLE_GEOS_INLINE=ON works for me as well

comment:5 by robe, 5 years ago

Milestone: 3.8.1

moving this to blocker since now someone normal has the issue as well so no longer a "Regina is a weird outlier" issue. Thanks Bruce :)

comment:6 by robe, 5 years ago

Version: master3.8.0

comment:7 by pramsey, 5 years ago

Unlikely to be fixed by someone else unless they can reproduce. Unlikely to be reproduced without information about environment. g++ version. cmake version. Build platform.

comment:8 by robe, 5 years ago

Okay for mingw it's both the 64-bit run and 32-bit that have the issue. Both are gcc 8.1.0 (though I think it happens on gcc 4.8.0 and 4.8.1 as well which I am retiring)

CMAKE 3.14.4, gcc 8.1.0 - autotools works CMAke doesn't with inlining

-- GEOS: Build type: Release
-- GEOS: Run-time output: E:/jenkins/geos/tags/build64cmake/bin
-- GEOS: Archives output: E:/jenkins/geos/tags/build64cmake/lib
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/ming64gcc81/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/ming64gcc81/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/ming64gcc81/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/ming64gcc81/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- GEOS: Version 3.8.0
-- GEOS: C API Version 1.13.1
-- GEOS: JTS port 1.13.0
-- GEOS: Require C++11
-- GEOS: Developer mode enabled
-- GEOS: Configured 'dist' target
-- GEOS: Configured 'distcheck' target
-- Configuring done

As for berrie - she's a 32-bit Rasberry Pi running

armv7l-unknown-linux-gnueabihf, compiled by gcc (Raspbian 8.3.0-6+rpi1) 8.3.0

cmake version 3.13.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Bruce is on vacation for about 3 weeks, but said we can use berrie for GEOS testing as well when he gets back. He needs to do some hardware changes on her.

Last edited 5 years ago by robe (previous) (diff)

comment:9 by pramsey, 5 years ago

Maybe jimmie with the MinGW detection in inlines.cpp. Seems a little janky, frankly, there must be a nicer way to do inlines cross platform than all this nonsense.

comment:10 by robe, 5 years ago

At Dan's suggestion I disabled all those and ended up with different errors about missing defines.

I thought maybe it was a specific include in there that might be causing the issue. Weird it works fine under autotools for me though.

comment:11 by bowguy, 5 years ago

Just poking around but I found this. If inline is disabled I think the file include/geos/noding/BasicSegmentString.h is used. If inline is enabled I think the file include/geos/noding/BasicSegmentString.inl is used instead. However include/geos/noding/BasicSegmentString.inl also calls BasicSegmentString.h on line 24. Do we call them both or should it be one or the other. I haven't had a chance to test this yet.

comment:12 by pramsey, 4 years ago

Milestone: 3.8.13.8.2

comment:13 by dbaston, 16 months ago

Resolution: fixed
Status: newclosed

AFAIK this has been resolved by the removal of GEOS_INLINE, please reopen if this is not the case.

Note: See TracTickets for help on using tickets.