From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 9C0686E36F for ; Tue, 4 Mar 2014 18:55:02 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.14.5/8.14.5) with ESMTP id s24Isxtr002593 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 4 Mar 2014 10:54:59 -0800 (PST) Received: from [172.25.32.43] (172.25.32.43) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.169.1; Tue, 4 Mar 2014 10:54:58 -0800 Message-ID: <53162181.6020609@windriver.com> Date: Tue, 4 Mar 2014 12:54:57 -0600 From: Jason Wessel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Stefan Agner , References: <6fbd0612b6340318098692ee610e850f@agner.ch> In-Reply-To: <6fbd0612b6340318098692ee610e850f@agner.ch> X-Enigmail-Version: 1.6 Subject: Re: relocate_sdk.py: Possible bug, /lib64/ld-linux-x86-64.so.2 not relocated X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 18:55:02 -0000 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 03/01/2014 08:26 AM, Stefan Agner wrote: > Hi, > > Using top of dylan branch, I generated a SDK using bitbake > meta-toolchain. I'm running Arch Linux, but I also see similar issues on > Ubuntu 12.04.4 LTS: > > Some binaries segfault when running them. I discovered, that the dynamic > linker of the host is used: > $ ldd > /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/armv7ahf-vfp-neon-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc > linux-vdso.so.1 (0x00007fffc8f11000) > libc.so.6 => > /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/armv7ahf-vfp-neon-angstrom-linux-gnueabi/../../../lib/libc.so.6 > (0x00007f4d85eb1000) > /lib64/ld-linux-x86-64.so.2 (0x00007f4d8625f000) > > When forcing the dynamic linker of the SDK, the binary works: > $ > /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/lib/ld-linux-x86-64.so.2 > /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/armv7ahf-vfp-neon-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc > arm-angstrom-linux-gnueabi-gcc: fatal error: no input files > compilation terminated. > > Digging around I found this commit by Jason: > 3752a9c6d772b39bbe04d62ef4d3527b4c7198c1 > relocate_sdk.py: Fix corruption of sdk binaries > > It changes the behavior and don't relocates stuff which start with > /lib64. When I install the SDK with -S (copy the relocate scripts), and > remove the condition around line 95, the binaries work as expected. Also > LDD shows that ld-linux-x86-64.so.2 of the SDK will be used. > > Btw, I think this bug is related to that: > https://github.com/Angstrom-distribution/setup-scripts/issues/25 > > Since I don't understand the original intention of that commit, I'm not > sure how to fix this properly... My guess is that the compiler recipe is not using the right linker. The change to ignore binaries that are linked against the host libc is there intentionally. We don't want to relocate binaries that are for a specific host or set of hosts. The main reason it is there is to allow for the inclusion of binaries that were generated by the SDK as well as binaries that came from outside the SDK. When you use the host's ld to link something and end up linking against the host's linux-vdso.so.1 there is not enough space for the path relocations. The proper fix should be to ensure the recipe that builds your compiler has the same patches and linking of binaries as the oe-core cross compiler. Cheers, Jason.