Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "Libraries for producing EFI binaries" |
| 2 | HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/" |
| 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." |
| 4 | SECTION = "devel" |
| 5 | LICENSE = "GPL-2.0-or-later | BSD-2-Clause" |
| 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 \ |
| 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 | |
| 15 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \ |
| 16 | file://parallel-make-archives.patch \ |
| 17 | file://gnu-efi-3.0.9-fix-clang-build.patch \ |
| 18 | " |
| 19 | |
| 20 | SRC_URI[sha256sum] = "931a257b9c5c1ba65ff519f18373c438a26825f2db7866b163e96d1b168f20ea" |
| 21 | |
| 22 | COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*|riscv64.*)-linux" |
| 23 | COMPATIBLE_HOST:armv4 = 'null' |
| 24 | |
| 25 | do_configure:linux-gnux32:prepend() { |
| 26 | cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h |
| 27 | cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h |
| 28 | } |
| 29 | |
| 30 | def gnu_efi_arch(d): |
| 31 | import re |
| 32 | tarch = d.getVar("TARGET_ARCH") |
| 33 | if re.match("i[3456789]86", tarch): |
| 34 | return "ia32" |
| 35 | return tarch |
| 36 | |
| 37 | EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \ |
| 38 | 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \ |
| 39 | " |
| 40 | |
| 41 | # gnu-efi's Makefile treats prefix as toolchain prefix, so don't |
| 42 | # export it. |
| 43 | prefix[unexport] = "1" |
| 44 | |
| 45 | do_install() { |
| 46 | oe_runmake install INSTALLROOT="${D}" |
| 47 | } |
| 48 | |
| 49 | FILES:${PN} += "${libdir}/*.lds" |
| 50 | |
| 51 | # 64-bit binaries are expected for EFI when targeting X32 |
| 52 | INSANE_SKIP:${PN}-dev:append:linux-gnux32 = " arch" |
| 53 | INSANE_SKIP:${PN}-dev:append:linux-muslx32 = " arch" |
| 54 | |
| 55 | BBCLASSEXTEND = "native" |
| 56 | |
| 57 | # It doesn't support sse, its make.defaults sets: |
| 58 | # CFLAGS += -mno-mmx -mno-sse |
| 59 | # So also remove -mfpmath=sse from TUNE_CCARGS |
| 60 | TUNE_CCARGS:remove = "-mfpmath=sse" |
| 61 | |
| 62 | python () { |
| 63 | ccargs = d.getVar('TUNE_CCARGS').split() |
| 64 | if '-mx32' in ccargs: |
| 65 | # use x86_64 EFI ABI |
| 66 | ccargs.remove('-mx32') |
| 67 | ccargs.append('-m64') |
| 68 | d.setVar('TUNE_CCARGS', ' '.join(ccargs)) |
| 69 | } |