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 \ |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 18 | file://0001-riscv64-adjust-type-definitions.patch \ |
| 19 | file://0001-riscv64-ignore-unknown-relocs.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 20 | " |
| 21 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 22 | SRC_URI[sha256sum] = "7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 23 | |
| 24 | COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*|riscv64.*)-linux" |
| 25 | COMPATIBLE_HOST:armv4 = 'null' |
| 26 | |
| 27 | do_configure:linux-gnux32:prepend() { |
| 28 | cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h |
| 29 | cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h |
| 30 | } |
| 31 | |
| 32 | def gnu_efi_arch(d): |
| 33 | import re |
| 34 | tarch = d.getVar("TARGET_ARCH") |
| 35 | if re.match("i[3456789]86", tarch): |
| 36 | return "ia32" |
| 37 | return tarch |
| 38 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 39 | do_compile:prepend() { |
| 40 | unset LDFLAGS |
| 41 | } |
| 42 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 43 | EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \ |
| 44 | 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \ |
| 45 | " |
| 46 | |
| 47 | # gnu-efi's Makefile treats prefix as toolchain prefix, so don't |
| 48 | # export it. |
| 49 | prefix[unexport] = "1" |
| 50 | |
| 51 | do_install() { |
| 52 | oe_runmake install INSTALLROOT="${D}" |
| 53 | } |
| 54 | |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 55 | FILES:${PN} += "${libdir}/*.lds ${libdir}/gnuefi/apps" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 56 | |
| 57 | # 64-bit binaries are expected for EFI when targeting X32 |
| 58 | INSANE_SKIP:${PN}-dev:append:linux-gnux32 = " arch" |
| 59 | INSANE_SKIP:${PN}-dev:append:linux-muslx32 = " arch" |
| 60 | |
| 61 | BBCLASSEXTEND = "native" |
| 62 | |
| 63 | # It doesn't support sse, its make.defaults sets: |
| 64 | # CFLAGS += -mno-mmx -mno-sse |
| 65 | # So also remove -mfpmath=sse from TUNE_CCARGS |
| 66 | TUNE_CCARGS:remove = "-mfpmath=sse" |
| 67 | |
| 68 | python () { |
| 69 | ccargs = d.getVar('TUNE_CCARGS').split() |
| 70 | if '-mx32' in ccargs: |
| 71 | # use x86_64 EFI ABI |
| 72 | ccargs.remove('-mx32') |
| 73 | ccargs.append('-m64') |
| 74 | d.setVar('TUNE_CCARGS', ' '.join(ccargs)) |
| 75 | } |