[Gdal-dev] building gdal for OpenZaurus

Mateusz Loskot mateusz at loskot.net
Thu Aug 24 14:14:34 EDT 2006


Yan Seiner wrote:
> Mateusz Loskot wrote:
> 
>> toolchain 3.5.4 includes gcc 2.95, am I right?
>> This compiler is first quite strict in C++ code compilation.
>>  
>>
> Actually it uses 3.3.4, but your fix works. :-)

Yes, I suppose it should work, at least to make it compilable.

Frank,

Do you mind to change all includes of C headers to C++ headers?
As shown in C++ Standard/17.4.1.2 Headers, in Table 13: C++ Headers for
C Library Facilities. I'm eager to apply these changes.
I believe it will increase portability, as it happens Yan's case.

>> Could you replace lines 175 - 182 with following:
>>
>> #include <cctype>
>> #include <cerrno>
>> #include <cfloat>
>> #include <climits>
>> #include <cmath>
>> #include <cstdlib> // this is most important!
>> #include <cstring>
>>
>> Please, try to compile it now.
>> If you will get errors about declarations not found, please add
>> using namespace std;
>> below these includes.
>>
>>  
>>
> Now I get a link failure at the very end:
> 
> | arm-linux-g++ -march=armv5te -mtune=xscale -shared -nostdlib
> /home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/lib/crti.o
> /home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/crtbeginS.o
> .libs/libgdal.la-2.o  -Wl,--rpath
> -Wl,/home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/lib
> -Wl,--rpath
> -Wl,/home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/lib
> -lpng -lz -lrt -ldl
> -L/home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4
> -L/home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/lib
> /home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/lib/libstdc++.so
> -lm -lc -lgcc_s
> /home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/crtendS.o
> /home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/lib/crtn.o 
> -march=armv5te -mtune=xscale -Wl,-soname -Wl,libgdal.so.1 -o
> .libs/libgdal.so.1.10.0
> |
> /home/local/zaurus/tmp/cross/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld:
> cannot find -lpng
> | collect2: ld returned 1 exit status
> | make[1]: *** [libgdal.la] Error 1
> 
> Is there any reason why gdal is using -nostdlib?  Or is that an artifact
> of the OZ toolchain?


I suppose GDAL tries to exclude all unused C++ stanard system libraries,
but link only with files specified to linker.
But I may be wrong.

> (cc to openzaurus - can someone from the OZ camp help me out?  How do I
> fix this?  I treid adding a LDFLAGS= to the bb file but that didn't
> help. The gdal configure doesn't recognize --with-extra-libs - but I
> shouldn't have to tell it where to find the standard crosschain libs...)

Sorry, I can't help you here.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list