[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sbuild crosscompiler not searching /usr/include/arm-linux-gnueabihf



On Wed, Sep 16, 2015 at 11:10 PM, Johannes Schauer wrote
On Thu, Sep 17, 2015 at 1:05 AM, Wookey wrote

Thanks you both for the insightful replies!


Anyway I've got it working now (package mosquitto crosscompiled to armhf)!


On Thu, Sep 17, 2015 at 1:05 AM, Wookey wrote
> However as you've already found this fails to search /usr/include/arm-linux-gnueabihf for openssl/opensslconf.h
>

The FIX for this is:

Change ~/.sbuildrc to have:

$build_environment = {
                       'CC' => 'arm-linux-gnueabihf-gcc',
                       'CXX' => 'arm-linux-gnueabihf-g++'
};


> But I now get an error at the end:
>
>
> make[1]: Leaving directory '/«PKGBUILDDIR»'
>    dh_makeshlibs -a
>    dh_shlibdeps -a
> dpkg-shlibdeps: error: couldn't find library libstdc++.so.6 needed by
> debian/libmosquittopp1/usr/lib/arm-linux-gnueabihf/libmosquittopp.so.1
> (ELF format: 'elf32-littlearm'; RPATH: '')
> dpkg-shlibdeps: error: cannot continue due to the error above
> Note: libraries are not searched in other binary packages that do not
> have any shlibs or symbols file.
> To help dpkg-shlibdeps find private libraries, you might need to use -l.
> dh_shlibdeps: dpkg-shlibdeps -Tdebian/libmosquittopp1.substvars
> debian/libmosquittopp1/usr/lib/arm-linux-gnueabihf/libmosquittopp.so.1
> returned exit code 2
> make: *** [binary-arch] Error 2
> debian/rules:9: recipe for target 'binary-arch' failed
> dpkg-buildpackage: error: fakeroot debian/rules binary-arch gave error
> exit status 2
>

The (hacky) fix for this is:

Add the following to
mosquitto-1.4.3/debian/rules

override_dh_shlibdeps:
        LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$(LD_LIBRARY_PATH)
dh_shlibdeps


Doing this (and the qemu I mentioned before) I manage to get success!




Regarding mosquitto-1.4.3/debian/rules mentioned above:

It's hacky, because I hardcode /usr/arm-linux-gnueabihf/lib into
LD_LIBRARY_PATH.
Any way for scripting this? My other attemps at getting this working
all failed. My attempts were...


Unfortunately adding the following to ~/.sbuildrc does NOT work

$ld_library_path = '/usr/arm-linux-gnueabihf/lib:/usr/lib';  # !!!
$build_environment = {
                      'CC' => 'arm-linux-gnueabihf-gcc',
                      'CXX' => 'arm-linux-gnueabihf-g++'
                      'LD_LIBRARY_PATH' =>
'/usr/arm-linux-gnueabihf/lib'   # !!!!
};
$environment_filter = [
    '^PATH$',
    '^DEB(IAN|SIGN)?_[A-Z_]+$',
    '^(C(PP|XX)?|LD|F)FLAGS(_APPEND)?$',
    '^USER(NAME)?$',
    '^LOGNAME$',
    '^HOME$',
    '^TERM$',
    '^SHELL$',
    '^LD_LIBRARY_PATH$'   # !!!
    ];

If I now run sbuild  --host=armhf -d stretch-amd64-sbuild

I see the log output...
   LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:/usr/lib/x86_64-linux-gnu/libfakeroot:/usr/lib64/libfakeroot:/usr/lib32/libfakeroot
dh_shlibdeps

....which when compared to ...

override_dh_shlibdeps:
   LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib:$(LD_LIBRARY_PATH) dh_shlibdeps

...shows that I get the /usr/arm-linux-gnueabihf/lib (hardcoded into
debian/rules) and that the

 $(LD_LIBRARY_PATH)
...is /usr/lib/x86_64-linux-gnu/libfakeroot:/usr/lib64/libfakeroot:/usr/lib32/libfakeroot


So all the LD_LIBRARY_PATH stuff in ~/.sbuildrc was useless.
Currently only the hardcoded hack in debian/rules works.



On Wed, Sep 16, 2015 at 11:10 PM, Johannes Schauer wrote:
> sbuild has a number of problems wrt cross building in stretch and unstable. I
> fixed many of these issues in an NMU to experimental and you are welcome to try
> that. It doesn't look as if your problems are related to the fixed sbuild
> problems though. The fixes will probably enter unstable with the next sbuild
> upload.

I have not yet checked that. (Any link to get to that?)

Would be good if there is a possibility of getting the LD_LIBRARY_PATH
stuff in ~/.sbuildrc to override_dh_shlibdeps dh_shlibdeps

Regards,
n.


Reply to: