From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WVnoy-0003fc-0Y for mharc-grub-devel@gnu.org; Thu, 03 Apr 2014 16:01:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVnoq-0003So-FP for grub-devel@gnu.org; Thu, 03 Apr 2014 16:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVnok-0005es-4L for grub-devel@gnu.org; Thu, 03 Apr 2014 16:01:00 -0400 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:51897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVnis-0003e4-0y for grub-devel@gnu.org; Thu, 03 Apr 2014 15:54:50 -0400 Received: by mail-la0-f50.google.com with SMTP id pv20so1772421lab.9 for ; Thu, 03 Apr 2014 12:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=acCQL+AlknPrZmuF7DLsVYY+gUf+2NxR3/jbMAMLbZs=; b=N1YV+DUfDjtLvPJuP21xt4wpbQFEdymYMW+2P1WAy6k9VjeRmUOFMnGsUhwezBgWur 36ig2dCAUJDXgWBWhu66S4IwF9kKnVzUAsl8Hn1oEBffF2rjSH2pOP1tBvGOFdX1WClh nnMU93AcgzBVZ4U3yvItQ+FhOqbbqQtLBbLTmyji/uyi75lEmKkFWu3WFq9MAKg1pT2x O593ymHhA98USi3zwxNCo1apoBCOm72Y73RVz6PDSDJTwoWhjVC8s3KqSx32ffY6u/Cl e6WAKGX8mf5rjdvhQH4Y52rtyzsi9rNgi1LtNQ9pExqkK9NyJzwBLIJwgt6+fzy7RYm5 /GIg== X-Received: by 10.152.87.102 with SMTP id w6mr2552387laz.46.1396554888588; Thu, 03 Apr 2014 12:54:48 -0700 (PDT) Received: from opensuse.site (ppp37-190-15-130.pppoe.spdop.ru. [37.190.15.130]) by mx.google.com with ESMTPSA id tq9sm4174652lbb.10.2014.04.03.12.54.47 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 12:54:47 -0700 (PDT) Date: Thu, 3 Apr 2014 23:54:46 +0400 From: Andrey Borzenkov To: Ram Pai Subject: Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :) Message-ID: <20140403235446.2c69a649@opensuse.site> In-Reply-To: <20140403192657.GM29218@ram.oc3035372033.ibm.com> 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> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 Cc: The development of GNU GRUB , pfsmorigo@br.ibm.com, phcoder@gmail.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: Thu, 03 Apr 2014 20:01:06 -0000 В Thu, 3 Apr 2014 12:26:57 -0700 Ram Pai пишет: > > > > > > > > > Well. that is the issue. Various distros have varied support for > > > > > cross-compilation (multi-arch support). If the distro does not > > > > > 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 does > > > > not use any library. > > > > > > I am not a compiler/toolchain expert. But dont we need all the necessary > > > 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 added. > > > > Do you have real life example of distribution which does not support > > > > -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 := -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=include) \ > > -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. > > 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. 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? > The administrator has > to scramble around to find the right cross-compilation setup installed > on her system to achieve the end result. > 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. Here is what grub2 on SUSE needs: %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 See https://build.opensuse.org/package/show/Base:System/grub2 for details. It simply forces -m32 -big-endian for powerpc. It also includes brute-force patche to work around libgcc issue that probably may be done differently, but otherwise it is amazingly small change.