Gentoo Archives: gentoo-soc

From: Jing Huang <jing.huang.pku@×××××.com>
To: lu_zero@g.o, gentoo-soc@l.g.o
Subject: [gentoo-soc] cross_container_support - progress report #11
Date: Mon, 20 Aug 2012 15:25:04
1 Hi,
3 In the last week, I sucessfuly run native compiler in arm chroot.
4 The code is also
5 updated:(
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.
12 This time, I mount /lib and /usr to arm chroot and create a switch
13 script(chroot/root/ in chroot. The 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.
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:
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
28 I was testing my script with iputils-s20101006. The emulated gcc
29 will cause 19.813s. Our cross gcc will cause 1.379s.
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.
35 Jing.