<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello,</p>
<p><b>Build system, target and environment:</b><br>
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.<br>
</p>
<p>(lines prepended by $ are commands)<br>
<b>Compiler:</b><br>
After sourcing the SDK I get the following outputs:<br>
$ gcc --version //system compiler<br>
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609<br>
$ $CC --version // SDK compiler<br>
x86_64-poky-linux-gcc (GCC) 8.3.0<br>
$ $CXX --version // SDK c++ compiler<br>
x86_64-poky-linux-g++ (GCC) 8.3.0</p>
<p><b>Configure, build and error:</b><br>
I configure gdal using:<br>
$ ./configure --host=i686-pc-linux
--prefix=/home/moritz/Programmierung/gdallibs
--with-sysroot=/home/moritz/sdk/sysroots/corei7-64-poky-linux<br>
(Not really sure about the host, but seemed fairly general to me)<br>
</p>
<p>After configuration I start the build:<br>
$ make -j8</p>
<p>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 [...] :</p>
<p><font color="#ff0000">libtool: compile: x86_64-poky-linux-g++
-m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2
--sysroot=/home/moritz/</font><font color="#ff0000"><font
color="#ff0000">sdk</font>/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<br>
In file included from /home/moritz/</font><font color="#ff0000"><font
color="#ff0000">sdk</font>/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/cstdlib:75,<br>
from /home/moritz/</font><font color="#ff0000"><font
color="#ff0000">sdk</font>/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/ext/string_conversions.h:41,<br>
from /home/moritz/</font><font color="#ff0000"><font
color="#ff0000">sdk</font>/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/bits/basic_string.h:6400,<br>
from /home/moritz/</font><font color="#ff0000"><font
color="#ff0000">sdk</font>/sysroots/corei7-64-poky-linux/usr/include/c++/8.3.0/string:52,<br>
from gmlutils.h:34,<br>
from gmlutils.cpp:30:<br>
<u>/home/moritz/sdk/sysroots/corei7-64-poky-linux/usr/include/stdlib.h:133:35:
error: missing binary operator before token "("</u><u><br>
</u><u> #if __HAVE_FLOAT16 && __GLIBC_USE
(IEC_60559_TYPES_EXT)</u></font></p>
<p>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:<br>
<a class="moz-txt-link-freetext" href="https://patchwork.openembedded.org/patch/154233/">https://patchwork.openembedded.org/patch/154233/</a> (see the 3rd
answer from Mikko Rappeli)<br>
<br>
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.</p>
<p>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.</p>
<p>Any help is appreciated</p>
<p>Best regards<br>
Moritz<br>
</p>
</body>
</html>