[Gdal-dev] GNU make build system update
Alessandro Amici
alexamici at tiscali.it
Wed Sep 10 18:03:05 EDT 2003
Frank,
> after having spent a fair bit of time on the binutils man pages and having
> tried various combinations of tricks, i found out that the following rule
> builds static _and_ shared libraies on my mingw cross-compile environment:
>
> $(LIBGDAL): $(GDAL_OBJ:.o=.lo)
> $(LD) -o $@ $^ \
> -rpath $(INST_LIB) \
> -no-undefined \
> -version-info $(LIBGDAL_CURRENT):$(LIBGDAL_REVISION):$(LIBGDAL_AGE)
>
> we need the -no-undefined option _and_ to remove $(LIBS).
> i need a bit more time in order to check for the correct way to implement
> the configure changes, thou.
>
> unfortunately, however, this is not the end of the story :(.
> trying that on a live mingw environment the build exploded on an unexpected
> 'ld -r' with the same problem we had a few weeks ago.
>
> after some more digging into the configure scripts this second problem
> appears to be related to the 8k limit on the command size lenght on
> windows! our command line is about 11k in size (!) and libtool trys to
> build the shareded library picewise with the help of a few 'ld -r' before
> the big 'g++ -shared'.
i have no idea if the attached patch has any meaning at all from the point of
view of the behaviour of the vrt class hierarchy, but... it fix part of the
'ld -r' build failure on my mingw cross compile!
the problem with partial linking (on win32) appears to be related to the
missing definition and maybe prototypes of class constructors and
destructors.
with the attached patch i can partial-link successfully most of the gdal
objects together:
$ i586-mingw32msvc-ld -r port/*.o alg/*.o gcore/*.o frmts/o/*.o -o foo.o
$
Frank, could you please verify whether you need to define (meaningfull!)
constructors and destructors for the two classes that appear in the patch?
note that fixing the ogr directory will be significantly harder, thou.
$ i586-mingw32msvc-ld -r ogr/*.o ogr/ogrsf_frmts/o/*.o -o foo.o 2>&1 | wc
38 418 5632
that is 19 classes with missing construtor/destructor.
i'm no c++ expert so i can hardly help more that that :(, however if this is
really the way to solve the wierd 'ld -r' problems the libtool build will
soon became much more attractive :).
cheers,
alessandro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld-r_fix.diff
Type: text/x-diff
Size: 1893 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20030911/0a459c82/ld-r_fix.bin
More information about the Gdal-dev
mailing list