Bug#911233: ossim FTCBFS: multiple reasons

Helmut Grohne helmut at subdivi.de
Wed Oct 17 14:04:05 BST 2018


Source: ossim
Version: 2.5.1-1
Tags: patch
User: helmutg at debian.org
Usertags: rebootstrap

ossim fails to cross build from source for two distinct reasons.

The immediate failure is a linker error. The format of libdl.so is not
recognized. It turns out that find_library locates the build
architecture libdl.so when building on amd64. The cause is a line in
cmake/CMakeModules/OssimCommonVariables.cmake where it adds
/usr/lib/x86_64-linux-gnu to CMAKE_LIBRARY_PATH. I don't quite
understand why this is being done, but I can tell that doing so breaks
cross compilation. Adding any of these paths is either wrong or
redundant as they should be there by default already. I suggest removing
the offending line, see attached upstream.patch.

The other issue is that ossim decides to install the library to
/usr/lib64 (for 32bit architectures). Subsequently, dh_install complains
about not finding the libraries in /usr/lib. It's not entirely clear why
this happens. The relevant code resides in
cmake/CMakeModules/OssimCommonVariables.cmake again. It checks the value
of FIND_LIBRARY_USE_LIB64_PATHS. Apparently that turns out to be true
for cross building. The documentation says that it is only relevant to
64bit builds, so using it for a 32bit build as ossim does is an error.
In any case, it sets LIBSUFFIX to 64 there (again for cross builds
only). Later INSTALL_LIBRARY_DIR is set to lib${LIBSUFFIX} causing the
failure. Worse, INSTALL_LIBRARY_DIR is a path variable. More precisely,
a relative path variable. Such a thing does not exist in CMake. All
paths are absolute and if not, CMake canonicalizes them. Thus setting
-DINSTALL_LIBRARY_DIR=lib results in the build path being embedded.
That's another fault of OssimCommonVariables.cmake. It can be worked
around by forcing it to be a string variable with
-DINSTALL_LIBRARY_DIR:STRING=lib. My second patch, rules.patch,
implements this, but this approach is only a workaround for multiple
failures in OssimCommonVariables.cmake. I have no clue how to fix that.
Maybe someone with more CMake knowledge can chime in.

In any case, the combination of upstream.patch and rules.patch make
ossim cross buildable. Please do something useful with them.

Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rules.patch
Type: text/x-diff
Size: 467 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20181017/92b278cb/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upstream.patch
Type: text/x-diff
Size: 697 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20181017/92b278cb/attachment-0001.patch>


More information about the Pkg-grass-devel mailing list