From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbbKJHys (ORCPT ); Tue, 10 Nov 2015 02:54:48 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:64159 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbbKJHye (ORCPT ); Tue, 10 Nov 2015 02:54:34 -0500 Subject: Re: [PATCH] powerpc: allow cross-compilation of ppc64 kernel To: Michael Ellerman , Scott Wood References: <1446724029-10884-1-git-send-email-laurent@vivier.eu> <1446844180.11597.13.camel@freescale.com> <563D2813.80302@vivier.eu> <1446852296.11597.53.camel@freescale.com> <563DE203.6030001@vivier.eu> <1447115377.13889.7.camel@ellerman.id.au> Cc: paulus@samba.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org From: Laurent Vivier Message-ID: <5641A2A7.9060004@vivier.eu> Date: Tue, 10 Nov 2015 08:54:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1447115377.13889.7.camel@ellerman.id.au> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:46JdWyptnpVTCU8g4vSNjYQloxP0no6SR4yS+7XCOP5O5uD3Edm H5HFohtXpWLBKBq+iXIREJTdRnKgpBs1Kw4zHRs1//RmxYDmmyA9Z2vMMlVcD6TbRetT4OM sOzg/dZFX+1QNP7vCw5z3c4q1pFOyd4ZEw60V7UsDCuw4HK5qFUH8G8eKrG4GIyu5mGqxmg dGMojABoNgMLW+N/C1FXQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ruHJu70B5RI=:vR98lTKN4M7Jo+5w1yiQjM jroce/SQgWqGqd7xu5sCpMgWYhvIpx1Tk5G5BM1oRptsTjhuGGdR9JuoMGKCvaDGYB7Nvnn8X Amv6MiTOlafAoTuu5N3TpQHyPHlaJbCh2Ri7wZG2FS5lKxoXiFqAeaq/vCNa9KxaDPUzYA6fe Hd3nn/c22cEDDc6yxK4vbmgQNmS3MPvQOUoickZRprvECdcMz5AFGo5n7ka81ZM5ndxhzzdby 55yrCM1tDYyyqqYV15mYnlwoi6be+EibKeAsb7f2A2jrJ0Gul9BM++MQ+HnfAgyJPOLs3CAKq Lzs1ibY3ICeSmGEwKZboF+uJjtFUZr2c+92iHbAAtk/rokhLjZ0wMb4BE4ejolMl1KhiotCO6 7o5BIJ6gwooeCDGVfUHjh/1uG20HFUtPnk8ns3E2LbngSrgjuEFHJqhxIaFSRkz3yVXcgS1CA Kb2+YWAq/q6u6Z9daW51LginFT5BGCuU5BXJ9zB9PtZ3G6Ab2eL1qqCytKI9D2HVgQ8bNmRna tFJz7ksJ3prpUhe204pIskVHD9VK2QUO4CEkIp8g9xFn19Epu/podM7kKTeusvUfVU1Dz6z56 8r5NJJ4WBni5Xa78ZaRs2Z+xB5MpIonzudIo0KNgi8/w80Zbz7NsxLKJXJiUvGnx4uQZbmN65 idIwQSun+P/CjK1hJt9oYDPqC49mhHOmn4AwrRVAq7AIVby+gJlre6cWaYhq2v3JH7JTpSAtZ umlYej+bC6w+N6Rc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 10/11/2015 01:29, Michael Ellerman a écrit : > On Sat, 2015-11-07 at 12:35 +0100, Laurent Vivier wrote: >> Le 07/11/2015 00:24, Scott Wood a écrit : >>> On Fri, 2015-11-06 at 23:22 +0100, Laurent Vivier wrote: >>>> Le 06/11/2015 22:09, Scott Wood a écrit : >>>>> On Thu, 2015-11-05 at 12:47 +0100, Laurent Vivier wrote: >>>>>> When I try to cross compile a ppc64 kernel, it generally >>>>>> fails on the VDSO stage. This is true for powerpc64 cross- >>>>>> compiler, but also when I try to build a ppc64le kernel >>>>>> on a ppc64 host. >>>>>> >>>>>> VDSO64L fails: >>>>>> >>>>>> VDSO64L arch/powerpc/kernel/vdso64/vdso64.so.dbg >>>>>> /usr/bin/powerpc64-linux-gnu-ld: arch/powerpc/kernel/vdso64/sigtramp.o: >>>>>> file class ELFCLASS64 incompatible with ELFCLASS32 >>>>>> /usr/bin/powerpc64-linux-gnu-ld: final link failed: File in wrong format >>>>>> >>>>>> This fails because gcc calls "collect2" with >>>>>> "--oformat elf32-powerpcle" with ppc64 objects, without the >>>>>> "--oformat" ld works well because it use the format of the >>>>>> first object as output format. >>>>>> >>>>>> As this case is correctly managed to build the other kernel >>>>>> objects, this patch replaces $(GCC) by $(LD) to generate the >>>>>> VDSO objects. >>> >>>> So at this point, I can: >>>> >>>> 1- either fix my compiler, >>>> 2- or fix the vdso64 linker command. >>> >> Thank you Scott. With the help of the comment from Segher, I can choose >> #1 now :) > > What distro/toolchain did you hit this on? fedora 23. > I actually wrote this same patch a while back, but from memory it broke in some > configurations. So I never merged it. I'll see if I can find my notes and work > out exactly why it didn't work, maybe we should merge it anyway, even though > the real bug is a toolchain bug. On fedora, there is also a bug in binutils configuration where ld is not able to manage ppc64le binaries on ppc64 host, but I've already sent a fix for that and it is now in rawhide (will be in fedora 24). https://bugzilla.redhat.com/show_bug.cgi?id=1275709 Laurent