Opened 12 years ago

Closed 12 years ago

#534 closed defect (fixed)

Cross compile trunk for android

Reported by: mbernasocchi Owned by: strk
Priority: major Milestone: 3.3.4
Component: Default Version: main
Severity: Significant Keywords: android
Cc:

Description

Basically PGAC_TYPE_64BIT_INT([int64_t]) fails to work on configure.ac line 220 PGAC_TYPE_64BIT_INT is implemented in acsite.m4

when cross compiling using the android NDK r6b (4.4.3) and make check fails.

Attachments (2)

config.log (56.6 KB ) - added by mbernasocchi 12 years ago.
int64_crosscomp.patch (1.8 KB ) - added by strk 12 years ago.

Download all attachments as: .zip

Change History (11)

by mbernasocchi, 12 years ago

Attachment: config.log added

comment:1 by strk, 12 years ago

And this is the warning got at ./configure time everytime the PGAC_TYPE_64BIT_INT macro is invoked:

WARNING: 64bit arithmetic disabled when cross-compiling

It seems to be the key here, as Marco found int64_t works fine when used in ClassSizes.cpp (it is 8 bytes)

comment:2 by mbernasocchi, 12 years ago

and this is the last part of the make check:

/bin/bash ../../libtool --tag=CXX --mode=compile arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I. -I../../../src/geom -I../../include -I../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -DANDROID=ON -Wno-psabi -O2 -mthumb -std=gnu++0x -MT LineSegment.lo -MD -MP -MF .deps/LineSegment.Tpo -c -o LineSegment.lo ../../../src/geom/LineSegment.cpp libtool: compile: arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I. -I../../../src/geom -I../../include -I../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -DANDROID=ON -Wno-psabi -O2 -mthumb -std=gnu++0x -MT LineSegment.lo -MD -MP -MF .deps/LineSegment.Tpo -c ../../../src/geom/LineSegment.cpp -fPIC -DPIC -o .libs/LineSegment.o In file included from ../../../include/geos/geom/Coordinate.h:19,

from ../../../include/geos/geom/LineSegment.h:25, from ../../../src/geom/LineSegment.cpp:21:

../../include/geos/platform.h:71:5: warning: #warning is a GCC extension ../../include/geos/platform.h:71:5: warning: #warning "Could not find 64bit integer definition!" In file included from ../../../include/geos/geom/Coordinate.h:160,

from ../../../include/geos/geom/LineSegment.h:25, from ../../../src/geom/LineSegment.cpp:21:

../../../include/geos/geom/Coordinate.inl: In static member function 'static int geos::geom::Coordinate::hashCode(double)': ../../../include/geos/geom/Coordinate.inl:108: warning: right shift count >= width of type In file included from ../../../src/geom/LineSegment.cpp:25: ../../../include/geos/geom/GeometryFactory.h: At global scope: ../../../include/geos/geom/GeometryFactory.h:209: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../include/geos/geom/GeometryFactory.h:209: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../include/geos/geom/GeometryFactory.h:258: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../include/geos/geom/GeometryFactory.h:258: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../include/geos/geom/GeometryFactory.h:306: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) libtool: compile: arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I. -I../../../src/geom -I../../include -I../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -DANDROID=ON -Wno-psabi -O2 -mthumb -std=gnu++0x -MT LineSegment.lo -MD -MP -MF .deps/LineSegment.Tpo -c ../../../src/geom/LineSegment.cpp -o LineSegment.o >/dev/null 2>&1 mv -f .deps/LineSegment.Tpo .deps/LineSegment.Plo /bin/bash ../../libtool --tag=CXX --mode=compile arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I. -I../../../src/geom -I../../include -I../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -DANDROID=ON -Wno-psabi -O2 -mthumb -std=gnu++0x -MT LineString.lo -MD -MP -MF .deps/LineString.Tpo -c -o LineString.lo ../../../src/geom/LineString.cpp libtool: compile: arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I. -I../../../src/geom -I../../include -I../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -DANDROID=ON -Wno-psabi -O2 -mthumb -std=gnu++0x -MT LineString.lo -MD -MP -MF .deps/LineString.Tpo -c ../../../src/geom/LineString.cpp -fPIC -DPIC -o .libs/LineString.o In file included from ../../../include/geos/geom/Coordinate.h:19,

from ../../../src/geom/LineString.cpp:23:

../../include/geos/platform.h:71:5: warning: #warning is a GCC extension ../../include/geos/platform.h:71:5: warning: #warning "Could not find 64bit integer definition!" In file included from ../../../include/geos/geom/Coordinate.h:160,

from ../../../src/geom/LineString.cpp:23:

../../../include/geos/geom/Coordinate.inl: In static member function 'static int geos::geom::Coordinate::hashCode(double)': ../../../include/geos/geom/Coordinate.inl:108: warning: right shift count >= width of type In file included from ../../../src/geom/LineString.cpp:31: ../../../include/geos/geom/GeometryFactory.h: At global scope: ../../../include/geos/geom/GeometryFactory.h:209: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../include/geos/geom/GeometryFactory.h:258: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../include/geos/geom/GeometryFactory.h:306: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) In file included from ../../../src/geom/LineString.cpp:33: ../../../include/geos/geom/Point.h:167: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../src/geom/LineString.cpp:96: warning: 'auto_ptr' is deprecated (declared at /home/marco/dev/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/backward/auto_ptr.h:86) ../../../src/geom/LineString.cpp: In member function 'virtual std::auto_ptr<geos::geom::Envelope> geos::geom::LineString::computeEnvelopeInternal() const': ../../../src/geom/LineString.cpp:250: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. make[3]: * [LineString.lo] Error 1 make[3]: Leaving directory `/home/marco/dev/qgis-android/src/geos-svn/build-armeabi/src/geom' make[2]: * [check-recursive] Error 1 make[2]: Leaving directory `/home/marco/dev/qgis-android/src/geos-svn/build-armeabi/src/geom' make[1]: * [check-recursive] Error 1 make[1]: Leaving directory `/home/marco/dev/qgis-android/src/geos-svn/build-armeabi/src' make: * [check-recursive] Error 1

comment:3 by mbernasocchi, 12 years ago

adding CXXFLAGS=-DHAVE_LONG_LONG_INT_64 makes the #warning "Could not find 64bit integer definition!" go away and build goes further until:

libtool: compile: arm-linux-androideabi-g++ -DHAVE_CONFIG_H -I. -I../../../src/geom -I../../include -I../../include/geos -I../../../include -DGEOS_INLINE -pedantic -Wall -ansi -Wno-long-long -ffloat-store -DANDROID=ON -Wno-psabi -O2 -mthumb -std=gnu++0x -DHAVE_LONG_LONG_INT_64 -MT MultiPoint.lo -MD -MP -MF .deps/MultiPoint.Tpo -c ../../../src/geom/MultiPoint.cpp -fPIC -DPIC -o .libs/MultiPoint.o ../../../src/geom/LineString.cpp: In member function 'std::auto_ptr<geos::geom::Envelope> geos::geom::LineString::_ZTv0_n252_NK4geos4geom10LineString23computeEnvelopeInternalEv() const': ../../../src/geom/LineString.cpp:425: internal compiler error: in cgraph_mark_reachable_node, at cgraph.c:1105

comment:4 by mbernasocchi, 12 years ago

as well please note that with the same script and flags 3.2.2 (patched against bug # 222) compiles succesfully

comment:5 by strk, 12 years ago

I see the cross-compiling error is part of the macro (which is taken from postgresql, btw):

AC_TRY_RUN(
...
dnl We will do better here with Autoconf 2.50
AC_MSG_WARN([64 bit arithmetic disabled when cross-compiling])])])

Are you saying you didn't get that message with 3.2.2 ?

by strk, 12 years ago

Attachment: int64_crosscomp.patch added

comment:6 by strk, 12 years ago

Owner: changed from geos-devel@… to strk
Status: newassigned

Please try the above patch (patch -p1)

comment:7 by mbernasocchi, 12 years ago

I'm saying that with 3.2.2 I get the int64 warnings during configure and build but building completes. with trunk it doesnt. Passing CXXFLAGS=-DHAVE_LONG_LONG_INT_64 makes the #warning "Could not find 64bit integer definition!" go away during build.

trying the patch now

comment:8 by strk, 12 years ago

The patch was committed as r3618 in trunk and r3617 in 3.3 branch

comment:9 by mbernasocchi, 12 years ago

Resolution: fixed
Status: assignedclosed

confirmed working in both trunk and 3.3: configure:17228: checking whether long long int is 64 bits configure:17249: arm-linux-androideabi-gcc -c -DANDROID=ON -Wno-psabi -O2 -mthumb conftest.c >&5 configure:17249: $? = 0 configure:17295: result: yes

Note: See TracTickets for help on using tickets.