From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 33E9213800E for ; Thu, 2 Aug 2012 18:08:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3FA61E0655 for ; Thu, 2 Aug 2012 18:08:48 +0000 (UTC) Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by pigeon.gentoo.org (Postfix) with ESMTP id 0F838E06BE for ; Thu, 2 Aug 2012 15:23:55 +0000 (UTC) Received: by wgbds1 with SMTP id ds1so5300210wgb.4 for ; Thu, 02 Aug 2012 08:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=T2Q5gP/Py2/HYIemumq8nyBczqAy7ixz6pRpDTgBupI=; b=KgUrxE+w+fmizp5TdA71MYTW/gjmx7ZTFOmfGRyNlNdEeucazQlbeyU+ljGDHJN9Id +GzHHhDxHUeuCaFF9E1Tm8KIIdtsE6GXn0INU0jLHbjZPuQSOKMRccGPiiPET3j36DfT pVr0J3a8yBWL7ihigtlVO1MBQ5oVRS2qOH76znVHLwXGBwvT0cvkzkguULEFN08x8280 FajPeZjyWj52gvp2hWen1b8bckKQyF+kfdXkF7dzYxtybcKQQM08NG1pZcbrKvuFWsuS HmUq6soyMmSRbUQQO3xoRsMblTjfhf+hti+Q2lEzsdWOan4k6zfpOeainExA3OxU3UM+ m7EQ== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-soc@lists.gentoo.org Reply-to: gentoo-soc@lists.gentoo.org MIME-Version: 1.0 Received: by 10.180.81.133 with SMTP id a5mr5572218wiy.17.1343921035017; Thu, 02 Aug 2012 08:23:55 -0700 (PDT) Received: by 10.216.230.167 with HTTP; Thu, 2 Aug 2012 08:23:54 -0700 (PDT) In-Reply-To: References: <50183267.5050800@gentoo.org> Date: Thu, 2 Aug 2012 15:23:54 +0000 Message-ID: Subject: [gentoo-soc] Re: cross_container_support - progress report #9 From: Jing Huang To: Luca Barbato Cc: gentoo-soc@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: 8a23bc66-2587-47dc-8460-4ea3424d839b X-Archives-Hash: eb39a7778089fb8cac64722779729193 On Wed, Aug 1, 2012 at 5:01 PM, Jing Huang wrote: > On Tue, Jul 31, 2012 at 7:30 PM, Luca Barbato wrote: >> On 07/31/2012 05:45 PM, Jing Huang wrote: >>> Hi, >>> >>> == Progress of last Week == >>> >>> In the last week, my qemu-linux patches had been reviewed by the qemu >>> community. >>> >>> I investigated how to config dynamic libraries in lxc container.: >>> >>> 1. mount host's /lib /usr/lib /usr/local/lib to lxc container >>> >>> 2. modify lxc container's ld.so.conf to link these libs. >>> >>> 3. ldconfig -Nf /etc/ld.so.conf to make settings available. (The >>> ld.so.cache will include arm libraries by default. How to ignore >>> them?) >>> >>> I am still debugging this method. >>> >>> Additionally, I found I must execute "qemu-static-i386 x86-program" >>> in lxc container to make it run. Is it right? >> >> No it is wrong, you should call the runtime linker. > > When I execute x86-program(builded with dynamic libraries) in lxc > container, it shows: > "bash: x86-program: No such file or directory" > > Obviously, the container has not called the right dynamic > linker(ld-linux.so) to interpret the x86-program. > Maybe I could register this linker or the linker wrap to > /proc/sys/fs/binfmt_misc ? Hmm.. The root cause of this fault is: ./x86-program(built with dynamic libraries) -->load_elf_binary() -->open_exec("/lib/ld-linux.so.2"); lxc chroot lacks of /lib/ld-linux.so.2. This problem is a difficult one. In my opinion, the following two steps are essential to solve it. 1. alter linker script to build x86-program using custom ld-linux.so.2 path ( /target/lib/ld-linux.so.2 ). 2. switch dynamic libraries to custom paths. This point is relatively easy. I could use either LD_LIBRARY_PATH or ld.so.conf. "ldconfig /etc/ld.so.conf" is odd. I had altered ld.so.conf and env.d/00basic to exclude original library path(/lib, /usr/lib, /usr/local/lib), but the new generated cache file still include these paths. Unfortunately, linker will link libraries accroding to the ld cache file unless declare the DT_RPATH and LD_LIBRARY_PATH. > >> >>> == Plans for this week == >>> >>> 1. Still investigate dynamic libraries configure. >> >> It will take probably more time. >> >>> 2. wait for vapier's help. If it is possible, would you offer me the >>> rough tech roadmap of patching crossdev and/or the toolchain eclass >>> you mentioned last letter? >> >> First let's try to wrap up what we have now available and get more >> people trying it =) That means document all the steps in the wiki and >> get voluteers to try them. > > OK. I am doing it. > >> >> lu >> >> -- >> >> Luca Barbato >> Gentoo/linux >> http://dev.gentoo.org/~lu_zero >>