Jussi, Unfortunately, just copying the binary and the libs it requires under /host_usr didn't work. When I tried to run it inside Scratchbox, the default dynamic loader in /scratchbox/host_shared/lib was used to load the libs, and that produced a bunch of libc version incompatibility errors.
The only way I could make my binary to run inside Scratchbox was to copy the host dynamic loader (from /lib outside Scratchbox) under /host_usr, and make a couple of minor changes in sb_alien.c and libsb.c so that it would be used instead of default loader when my binary is run. I was a bit surprised to find the default loader (/scratchbox/host_shared/lib/ld.so) hardcoded in sb_alien and libsb and no way for the user to configure it. Wouldn't you say it makes sense to provide the user with a means to control which loader should be used, exactly for the purpose of running alien tools inside Scratchbox? Best regards, Mikhail -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jussi Hakala Sent: Wednesday, October 15, 2008 4:48 PM To: scratchbox-users@lists.scratchbox.org Subject: Re: [Scratchbox-users] Running dynamic executable under Scratchbox Or you can try to copy the binary (and additional libraries it needs) under /host_usr/, in most of the cases, that works too. Or, you can use a statically linked binary... Regards, Jussi Diane Holt wrote: > You can run statically linked executables inside Scratchbox that were > built outside of Scratchbox, but to run a dynamically linked executable > inside Scratchbox, you need to build it inside Scratchbox. > > Diane > > On Tue, Oct 14, 2008 at 6:22 AM, Velikanov, Mikhail > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: > > Hi all, > > > > I'm trying to run a dynamically linked executable under Scratchbox > and getting nowhere with that. The executable is compiled outside of > Scratchbox environment and runs there without any problem. However, > when I copy it into my Scratchbox user area under > /scratchbox/users/$USER/home/$USER/, then login to Scratchbox and > try to run it, I get two different errors, depending on how I invoke > my executable. > > > > Specifically, if I use either relative path or what passes for > absolute path in the Scratchbox world (i.e., starting with > /home/$USER/), I get a "No such file or directory" error from bash. > Interestingly, if I define SBOX_REDIRECT_LOG, I can see in the log > file that Scratchbox picks up the executable and determines (quite > correctly) its type as dynamic, which makes me wonder how on earth > bash would not see it if Scratchbox does. > > > > Alternatively, if I use a fully resolved path (i.e., starting with > /scratchbox/users/$USER/) when invoking my executable, I get the > following error from dynamic linker: > > > > error while loading shared libraries: libstdc++.so.6: cannot open > shared object file: No such file or directory > > > > Obviously, libstdc++ is one of the DSOs this executable needs in > order to run. Inside Scratchbox environment it's located in > /usr/lib/ which is included in LD_LIBRARY_PATH, so again it is a bit > strange why linker could not find it. > > > > Can anyone please tell me what causes these errors and what can I do > to make my executable run under Scratchbox? > > > > I'm using Scratchbox 1.0.11 configured with the following target: > > > > Compiler: cs2007q3-glibc2.5-arm6 > > Devkits: cputransp > > CPU-transparency: /scratchbox/devkits/cputransp/bin/qemu-arm-eabi-sb2 > > > > Thanks in advance! > > > > Mikhail > > > > > > > > > _______________________________________________ > Scratchbox-users mailing list > Scratchbox-users@lists.scratchbox.org > <mailto:Scratchbox-users@lists.scratchbox.org> > http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Scratchbox-users mailing list > Scratchbox-users@lists.scratchbox.org > http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users _______________________________________________ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users _______________________________________________ Scratchbox-users mailing list Scratchbox-users@lists.scratchbox.org http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users