|
楼主 |
发表于 2009-3-13 13:21:44
|
显示全部楼层
上面问题已解决,居然是低级的路径问题。:yun:
等有时间总结一下。
注意下面 host 的 /bin/uname /usr/bin/gcc 已经被 sbox2 映射到 target。- $ sbox2 [color="Green"]/bin/uname[/color] -a
- Linux localhost 2.6.28.7 #1 SMP Thu Mar 5 00:36:51 CST 2009 [color="Red"]arm[/color] GNU/Linux
- $
- $ sbox2 /arm-linux-gnu/rootfs/bin/uname -a
- Linux localhost 2.6.28.7 #1 SMP Thu Mar 5 00:36:51 CST 2009 [color="Red"]armv5tel[/color] GNU/Linux
- $
- $ sbox2 [color="Green"]/usr/bin/gcc[/color] -v
- Using built-in specs.
- Reading specs from /usr/share/scratchbox2/modeconf/gcc-specs.devel
- rename spec cpp to old_cpp
- Target: [color="Red"]arm-unknown-linux-gnu[/color]
- Configured with: /arm-linux-gnu/source/gcc-4.3.3/configure --prefix=/arm-linux-gnu/tools --build=i686-cross-linux-gnu --host=i686-cross-linux-gnu --target=arm-unknown-linux-gnu --with-sysroot=/arm-linux-gnu/rootfs --disable-nls --enable-shared --enable-languages=c,c++ --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-threads=posix --disable-multilib
- Thread model: posix
- gcc version 4.3.3 (GCC)
复制代码
据近两周的经验,sbox2 与其前辈 scratchbox 工作原理并不相同,sbox2 的工作是已"路径重映射(path remap)"为基础,相对更高阶一些,限制也更少。
http://maemo-sdk.garage.maemo.org/user-guide.html 中有一段描述相当精到1.3 Cross-compilation Universe
In the Scratchbox 2 cross-compilation universe system calls related to file system access are remapped so that build tools are taken from a specific build environment, libraries, header files, aclocal files etc. are taken from a target rootstrap, and source code to be compiled are taken as is, from the host.
By remapping file access we mean modifing the actual file path of the original call. For example, if we have a file execution access /usr/bin/bison it is converted to /opt/maemo/dists/etch/usr/bin/bison before the launch happens (all build tools are taken from a build tool distribution). Another example could be an access to library /usr/lib/libc.a which is converted to ~/.maemo-sdk/rootstraps/armel/diablo4.1.2_armel/usr/lib/libc.a (taken from Diablo rootstrap). The actual remapping rules of the cross-compilation universe can be read from /usr/share/scratchbox2/lua_scripts/pathmaps/devel/00_default.lua if you have Scratchbox 2 installed.
Since the cross-compilation universe does not map one to one to the target environment the target packages should not be installed or run in there. A separate execution universe is provided which is similar to the target device environment. |
|