efivar: new package
efivar contains tools and libraries to manipulate EFI variables.
This package has some restrictions to build. It needs uchar.h which
apparently does not come in uClibc, and it also needs
__bswap_constant_*() definitions which are only present in glibc.
So, this package was limited to build with glibc toolchains.
Although it probably makes sense mostly on x86, x86-64 and aarch64
architectures, there are no architecture specific limitations which
would prevent it to build for other architectures, so this restriction
was not imposed. This package has been build-tested additionaly on many
architectures which support glibc, such as mips, MicroBlaze, sparc64,
ppc64. There were some build flag issues found when building to some of
these some architectures, although the flags can be also added in the
general case, so they were added by default.
It has also been found that in some host systems it failed to build due
to not generating the .pc files. This has been tracked to the use of
make 3.81, so a patch was prepared for it and was submitted upstream.
There's also a dependency on the linux/nvme.h header, which is somewhat
conturbed, as it has appeared in user space linux headers 3.12 and in
4.4 it was renamed. This has been solved by restricting it to build with
linux headers >= 3.12 and a patch from upstream was picked which fixes
it for linux headers >= 4.4.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
[Thomas:
- Pass TARGET_LDFLAGS in LDFLAGS.
- Pass -shared-libgcc only on Microblaze.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-04-21 03:23:55 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# efivar
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2019-06-23 04:46:14 +02:00
|
|
|
EFIVAR_VERSION = 37
|
2018-03-23 10:57:41 +01:00
|
|
|
EFIVAR_SITE = $(call github,rhboot,efivar,$(EFIVAR_VERSION))
|
2017-03-30 15:43:34 +02:00
|
|
|
EFIVAR_LICENSE = LGPL-2.1
|
efivar: new package
efivar contains tools and libraries to manipulate EFI variables.
This package has some restrictions to build. It needs uchar.h which
apparently does not come in uClibc, and it also needs
__bswap_constant_*() definitions which are only present in glibc.
So, this package was limited to build with glibc toolchains.
Although it probably makes sense mostly on x86, x86-64 and aarch64
architectures, there are no architecture specific limitations which
would prevent it to build for other architectures, so this restriction
was not imposed. This package has been build-tested additionaly on many
architectures which support glibc, such as mips, MicroBlaze, sparc64,
ppc64. There were some build flag issues found when building to some of
these some architectures, although the flags can be also added in the
general case, so they were added by default.
It has also been found that in some host systems it failed to build due
to not generating the .pc files. This has been tracked to the use of
make 3.81, so a patch was prepared for it and was submitted upstream.
There's also a dependency on the linux/nvme.h header, which is somewhat
conturbed, as it has appeared in user space linux headers 3.12 and in
4.4 it was renamed. This has been solved by restricting it to build with
linux headers >= 3.12 and a patch from upstream was picked which fixes
it for linux headers >= 4.4.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
[Thomas:
- Pass TARGET_LDFLAGS in LDFLAGS.
- Pass -shared-libgcc only on Microblaze.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-04-21 03:23:55 +02:00
|
|
|
EFIVAR_LICENSE_FILES = COPYING
|
|
|
|
EFIVAR_INSTALL_STAGING = YES
|
|
|
|
|
|
|
|
# -fPIC is needed at least on MIPS, otherwise fails to build shared
|
|
|
|
# -library.
|
|
|
|
EFIVAR_MAKE_OPTS = \
|
|
|
|
libdir=/usr/lib \
|
|
|
|
LDFLAGS="$(TARGET_LDFLAGS) -fPIC"
|
|
|
|
|
|
|
|
define EFIVAR_BUILD_CMDS
|
|
|
|
# makeguids is an internal host tool and must be built separately with
|
|
|
|
# $(HOST_CC), otherwise it gets cross-built.
|
|
|
|
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
efivar: fix build with old gcc versions
The efivar build process starts by building one tool for the host,
which is needed for the rest of the build. This tool currently fails
to build with old gcc versions because the gcc.specs used by efivar
specifies -std=gnu11. To address this, this patch:
- passes 'gcc_flags=' to the host build, so that the custom gcc specs
are not passed. They are in practice not needed for the build of
the simple makeguids host utility.
- passes -std=gnu99 instead of -std=c99 in the build of host
makeguids, because the source code uses anonymous structs and
unions, which requires std=gnu99 and not just std=c99
In addition, the build by default assumes that the target toolchain is
LTO capable, and that therefore you can call gcc-ar, gcc-nm and
gcc-ranlib. This fails short when the target toolchain is for example
gcc 4.7. To address this, we explicitly specify AR, NM and RANLIB to
be used, but pass them as make options instead of in the environment,
in order to override the values specified in the package Makefile.
Fixes:
http://autobuild.buildroot.net/results/fe40c1d139ba8ddeef3dafd5c1818a946f014d7c/
Cc: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-06-24 15:47:17 +02:00
|
|
|
CFLAGS="$(HOST_CFLAGS) -std=gnu99" \
|
|
|
|
$(MAKE) -C $(@D)/src gcc_cflags= makeguids
|
efivar: new package
efivar contains tools and libraries to manipulate EFI variables.
This package has some restrictions to build. It needs uchar.h which
apparently does not come in uClibc, and it also needs
__bswap_constant_*() definitions which are only present in glibc.
So, this package was limited to build with glibc toolchains.
Although it probably makes sense mostly on x86, x86-64 and aarch64
architectures, there are no architecture specific limitations which
would prevent it to build for other architectures, so this restriction
was not imposed. This package has been build-tested additionaly on many
architectures which support glibc, such as mips, MicroBlaze, sparc64,
ppc64. There were some build flag issues found when building to some of
these some architectures, although the flags can be also added in the
general case, so they were added by default.
It has also been found that in some host systems it failed to build due
to not generating the .pc files. This has been tracked to the use of
make 3.81, so a patch was prepared for it and was submitted upstream.
There's also a dependency on the linux/nvme.h header, which is somewhat
conturbed, as it has appeared in user space linux headers 3.12 and in
4.4 it was renamed. This has been solved by restricting it to build with
linux headers >= 3.12 and a patch from upstream was picked which fixes
it for linux headers >= 4.4.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
[Thomas:
- Pass TARGET_LDFLAGS in LDFLAGS.
- Pass -shared-libgcc only on Microblaze.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-04-21 03:23:55 +02:00
|
|
|
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
efivar: fix build with old gcc versions
The efivar build process starts by building one tool for the host,
which is needed for the rest of the build. This tool currently fails
to build with old gcc versions because the gcc.specs used by efivar
specifies -std=gnu11. To address this, this patch:
- passes 'gcc_flags=' to the host build, so that the custom gcc specs
are not passed. They are in practice not needed for the build of
the simple makeguids host utility.
- passes -std=gnu99 instead of -std=c99 in the build of host
makeguids, because the source code uses anonymous structs and
unions, which requires std=gnu99 and not just std=c99
In addition, the build by default assumes that the target toolchain is
LTO capable, and that therefore you can call gcc-ar, gcc-nm and
gcc-ranlib. This fails short when the target toolchain is for example
gcc 4.7. To address this, we explicitly specify AR, NM and RANLIB to
be used, but pass them as make options instead of in the environment,
in order to override the values specified in the package Makefile.
Fixes:
http://autobuild.buildroot.net/results/fe40c1d139ba8ddeef3dafd5c1818a946f014d7c/
Cc: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-06-24 15:47:17 +02:00
|
|
|
AR=$(TARGET_AR) NM=$(TARGET_NM) RANLIB=$(TARGET_RANLIB) \
|
efivar: new package
efivar contains tools and libraries to manipulate EFI variables.
This package has some restrictions to build. It needs uchar.h which
apparently does not come in uClibc, and it also needs
__bswap_constant_*() definitions which are only present in glibc.
So, this package was limited to build with glibc toolchains.
Although it probably makes sense mostly on x86, x86-64 and aarch64
architectures, there are no architecture specific limitations which
would prevent it to build for other architectures, so this restriction
was not imposed. This package has been build-tested additionaly on many
architectures which support glibc, such as mips, MicroBlaze, sparc64,
ppc64. There were some build flag issues found when building to some of
these some architectures, although the flags can be also added in the
general case, so they were added by default.
It has also been found that in some host systems it failed to build due
to not generating the .pc files. This has been tracked to the use of
make 3.81, so a patch was prepared for it and was submitted upstream.
There's also a dependency on the linux/nvme.h header, which is somewhat
conturbed, as it has appeared in user space linux headers 3.12 and in
4.4 it was renamed. This has been solved by restricting it to build with
linux headers >= 3.12 and a patch from upstream was picked which fixes
it for linux headers >= 4.4.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
[Thomas:
- Pass TARGET_LDFLAGS in LDFLAGS.
- Pass -shared-libgcc only on Microblaze.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-04-21 03:23:55 +02:00
|
|
|
$(EFIVAR_MAKE_OPTS) \
|
|
|
|
all
|
|
|
|
endef
|
|
|
|
|
|
|
|
define EFIVAR_INSTALL_STAGING_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
|
|
|
$(EFIVAR_MAKE_OPTS) \
|
|
|
|
DESTDIR="$(STAGING_DIR)" \
|
|
|
|
install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define EFIVAR_INSTALL_TARGET_CMDS
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
|
|
|
$(EFIVAR_MAKE_OPTS) \
|
|
|
|
DESTDIR="$(TARGET_DIR)" \
|
|
|
|
install
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|