blob: d27126603f8e1a26c343de78d399ad71a14f122a [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Libraries for producing EFI binaries"
2HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "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 Bishop19323692019-04-05 15:28:33 -04004SECTION = "devel"
5LICENSE = "GPLv2+ | BSD-2-Clause"
6LIC_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://inc/efishellparm.h;beginline=4;endline=11;md5=468b1231b05bbc84bae3a0d5774e3bb5 \
10 file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
11 file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
12 file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
13 file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
14 "
15
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050016SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \
Brad Bishop19323692019-04-05 15:28:33 -040017 file://parallel-make-archives.patch \
18 file://lib-Makefile-fix-parallel-issue.patch \
Brad Bishopf3f93bb2019-10-16 14:33:32 -040019 file://gnu-efi-3.0.9-fix-clang-build.patch \
Brad Bishop19323692019-04-05 15:28:33 -040020 "
21
Andrew Geissler1e34c2d2020-05-29 16:02:59 -050022SRC_URI[md5sum] = "926763ff37bc9db3a9035cec41eb2f45"
23SRC_URI[sha256sum] = "0196f2e1fd3c334b66e610a608a0e59233474c7a01bec7bc53989639aa327669"
Brad Bishop19323692019-04-05 15:28:33 -040024
25COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
26COMPATIBLE_HOST_armv4 = 'null'
27
28do_configure_linux-gnux32_prepend() {
29 cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h
30 cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h
31}
32
33def gnu_efi_arch(d):
34 import re
35 tarch = d.getVar("TARGET_ARCH")
36 if re.match("i[3456789]86", tarch):
37 return "ia32"
38 return tarch
39
40EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \
41 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \
42 "
43
44# gnu-efi's Makefile treats prefix as toolchain prefix, so don't
45# export it.
46prefix[unexport] = "1"
47
48do_install() {
49 oe_runmake install INSTALLROOT="${D}"
50}
51
52FILES_${PN} += "${libdir}/*.lds"
53
54# 64-bit binaries are expected for EFI when targeting X32
55INSANE_SKIP_${PN}-dev_append_linux-gnux32 = " arch"
56INSANE_SKIP_${PN}-dev_append_linux-muslx32 = " arch"
57
58BBCLASSEXTEND = "native"
59
60# It doesn't support sse, its make.defaults sets:
61# CFLAGS += -mno-mmx -mno-sse
62# So also remove -mfpmath=sse from TUNE_CCARGS
63TUNE_CCARGS_remove = "-mfpmath=sse"
64
65python () {
66 ccargs = d.getVar('TUNE_CCARGS').split()
67 if '-mx32' in ccargs:
68 # use x86_64 EFI ABI
69 ccargs.remove('-mx32')
70 ccargs.append('-m64')
71 d.setVar('TUNE_CCARGS', ' '.join(ccargs))
72}