toolchain perl unsolved mystery (can't load a .so file )

61 views
Skip to first unread message

nono

unread,
May 14, 2013, 2:54:41 PM5/14/13
to openbric...@googlegroups.com
Hello,

since days, I search and can't find the answer, so I'm asking here if anybody has a clue how to solve this thing ...

What I've done :
- added a package "perl-DBI", that builds and installs fine (I think).
- try to add another perl package required by my experiment (and requiring the previous one saddly).

And there it explodes.

Basically, on my host linux, I did for perl-DBI :
"perl Makefile.PL
make
make install"

On the geexbox tools :
"scripts/package perl-DBI"   (ends OK)


Then :

on host :

perl -e 'require DBI;'     ------------> ends OK, no problem.




a the headache :

../toolchain/bin/perl -W -I../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2/ -e 'require "DBI.pm";'

give the error :


Can't load '../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so' for module DBI: ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so: cannot open shared object file: No such file or directory at ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//DynaLoader.pm line 190.
 at ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//DBI.pm line 117
BEGIN failed--compilation aborted at ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//DBI.pm line 117.
Compilation failed in require at -e line 1.



Of course, the file exists and is readable :
ls -l ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
-rwxr-xr-x 1 root root 85148 2013-05-14 08:43 ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so


trying ldd on the host gives nothing :


root@Ubuntu-htpc:/opt/build/geexbox/openbricks/build/build.cubox.eglibc/test-1.37# ldd ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
    not a dynamic executable
root@Ubuntu-htpc:/opt/build/geexbox/openbricks/build/build.cubox.eglibc/test-1.37# ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/bin/ldd ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
$    not a dynamic executable



However, on the cubox, it gives me (after installing package perl-DBI) :
# ldd /usr/lib/perl/5.14.2/auto/DBI/DBI.so
        libc.so.6 => /lib/libc.so.6 (0xb6dfb000)
        /lib/ld-linux-armhf.so.3 (0xb6f45000)
# ldd /lib/libc.so.6
        /lib/ld-linux-armhf.so.3 (0xb6eaa000)
# ldd /lib/ld-linux-armhf.so.3
        statically linked
#



Has ANYONE ANY idea how to have this simple "require DBI;" to compile please ? (that is to say, have perl read the readable .so file)

I join the perl-DBI package files if you want to try on your dev environment .  (I have not yet commited since it is useless for now :/)
perl-DBI.tgz

nono

unread,
May 14, 2013, 2:57:25 PM5/14/13
to openbric...@googlegroups.com
small precision :

on the cubox the same works :
# perl -e 'require DBI;'
#


and this "require" is required in the next package I need to build in the Makefile.PL , perl-DBD, which is the real thing I want

nono

unread,
May 14, 2013, 4:45:08 PM5/14/13
to openbric...@googlegroups.com
correction, it is perl-DBD-sqlite, which is the real thing I want.

and the parts of it's Makefile.PL that cause problem ( I guess it's because it tries to load an ARM library on a x86 platform ?) :

# Because DBI generates a postamble at configure-time, we need
# the required version of DBI very early.
my $DBI_required = 1.57;
eval {
	require DBI;
};
if ( $@ or DBI->VERSION < $DBI_required ) {
	print "DBI 1.57 is required to configure this module; please install it or upgrade your CPAN/CPANPLUS shell.\n";
	exit(0);


.
.
.

sub postamble { require DBI; require DBI::DBD; my $postamble = eval { DBI::DBD::dbd_postamble(@_) };


Thomas Genty

unread,
May 15, 2013, 2:37:57 AM5/15/13
to openbric...@googlegroups.com
Le 14/05/2013 20:54, nono a �crit :
> Hello,
Hello
>
> since days, I search and can't find the answer, so I'm asking here if
> anybody has a clue how to solve this thing ...
>
> What I've done :
> - added a package "perl-DBI", that builds and installs fine (I think).
> - try to add another perl package required by my experiment (and
> requiring the previous one saddly).
>
> And there it explodes.
>
> Basically, on my host linux, I did for perl-DBI :
> "perl Makefile.PL
> make
> make install"
>
> On the geexbox tools :
> "scripts/package perl-DBI" (ends OK)
>
>
> Then :
>
> on host :
>
on target ?
> perl -e 'require DBI;' ------------> ends OK, no problem.
>
>
>
>
> a the headache :
>
> ../toolchain/bin/perl -W
> -I../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2/
> -e 'require "DBI.pm";'
>
> give the error :
>
>
> Can't load
> '../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so'
> for module DBI:
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so:
> cannot open shared object file: No such file or directory at
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//DynaLoader.pm
> line 190.
> at
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//DBI.pm
> line 117
> BEGIN failed--compilation aborted at
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//DBI.pm
> line 117.
> Compilation failed in require at -e line 1.
>
because you try to load a lib not built for your native arch ....
>
>
> Of course, the file exists and is readable :
> ls -l
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
> -rwxr-xr-x 1 root root 85148 2013-05-14 08:43
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
>
>
> trying ldd on the host gives nothing :
>
>
> root@Ubuntu-htpc:/opt/build/geexbox/openbricks/build/build.cubox.eglibc/test-1.37#
> ldd
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
> not a dynamic executable
normal
> root@Ubuntu-htpc:/opt/build/geexbox/openbricks/build/build.cubox.eglibc/test-1.37#
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/bin/ldd
> ../toolchain/armv7-openbricks-linux-gnueabihf/sysroot/usr/local/lib/perl/5.14.2//auto/DBI/DBI.so
> $ not a dynamic executable
>
>
>
> However, on the cubox, it gives me (after installing package perl-DBI) :
> # ldd /usr/lib/perl/5.14.2/auto/DBI/DBI.so
> libc.so.6 => /lib/libc.so.6 (0xb6dfb000)
> /lib/ld-linux-armhf.so.3 (0xb6f45000)
> # ldd /lib/libc.so.6
> /lib/ld-linux-armhf.so.3 (0xb6eaa000)
> # ldd /lib/ld-linux-armhf.so.3
> statically linked
> #
>
and I'm pretty sure it works on cubox ;-)
>
>
> Has ANYONE ANY idea how to have this simple "require DBI;" to compile
> please ? (that is to say, have perl read the readable .so file)
>
yes

look at the attached archive (I have added perl-DBD-SQLite too , and it
builds fine here)
you need a host-perl-DBI package


Please test, and if it works as expected submit a patch

Regards

Tom
> I join the perl-DBI package files if you want to try on your dev
> environment . (I have not yet commited since it is useless for now :/)
> --
> You received this message because you are subscribed to the Google
> Groups "OpenBricks Development List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to openbricks-dev...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

test-packages.tar.xz

nono

unread,
May 15, 2013, 2:27:08 PM5/15/13
to openbric...@googlegroups.com, toml...@openbricks.org

> Hello,
Hello
Hello
on target ?
> perl -e 'require DBI;'     ------------> ends OK, no problem.
>

Yess, typo ^^
 
> Compilation failed in require at -e line 1.
>
because you try to load a lib not built for your native arch ....

Figured that in the sleep, however had'nt a clue how to solve it (need some infos of how do all those root / toolchain / rootfs ... etc directories work ... )

and I'm pretty sure it works on cubox ;-)
>
yes indeed
 
>
> Has ANYONE ANY idea how to have this simple "require DBI;" to compile
> please ? (that is to say, have perl read the readable .so file)
>
yes

look at the attached archive (I have added perl-DBD-SQLite too , and it
builds fine here)
you need a host-perl-DBI package


Please test, and if it works as expected submit a patch

Regards

Tom


You are absolutely right (again ^^), it works like a charm with your additions and hacks .

I have Submitted the patchs and attached the diffs to add the packages, among some others that i added to try to make work logitech media server (squeezebox)  (just to have deezer on the HIFI .... don't know if it will work lol)


host-perl-DBI.diff
perl-yaml-XS.diff
perl-DBD-SQLite.diff
perl-DBI.diff
perl-Digest-SHA1.diff
perl-EV.diff
perl-JSON-XS.diff
perl-audio-scan.diff
perl-image-scale.diff
perl-sub-name.diff

nono

unread,
May 15, 2013, 2:40:23 PM5/15/13
to openbric...@googlegroups.com, toml...@openbricks.org
HAHA, and another patch, to have the package on the cubox (damn!) and prevent a "need host-perl-DBI" ...
perl-DBD-SQlite_meta_patch.diff

Thomas Genty

unread,
May 15, 2013, 2:45:14 PM5/15/13
to openbric...@googlegroups.com
Le 15/05/2013 20:40, nono a écrit :
HAHA, and another patch, to have the package on the cubox (damn!) and prevent a "need host-perl-DBI" ...
before I push your patches, did you test PKG_DEPENDS,?
all your meta files have perl-test-simple as dependency...

Regards,

Tom

nono

unread,
May 15, 2013, 6:21:38 PM5/15/13
to openbric...@googlegroups.com
Humm sorry I'm not sure of that :

That depend was found in another Perl package I copied on, i thought it was some sort of generic package used to test others ... but since all the opkg installed successfully on cubox I thought it was OK ...

I'll correct it tomorrow

nono

unread,
May 16, 2013, 5:01:43 PM5/16/13
to openbric...@googlegroups.com
So, the last diffs (creating the new packages) are here
perl-packages.tar

Thomas Genty

unread,
May 17, 2013, 1:21:07 AM5/17/13
to openbric...@googlegroups.com
Le 16/05/2013 23:01, nono a écrit :
So, the last diffs (creating the new packages) are here
Pushed

Thanks

Tom

Le jeudi 16 mai 2013 00:21:38 UTC+2, nono a écrit :
Humm sorry I'm not sure of that :

That depend was found in another Perl package I copied on, i thought it was some sort of generic package used to test others ... but since all the opkg installed successfully on cubox I thought it was OK ...

I'll correct it tomorrow

--
Reply all
Reply to author
Forward
0 new messages