Re: [edk2] Cross compiling EDK2 for Aarch64
On 11 October 2015 at 09:34, Yehuda Yitschak <yehu...@marvell.com> wrote: > Hi Laszlo > >> -Original Message- >> From: Laszlo Ersek [mailto:ler...@redhat.com] >> Sent: Thursday, October 08, 2015 22:21 >> To: Yehuda Yitschak >> Cc: edk2-devel@lists.01.org; leif.lindh...@linaro.org >> Subject: Re: [edk2] Cross compiling EDK2 for Aarch64 >> >> Obviously I forgot one command (because it need not be reissued every >> time): >> >> On 10/08/15 21:17, Laszlo Ersek wrote: >> > On 10/08/15 10:24, Yehuda Yitschak wrote: >> >> Hello everyone >> >> >> >> I am new to the EDK2 projects and for starters I am trying to cross >> >> compile the project for aarch64 on an x86_64 host >> >> >> >> I looked around in Linaro website and Tiano-core website but couldn't >> >> find any instruction on how to _cross_ compile >> >> >> >> I tried to follow the instruction here: >> >> https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build >> >> but when I try to compile using the "build" command the build script >> >> uses the x86 compiler and naturally it fails I tried working around >> >> this by setting the environment variable GCC48_BIN however then the >> >> build system tries to call "make" from the path in GCC48_BIN which >> >> off course fails >> >> >> >> I also found these instructions >> >> https://github.com/tianocore/tianocore.github.io/wiki/Unix-like_syste >> >> ms#Build_gcc_x64_UEFI_cross_compiler >> >> But I'm not sure they apply to aarch64. >> >> >> >> I appreciate any suggestions you can offer >> > >> > Here's how I do it: >> > >> > - download & install the latest cross-compiler toolchain from Linaro's >> > website, for example: >> > >> > https://releases.linaro.org/15.06/components/toolchain/binaries/4.8/aa >> > rch64-linux-gnu/ >> > >> > The tarball you most probably want is >> > >> > gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz >> > >> > assuming you use Linux. If you use Windows, I guess you need: >> > >> > gcc-linaro-4.8-2015.06-i686-mingw32_aarch64-linux-gnu.tar.xz >> > >> > Now extract this somewhere, and put its "bin" directory on your PATH. >> > Notice that it has filenames like "aarch64-linux-gnu-gcc". >> > >> > Once this is done, you can build ArmVirtQemu.dsc (for getting AARCH64 >> > firmware that runs on "qemu-system-aarch64 -M virt") like this: >> > >> > $ source edksetup.sh >> >> after this: >> >> $ make -C "$EDK_TOOLS_PATH" >> >> Thanks >> Laszlo >> >> > >> > $ export GCC48_AARCH64_PREFIX=aarch64-linux-gnu- >> > >> > $ build \ >> > -a AARCH64 \ >> > -t GCC48 \ >> > -p ArmVirtPkg/ArmVirtQemu.dsc \ >> > -n 8 \ >> > --report-file=.../build.aa64virt.report \ >> > --log=.../build.aa64virt.log \ >> > -b DEBUG \ >> > -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F \ >> > -D SECURE_BOOT_ENABLE >> > >> > (See "build --help" for what's what.) >> > >> > The final firmware image is somewhere under the Build directory, >> > you'll have to consult the FDF file referenced with FLASH_DEFINITION >> > in the DSC file for finding out its name. >> > >> > For example, "ArmVirtPkg/ArmVirtQemu.dsc" references >> > "ArmVirtPkg/ArmVirtQemu.fdf", and the latter has a section called >> > [FD.QEMU_EFI], so the file you'd look for under Build is "QEMU_EFI.fd". >> > >> > For installing and/or running the firmware binary, further actions may >> > be necessary, of course. (In case of QEMU, the QEMU_EFI.fd file needs >> > to be padded to 64MB, etc etc, you can google the instructions in the >> > Linaro and Fedora wikis.) > > I tried following this guide on Linaro's website > https://wiki.linaro.org/LEG/UEFIforQEMU > I built qemu-system-aarch64 myself using qemu-2.4 since it cannot be > installed using apt-get on Ubuntu-14.04. > > I managed to get to the boot phase with the message "the default boot > selection will start in 3 seconds" > But when I press enter to get to the boot menu (or even if don't press > anything) I get: > ASSERT_EFI_ERROR (Status = Not Found) >
Re: [edk2] Cross compiling EDK2 for Aarch64
On Mon, Oct 12, 2015 at 08:50:53AM +, Yehuda Yitschak wrote: > Thanks. It worked fine. > I assumed the linaro-edk2 GIT should be more up to date with ARM > fixes but I think this is not the case here. No, that will never be the case - we work upstream, so fixes only go into linaro-edk2 after they are in Tianocore. linaro-edk2 is only for us to be able to track Linaro releases separately, and add support for additional platforms (until such a time as the Tianocore platform support story is resolved). > Just wondering, do you know why this fix isn't in linaro-edk2 ? > I'm just considering which GIT to use Unless you're specifically developing for a platform that is only supported in linaro-edk2, always use Tianocore. And even then, locally importing OpenPlatformPkg into a Tianocore checkout is still a better solution, but documentation is lagging. / Leif ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] Cross compiling EDK2 for Aarch64
Hi Yehuda, On Thu, Oct 08, 2015 at 08:24:07AM +, Yehuda Yitschak wrote: > I am new to the EDK2 projects and for starters I am trying to cross > compile the project for aarch64 on an x86_64 host > > I looked around in Linaro website and Tiano-core website but > couldn't find any instruction on how to _cross_ compile > > I tried to follow the instruction here: > https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build > > but when I try to compile using the "build" command the build script > uses the x86 compiler and naturally it fails Any particular reason why you skipped past the first half of the page to follow the instructions under the headline "The Hard Way"? > I tried working around this by setting the environment variable > GCC48_BIN however then the build system tries to call "make" from > the path in GCC48_BIN which off course fails This doesn't make sense. Can you please provide some information on the actual steps you have attempted, and the exact error output that yielded, in order for us to be able to help? Regards, Leif ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
[edk2] Cross compiling EDK2 for Aarch64
Hello everyone I am new to the EDK2 projects and for starters I am trying to cross compile the project for aarch64 on an x86_64 host I looked around in Linaro website and Tiano-core website but couldn't find any instruction on how to _cross_ compile I tried to follow the instruction here: https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build but when I try to compile using the "build" command the build script uses the x86 compiler and naturally it fails I tried working around this by setting the environment variable GCC48_BIN however then the build system tries to call "make" from the path in GCC48_BIN which off course fails I also found these instructions https://github.com/tianocore/tianocore.github.io/wiki/Unix-like_systems#Build_gcc_x64_UEFI_cross_compiler But I'm not sure they apply to aarch64. I appreciate any suggestions you can offer Thanks in advance --- Yehuda Yitschak Marvell Semiconductor Ltd. ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] Cross compiling EDK2 for Aarch64
On Thu, Oct 08, 2015 at 10:04:24AM +, Yehuda Yitschak wrote: > > > but when I try to compile using the "build" command the build script > > > uses the x86 compiler and naturally it fails > > > > Any particular reason why you skipped past the first half of the page to > > follow the instructions under the headline "The Hard Way"? > > 2 reasons. I am unable to clone the uefi-tools git using "git clone > git://git.linaro.org/uefi/uefi-tools.git". I get this output > Cloning into 'uefi-tools'... > fatal: unable to connect to git.linaro.org: > git.linaro.org[0: 54.247.55.40]: errno=Connection timed out > maybe the GIT moved, or I have some permission issues ? Hmm, was one of our git mirrors temporarily down? I just tested cloning from that IP, and it works from here now. If you have some firewall issues, maybe you could try with the http protocol instead: git clone http://git.linaro.org/uefi/uefi-tools.git > Second, I wanted to get a better understanding of the build process Fair enough. I just found that bit tedious enough to hide it behind scripts :) But one thing uefi-build.sh does is print the exact build command line before building each platform, so it could still be useful for this. > > > I tried working around this by setting the environment variable > > > GCC48_BIN however then the build system tries to call "make" from the > > > path in GCC48_BIN which off course fails > > > > This doesn't make sense. > > > > Can you please provide some information on the actual steps you have > > attempted, and the exact error output that yielded, in order for us to be > > able to help? > > > Following the "hard way" I perform these steps > - git clone http://git.linaro.org/uefi/linaro-edk2.git > - cd linaro-edk2 > - git checkout master > - . edksetup.sh > - make -C BaseTools > Up to this point everything is working fine > > When running > "build -a ARM -b DEBUG -t GCC48 -p > ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.dsc -D > EDK2_ARMVE_STANDALONE=1" > I get an error saying the dsc file doesn't exist. Yeah, we've dropped that platform, so should probably not be using it in our command line example... My bad, I'll update wiki. > I'm also interested in aarch64 so I changed the command to: > " build -a AARCH64 -b DEBUG -t GCC48 -p > ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc -D > EDK2_ARMVE_STANDALONE=1" Yes, when cross compiling you do need to point out which toolchain to use. In my case, for the GCC48 profile, since I have the toolchain on my PATH, I would do this by prepending GCC48_AARCH64_PREFIX=aarch64-linux-gnu- to the command line. If it's not on your PATH, specify the full path (e.g. /usr/local/toolchains/linaro-aarch64/bin/aarch64-linux-gnu-). > I don't have a aarch64 compiler installed properly using apt-get but > I tried that before and that also didn't solve the problem As long as you have an aarch64 toolchain installed somehow... Regards, Leif ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] Cross compiling EDK2 for Aarch64
On 10/08/15 10:24, Yehuda Yitschak wrote: > Hello everyone > > I am new to the EDK2 projects and for starters I am trying to cross compile > the project for aarch64 on an x86_64 host > > I looked around in Linaro website and Tiano-core website but couldn't find > any instruction on how to _cross_ compile > > I tried to follow the instruction here: > https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build > but when I try to compile using the "build" command the build script uses the > x86 compiler and naturally it fails > I tried working around this by setting the environment variable GCC48_BIN > however then the build system tries to call "make" from the path in GCC48_BIN > which off course fails > > I also found these instructions > https://github.com/tianocore/tianocore.github.io/wiki/Unix-like_systems#Build_gcc_x64_UEFI_cross_compiler > But I'm not sure they apply to aarch64. > > I appreciate any suggestions you can offer Here's how I do it: - download & install the latest cross-compiler toolchain from Linaro's website, for example: https://releases.linaro.org/15.06/components/toolchain/binaries/4.8/aarch64-linux-gnu/ The tarball you most probably want is gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz assuming you use Linux. If you use Windows, I guess you need: gcc-linaro-4.8-2015.06-i686-mingw32_aarch64-linux-gnu.tar.xz Now extract this somewhere, and put its "bin" directory on your PATH. Notice that it has filenames like "aarch64-linux-gnu-gcc". Once this is done, you can build ArmVirtQemu.dsc (for getting AARCH64 firmware that runs on "qemu-system-aarch64 -M virt") like this: $ source edksetup.sh $ export GCC48_AARCH64_PREFIX=aarch64-linux-gnu- $ build \ -a AARCH64 \ -t GCC48 \ -p ArmVirtPkg/ArmVirtQemu.dsc \ -n 8 \ --report-file=.../build.aa64virt.report \ --log=.../build.aa64virt.log \ -b DEBUG \ -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F \ -D SECURE_BOOT_ENABLE (See "build --help" for what's what.) The final firmware image is somewhere under the Build directory, you'll have to consult the FDF file referenced with FLASH_DEFINITION in the DSC file for finding out its name. For example, "ArmVirtPkg/ArmVirtQemu.dsc" references "ArmVirtPkg/ArmVirtQemu.fdf", and the latter has a section called [FD.QEMU_EFI], so the file you'd look for under Build is "QEMU_EFI.fd". For installing and/or running the firmware binary, further actions may be necessary, of course. (In case of QEMU, the QEMU_EFI.fd file needs to be padded to 64MB, etc etc, you can google the instructions in the Linaro and Fedora wikis.) Thanks Laszlo ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] Cross compiling EDK2 for Aarch64
Obviously I forgot one command (because it need not be reissued every time): On 10/08/15 21:17, Laszlo Ersek wrote: > On 10/08/15 10:24, Yehuda Yitschak wrote: >> Hello everyone >> >> I am new to the EDK2 projects and for starters I am trying to cross compile >> the project for aarch64 on an x86_64 host >> >> I looked around in Linaro website and Tiano-core website but couldn't find >> any instruction on how to _cross_ compile >> >> I tried to follow the instruction here: >> https://wiki.linaro.org/LEG/Engineering/Kernel/UEFI/build >> but when I try to compile using the "build" command the build script uses >> the x86 compiler and naturally it fails >> I tried working around this by setting the environment variable GCC48_BIN >> however then the build system tries to call "make" from the path in >> GCC48_BIN which off course fails >> >> I also found these instructions >> https://github.com/tianocore/tianocore.github.io/wiki/Unix-like_systems#Build_gcc_x64_UEFI_cross_compiler >> But I'm not sure they apply to aarch64. >> >> I appreciate any suggestions you can offer > > Here's how I do it: > > - download & install the latest cross-compiler toolchain from Linaro's > website, for example: > > https://releases.linaro.org/15.06/components/toolchain/binaries/4.8/aarch64-linux-gnu/ > > The tarball you most probably want is > > gcc-linaro-4.8-2015.06-x86_64_aarch64-linux-gnu.tar.xz > > assuming you use Linux. If you use Windows, I guess you need: > > gcc-linaro-4.8-2015.06-i686-mingw32_aarch64-linux-gnu.tar.xz > > Now extract this somewhere, and put its "bin" directory on your PATH. > Notice that it has filenames like "aarch64-linux-gnu-gcc". > > Once this is done, you can build ArmVirtQemu.dsc (for getting AARCH64 > firmware that runs on "qemu-system-aarch64 -M virt") like this: > > $ source edksetup.sh after this: $ make -C "$EDK_TOOLS_PATH" Thanks Laszlo > > $ export GCC48_AARCH64_PREFIX=aarch64-linux-gnu- > > $ build \ > -a AARCH64 \ > -t GCC48 \ > -p ArmVirtPkg/ArmVirtQemu.dsc \ > -n 8 \ > --report-file=.../build.aa64virt.report \ > --log=.../build.aa64virt.log \ > -b DEBUG \ > -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F \ > -D SECURE_BOOT_ENABLE > > (See "build --help" for what's what.) > > The final firmware image is somewhere under the Build directory, you'll > have to consult the FDF file referenced with FLASH_DEFINITION in the DSC > file for finding out its name. > > For example, "ArmVirtPkg/ArmVirtQemu.dsc" references > "ArmVirtPkg/ArmVirtQemu.fdf", and the latter has a section called > [FD.QEMU_EFI], so the file you'd look for under Build is "QEMU_EFI.fd". > > For installing and/or running the firmware binary, further actions may > be necessary, of course. (In case of QEMU, the QEMU_EFI.fd file needs to > be padded to 64MB, etc etc, you can google the instructions in the > Linaro and Fedora wikis.) > > Thanks > Laszlo > ___ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > ___ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel