[gdal-dev] gcc 8.3.0 cross compile of gdal v1.11.5

Moritz Porst moritz.porst at gmx.de
Fri Oct 4 03:38:08 PDT 2019


Hello,

*Build system, target and environment:*
I am encountering an issue when attempting to cross compile gdal v
1.11.5 using an SDK generated by the yocto build system which features
gcc v 8.3. I have used the SDK before to build other libraries, thus I
do not believe the problem is with the sdk. My build machine runs an
Ubuntu 16.04 64bit. My target is an x86 intel atom machine running a
custom OS built from the yocto build system.

(lines prepended by $ are commands)
*Compiler:*
After sourcing the SDK I get the following outputs:
$ gcc --version        //system compiler
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
$ $CC --version        // SDK compiler
x86_64-poky-linux-gcc (GCC) 8.3.0
$ $CXX --version        // SDK c++ compiler
x86_64-poky-linux-g++ (GCC) 8.3.0

*Configure, build and error:*
I configure gdal using:
$ ./configure --host=i686-pc-linux
--prefix=/home/moritz/Programmierung/gdallibs
--with-sysroot=/home/moritz/sdk/sysroots/corei7-64-poky-linux
(Not really sure about the host, but seemed fairly general to me)

After configuration I start the build:
$ make -j8

The build fails (it doesn't tell me in the end though). The following
error appears (it repeats for HAVE_FLOAT_32, HAVE_FLOAT_64 [...],
HAVE_FLOAT_32X [...] :

libtool: compile:  x86_64-poky-linux-g++ -m64 -march=nehalem
-mtune=generic -mfpmath=sse -msse4.2
--sysroot=/home/moritz/sdk/sysroots/corei7-64-poky-linux -O2 -pipe -g
-feliminate-unused-debug-types -DHAVE_SSE_AT_COMPILE_TIME -Wall
-I/home/moritz/Programmierung/GDAL/gdal/port
-I/home/moritz/Programmierung/GDAL/gdal/gcore
-I/home/moritz/Programmierung/GDAL/gdal/alg
-I/home/moritz/Programmierung/GDAL/gdal/ogr
-I/home/moritz/Programmierung/GDAL/gdal/ogr/ogrsf_frmts -DOGR_ENABLED
-I/home/moritz/Programmierung/GDAL/gdal/port -c ntv2dataset.cpp  -fPIC
-DPIC -o ../o/.libs/ntv2dataset.o
In file included from
/home/moritz/sdk/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/cstdlib:75,
                  from
/home/moritz/sdk/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/ext/string_conversions.h:41,
                  from
/home/moritz/sdk/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/bits/basic_string.h:6400,
                  from
/home/moritz/sdk/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/string:52,
                  from gmlutils.h:34,
                  from gmlutils.cpp:30:
_/home/moritz/sdk/sysroots/corei7-64-poky-linux/usr/include/stdlib.h:133:35:
error: missing binary operator before token "("__
__ #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)_

The only thing I was able to find about this was the following mail
conversation, hinting at a cmake problem. However I did not recognise
any cmake in the gdal build process:
https://patchwork.openembedded.org/patch/154233/  (see the 3rd answer
from Mikko Rappeli)

I also get several -Wpoison-system-directories warnings because the
compiler is still executed with the -I/usr/include flag. As far as I can
see however the SDK include files are preferred.

I repeated above steps, only leaving out to source the SDK. This build
(then using systems gcc v 5.4.0) succeeded. Since both my build system
and my target system are x86_64 I was actually able to put the built
executable to my target system and execute them. However this is a)
dirty and b) would not work if my target was e.g. an ARM system. Thus I
would like to solve this issue and be able to compile with the proper
compiler. However since I don't know gdal I require some help here.

Any help is appreciated

Best regards
Moritz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191004/84af2227/attachment-0001.html>


More information about the gdal-dev mailing list