public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: devel@edk2.groups.io, rebecca@bluestop.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Laszlo Ersek <lersek@redhat.com>
Subject: Re: [edk2-devel] Building EDK2 code on arm64 (aarch64) - BaseTools fails
Date: Wed, 10 Apr 2019 16:41:43 +0200	[thread overview]
Message-ID: <b59950fb-5a0b-9e85-1689-60b4271ca9c5@redhat.com> (raw)
In-Reply-To: <e4699c53-7253-05b3-f188-eacce244f8e6@bluestop.org>

On 4/10/19 6:57 AM, Rebecca Cran via Groups.Io wrote:
> Is there any expectation that EDK2 will build on non-x86 systems?

I have no problem using Ubuntu Bionic on Aarch64 using the default GCC.

$ lsb_release -cd
Description:    Ubuntu 18.04.2 LTS
Codename:       bionic

$ uname -ms
Linux aarch64

$ gcc -v
gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)

> I tried building BaseTools (from git master,
> ae2fb9ead47b5abaf2a4e815b5f57c8f4838b221) using GCC 8.2 on a SoftIron
> OverDrive 1000 (running FreeBSD) but there are lots of errors, such as:
> 
> 
> gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I
> ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/Arm/ 
> -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror
> -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict
> -Wno-unused-result -nostdlib -g -O2  BasePeCoff.c -o BasePeCoff.o
> BasePeCoff.c: In function 'PeCoffLoaderGetPeHeader':
> BasePeCoff.c:120:49: error: cast from pointer to integer of different
> size [-Werror=pointer-to-int-cast]
>    *PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)
> ((UINTN)ImageContext->Handle + ImageContext->PeCoffHeaderOffset);
>                                                  ^
> BasePeCoff.c:120:12: error: cast to pointer from integer of different
> size [-Werror=int-to-pointer-cast]
>    *PeHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)
> ((UINTN)ImageContext->Handle + ImageContext->PeCoffHeaderOffset);
>             ^
> BasePeCoff.c: In function 'PeCoffLoaderImageAddress':
> BasePeCoff.c:551:10: error: cast to pointer from integer of different
> size [-Werror=int-to-pointer-cast]
>    return (UINT8 *) ((UINTN) ImageContext->ImageAddress + Address);
>           ^

This doesn't look like an architecture problem. It seems your GCC
version isn't checked correctly by BaseTools. This warning is supposed
to be disabled, see:

StdLib/LibC/Stdio/Stdio.inf:  GCC:*_*_*_CC_FLAGS    = -fno-builtin
-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-format

  reply	other threads:[~2019-04-10 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10  4:57 Building EDK2 code on arm64 (aarch64) - BaseTools fails Rebecca Cran
2019-04-10 14:41 ` Philippe Mathieu-Daudé [this message]
2019-04-10 15:04   ` [edk2-devel] " Rebecca Cran
2019-04-10 17:31 ` Laszlo Ersek
2019-04-11  0:09   ` Liming Gao
2019-04-11  2:07     ` Rebecca Cran
     [not found]     ` <159449609038BC58.19288@groups.io>
2019-04-11  3:21       ` Rebecca Cran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b59950fb-5a0b-9e85-1689-60b4271ca9c5@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox