1 |
Hi, |
2 |
|
3 |
In the last week, I sucessfuly run native compiler in arm chroot. |
4 |
The code is also |
5 |
updated:(http://github.com/jinghuang/cross_container_support). |
6 |
|
7 |
At previous experiment, the result is not trusable. That is because |
8 |
the version of cross gcc and emulated gcc are same(4.5.3). So, the |
9 |
cross gcc will reuse some paths and binutils. When cross gcc updated |
10 |
to 4.6.3, the cross gcc cannot find these paths and bins. |
11 |
|
12 |
This time, I mount /lib and /usr to arm chroot and create a switch |
13 |
script(chroot/root/switch.sh) in chroot. The switch.sh will create the |
14 |
same gnu toolchain paths as the host, including gcc's LDPATH, GCC_PATH |
15 |
and binutils' LIBPATH, etc. Therefore, I could make the same gcc |
16 |
running envairment as the host. |
17 |
|
18 |
But it is very hard to replace the gcc's |
19 |
LDPATH(/usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.6.3). Once |
20 |
changing, most of programs cannot run. I address this problem using |
21 |
the follow way: |
22 |
|
23 |
if(LDPATH exist) //means the cross gcc and emulated gcc have the same version |
24 |
reuse emulated LDPATH |
25 |
else |
26 |
mount and use host's LDPATH |
27 |
|
28 |
I was testing my script with iputils-s20101006. The emulated gcc |
29 |
will cause 19.813s. Our cross gcc will cause 1.379s. |
30 |
|
31 |
But the script doesn't support X86_64 and hardcods some path and |
32 |
gcc version. I will find some trick ways to hide them. |
33 |
|
34 |
|
35 |
Jing. |