Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "Libraries for producing EFI binaries" |
| 2 | HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 3 | DESCRIPTION = "GNU-EFI aims to Develop EFI applications for ARM-64, ARM-32, x86_64, IA-64 (IPF), IA-32 (x86), and MIPS platforms using the GNU toolchain and the EFI development environment." |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 4 | SECTION = "devel" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 5 | LICENSE = "GPL-2.0-or-later | BSD-2-Clause" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \ |
| 7 | file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \ |
| 8 | file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ |
| 10 | file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ |
| 11 | file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ |
| 12 | file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \ |
| 13 | " |
| 14 | |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 15 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | file://parallel-make-archives.patch \ |
| 17 | file://lib-Makefile-fix-parallel-issue.patch \ |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 18 | file://gnu-efi-3.0.9-fix-clang-build.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 19 | " |
| 20 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 21 | SRC_URI[sha256sum] = "b73b643a0d5697d1f396d7431448e886dd805668789578e3e1a28277c9528435" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame] | 23 | COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*|riscv64.*)-linux" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 24 | COMPATIBLE_HOST:armv4 = 'null' |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 26 | do_configure:linux-gnux32:prepend() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 27 | cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h |
| 28 | cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h |
| 29 | } |
| 30 | |
| 31 | def gnu_efi_arch(d): |
| 32 | import re |
| 33 | tarch = d.getVar("TARGET_ARCH") |
| 34 | if re.match("i[3456789]86", tarch): |
| 35 | return "ia32" |
| 36 | return tarch |
| 37 | |
| 38 | EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \ |
| 39 | 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \ |
| 40 | " |
| 41 | |
| 42 | # gnu-efi's Makefile treats prefix as toolchain prefix, so don't |
| 43 | # export it. |
| 44 | prefix[unexport] = "1" |
| 45 | |
| 46 | do_install() { |
| 47 | oe_runmake install INSTALLROOT="${D}" |
| 48 | } |
| 49 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 50 | FILES:${PN} += "${libdir}/*.lds" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 51 | |
| 52 | # 64-bit binaries are expected for EFI when targeting X32 |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 53 | INSANE_SKIP:${PN}-dev:append:linux-gnux32 = " arch" |
| 54 | INSANE_SKIP:${PN}-dev:append:linux-muslx32 = " arch" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 55 | |
| 56 | BBCLASSEXTEND = "native" |
| 57 | |
| 58 | # It doesn't support sse, its make.defaults sets: |
| 59 | # CFLAGS += -mno-mmx -mno-sse |
| 60 | # So also remove -mfpmath=sse from TUNE_CCARGS |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | TUNE_CCARGS:remove = "-mfpmath=sse" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 62 | |
| 63 | python () { |
| 64 | ccargs = d.getVar('TUNE_CCARGS').split() |
| 65 | if '-mx32' in ccargs: |
| 66 | # use x86_64 EFI ABI |
| 67 | ccargs.remove('-mx32') |
| 68 | ccargs.append('-m64') |
| 69 | d.setVar('TUNE_CCARGS', ' '.join(ccargs)) |
| 70 | } |