From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WVxl5-0003zp-FM for mharc-grub-devel@gnu.org; Fri, 04 Apr 2014 02:37:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVxkx-0003zS-VO for grub-devel@gnu.org; Fri, 04 Apr 2014 02:37:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVxks-0002Gu-6G for grub-devel@gnu.org; Fri, 04 Apr 2014 02:37:39 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:64277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVxkr-0002Gl-NJ for grub-devel@gnu.org; Fri, 04 Apr 2014 02:37:34 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so2964626wgh.27 for ; Thu, 03 Apr 2014 23:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=DP02QuFJDrxnL/B72GvBMAhPNxDawykIdsVkBLWsbCY=; b=VdeKk31bWcu4KXSaAAtMX9dCEv5Woxb4bgdn/BnHytwKKtIu0mq7FrD9jPcw0DHl+A 3SbIJQ03GS0qxXh6rKjuwzsNimVKJWo43j1eeXdH9A7gJ4FnJFMyDxrtqBEDijBYNts8 ySdTJVSdsffWBkAHjurKDf2qV/hrVJKJslUylxirHl/fqhmOLVWgpbkwJazF2lDazQ1c FrM0kyUT7cWp7hB/oULnHK8YO8WN2oT/8L8qlwMzfRquC0VzVOKLEHmlYd98FbBl0qmz a3Zwl6VexbW+WPplioCUkvNlqYaT0KTJ/R6PWmJJsvyOLF/+uMt55lKsPBqPCRlejIeL 2L8Q== X-Received: by 10.194.21.193 with SMTP id x1mr16817436wje.33.1396593452782; Thu, 03 Apr 2014 23:37:32 -0700 (PDT) Received: from [192.168.42.200] (146-227.197-178.cust.bluewin.ch. [178.197.227.146]) by mx.google.com with ESMTPSA id t50sm17306472eev.28.2014.04.03.23.37.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:37:31 -0700 (PDT) Message-ID: <533E5320.9070100@gmail.com> Date: Fri, 04 Apr 2014 08:37:20 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.3.0 MIME-Version: 1.0 To: Andrey Borzenkov , Ram Pai Subject: Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :) References: <1393439482-20341-1-git-send-email-linuxram@us.ibm.com> <1393439482-20341-22-git-send-email-linuxram@us.ibm.com> <20140401214945.209b4894@opensuse.site> <533B1FF2.9040503@gmail.com> <20140403173336.GA16534@ram.oc3035372033.ibm.com> <20140403215356.1b953172@opensuse.site> <20140403183705.GK29218@ram.oc3035372033.ibm.com> <20140403230329.06d61900@opensuse.site> <20140403192657.GM29218@ram.oc3035372033.ibm.com> <20140403235446.2c69a649@opensuse.site> In-Reply-To: <20140403235446.2c69a649@opensuse.site> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SMOxVSaoosS2duWRwd9tDcRV3k1wEE4T8" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22c Cc: The development of GNU GRUB , pfsmorigo@br.ibm.com X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2014 06:37:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SMOxVSaoosS2duWRwd9tDcRV3k1wEE4T8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03.04.2014 21:54, Andrey Borzenkov wrote: > =D0=92 Thu, 3 Apr 2014 12:26:57 -0700 > Ram Pai =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 >>>>> >>>>>> Well. that is the issue. Various distros have varied support for >>>>>> cross-compilation (multi-arch support). If the distro does not=20 >>>>>> have 32bit BE libraries natively installed (out-of-the-box), they >>>>>> wont be able to generate a 32bit BE grub loader. >>>>> >>>>> We speak only about target code that runs at boot time. This code d= oes >>>>> not use any library.=20 >>>> >>>> I am not a compiler/toolchain expert. But dont we need all the neces= sary >>>> tools and libraries in /lib/--linux/ directory for cross= >>>> compilation; even to generate static executables? >>>> >>>>> It only needs compiler support. GRUB does not >>>>> support anything besides gcc and recently some clang support was ad= ded. >>>>> Do you have real life example of distribution which does not suppor= t >>>>> -mbig gcc option to produce big-endian *code*? >>>> >>>> This is ideally what I want too. But it is not possible >>>> **out-of-the-box** on any distro for power arch. I am told >>>> that debian has a new multi-arch support added which makes this >>>> work out-of-the-box, but it is still in early stages to work >>>> seemlessly **out-of-the-box**. I may be wrong. >>>> >>> >>> If distribution is capable of building Linux kernel, it should be >>> capable of compiling 32 bit big-endian code. Linux startup code on >>> PowerPC is built as 32 bit big-endian: >>> >>> BOOTCFLAGS :=3D -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \= >>> -fno-strict-aliasing -Os -msoft-float -pipe \ >>> -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ >>> -isystem $(shell $(CROSS32CC) -print-file-name=3Dinc= lude) \ >>> -mbig-endian >> >> >> But that is different though. Yes it is possible to cross compile for >> any target on any arch. But the key is that the environment needs to = be >> setup to do so. =20 >> >> We are talking about generating crosscompiled grub boot loader by an >> uninitiated/not-so-expert adminstrator. If the distribution makes it >> easy for that administrator to be able to cross-compile, than life is >> easy. But that is not generally the case though. >=20 > E-h-h ... could you be more specific? You need exactly the same tool > set to compile 32 bit big-endian grub as to compile Linux kernel. So > it follows that generally it is impossible to compile Linux kernel on > distributions for ppc64le. Is it what you mean? >=20 >> The administrator ha= s >> to scramble around to find the right cross-compilation setup installed= >> on her system to achieve the end result. >> >=20 > I try to understand what exactly is required beyond what is needed to > compile Linux kernel? I do not consider need to install a couple of > RPMs as high burden. >=20 > Here is what grub2 on SUSE needs: >=20 > %ifarch x86_64 ppc64 > BuildRequires: gcc-32bit > BuildRequires: glibc-32bit > BuildRequires: glibc-devel-32bit > %else > BuildRequires: gcc > BuildRequires: glibc-devel > %ifarch s390x > BuildRequires: glibc-static > %endif > %endif >=20 > See https://build.opensuse.org/package/show/Base:System/grub2 I see you have some outdated patches like btrfs ones, you shouldn't need them now (didn't really look in them). As for eliminating libgcc dependency I created branch phcoder/no-libgcc. For ppc only ucmpdi2 was needed actually. > for > details. It simply forces -m32 -big-endian for powerpc. It also include= s > brute-force patche to work around libgcc issue that probably may be > done differently, but otherwise it is amazingly small change. >=20 --SMOxVSaoosS2duWRwd9tDcRV3k1wEE4T8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlM+UyYACgkQmBXlbbo5nOtIFQEAiK/IubbHgLT/7xsOTd1/SjuN UExqWy3psgIPXQzIkxcBAIpTCb+w0gkkV8Si9b8BW4hxqxK3cgSf2DEe6dIJ6hLK =jZPs -----END PGP SIGNATURE----- --SMOxVSaoosS2duWRwd9tDcRV3k1wEE4T8--