Start of topic | Skip to actions
scratchbox Tips & TricksSee alsoForeign toolchains: Helper scriptssb-toolchains-extra is in the process of changing to define runtime c filesUse tag sb-toolchain-extras_1.0.8 until the changes are complete. darcs get --set-scripts-executable --tag sb-toolchain-extras_1.0.8 http://scratchbox.org/repos/1.0/sb-toolchain-extras OR update scratchbox Problems may occur if you get a new sb-toolchain-extras into an old scratchbox which does not provide the necessary support. sbrshd
Inconsistency detected by ld.so: rtld.c: 1192: dl_main: Assertion ‘(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso’ failed!Disable “vdso”:Outside scratchbox: sudo -i echo 0 > /proc/sys/vm/vdso_enabled mmap: Permission deniedOutside scratchboxsudo -i echo 4096 > /proc/sys/vm/mmap_min_addr Can be done in the boot script on most distributions... fakeroot hangs (probably not a scratchbox only problem)fakeroot uses the loopback interface. If this is not running then fakeroot hangs and you see messages likelibfakeroot: connect: Connection timed out Try ifconfig lo 127.0.0.1 up (outside scratchbox) to start the interface ifconfig -a should show LOOPBACK RUNNING. Ensure hosts are consistentExample - toolchains built on a 64 bit host wont run on a 32 bit machine.System Poisoning WarningsVersions of the CodeSourcery toolchain from 2007Q1 onwards emit a warning under scratchbox regarding poisoning of the system directories & includes.Some package configure scripts treat all warnings as a failure. Rather than switching this feature off and missing other warnings, stop this by supplying the flag -Wno-poison-system-directories export SBOX_EXTRA_COMPILER_ARGS=-Wno-poison-system-directories Foreign toolchains with multiple architecturesSome toolchains, e.g. CodeSourcery, include several versions of the system librariesso that the same tools can be used to cross-compile several architectures e.g. armel, thumb, armv4t, marvell-f. This may confuse the scratchbox ~/sb-toolchain-extras/confhelper/create_toolchain_conf.py script when it tries to configure the libraries to link with. One solution is to remove the directories containing the extra libraries, once the (foreign) toolchain is installed on the host, but before the scratchbox "foreign" toolchain installation is started e.g.
for d in thumb2, marvell-f, armv4t
do
find <compiler directory> -name $d -exec rm -fr {} \;
done
TODO I've always used the armel variant - try installing thumb2 In that case we might need to copy thumb2 libraries up, rather than deleting all thumb2 directories...... Foreign toolchains have different directory structuresTo get the sb-toolchain-extras to build you may need this link in the top level include directoryln -s /scratchbox/compilers/<foreign compiler>/arm-none-linux-gnueabi/include/c++ Foreign toolchains - conf files
Using your own host binary
export SBOX_REDIRECT_BINARIES="${SBOX_REDIRECT_BINARIES},/usr/invented/mytag:/home/my/binary"
export SBOX_REDIRECT_FROM_DIRS=${SBOX_REDIRECT_FROM_DIRS}:/usr/invented
export SBOX_REDIRECT_TO_DIRS=${SBOX_REDIRECT_FROM_DIRS}:/home/my
Note that the redirected binary and directory need not exist - the target binary must. Show the redirected binary isn't present in the scratchbox file system, whilst the target binary is . [sbox] > /usr/invented/mytag bash: /usr/invented/mytag: No such file or directory [sbox] > ls /usr/invented ls: /usr/invented: No such file or directory [sbox] > ls /usr/invented/mytag ls: /usr/invented/mytag: No such file or directory [sbox] > ls /scratchbox/invented/binary /scratchbox/invented/binary [sbox] > /scratchbox/invented/binary Hello from /scratchbox/invented/binarySet up the redirection
[sbox] > export SBOX_REDIRECT_FROM_DIRS=${SBOX_REDIRECT_FROM_DIRS}:/usr/invented
[sbox] > export SBOX_REDIRECT_TO_DIRS=${SBOX_REDIRECT_TO_DIRS}:/scratchbox/invented
[sbox] > export SBOX_REDIRECT_BINARIES=${SBOX_REDIRECT_BINARIES},/usr/invented/mytag:/scratchbox/invented/binary
Show it works, although the redirected binary still isn't there
[sbox] > /usr/invented/mytag Hello from /scratchbox/invented/binary [sbox] > ls /usr/invented/mytag ls: /usr/invented/mytag: No such file or directory [sbox] > echo $SBOX_REDIRECT_FROM_DIRS /bin:/usr/bin:/usr/local/bin:/usr/invented [sbox] > echo $SBOX_REDIRECT_TO_DIRS /scratchbox/devkits/debian-sarge/bin:/scratchbox/devkits/perl/bin:/scratchbox/devkits/cputransp/bin:/scratchbox/devkits/doctools/bin::/scratchbox/tools/bin:/targets/links/arch_tools/bin: /scratchbox/compilers/bin:/scratchbox/invented [sbox] > echo $SBOX_REDIRECT_BINARIES ,/scratchbox/devkits/doctools/bin/install-info:/scratchbox/devkits/debian-sarge/bin/install-info,/usr/lib/dpkg/enoent:/scratchbox/devkits/debian-sarge/lib/dpkg/enoent,/usr/invented/mytag: /scratchbox/invented/binaryExercises for the reader
Avoiding building all those target packages that are only used for a buildscratchbox HowToBits I found unclear in the scratchbox instructionsExample is adding quilt
| |||||