1edf9fc194
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>
58 lines
1.7 KiB
Makefile
58 lines
1.7 KiB
Makefile
################################################################################
|
|
#
|
|
# efivar
|
|
#
|
|
################################################################################
|
|
|
|
EFIVAR_VERSION = 0.23
|
|
EFIVAR_SITE = $(call github,rhinstaller,efivar,$(EFIVAR_VERSION))
|
|
EFIVAR_LICENSE = LGPLv2.1
|
|
EFIVAR_LICENSE_FILES = COPYING
|
|
EFIVAR_DEPENDENCIES = popt
|
|
EFIVAR_INSTALL_STAGING = YES
|
|
|
|
# BINTARGETS is set to skip efivar-static which requires static popt,
|
|
# and since we depend on glibc, we will never be built in a
|
|
# static-only environment.
|
|
# -fPIC is needed at least on MIPS, otherwise fails to build shared
|
|
# -library.
|
|
EFIVAR_MAKE_OPTS = \
|
|
libdir=/usr/lib \
|
|
BINTARGETS=efivar \
|
|
LDFLAGS="$(TARGET_LDFLAGS) -fPIC"
|
|
|
|
# Explicitly linking with shared libgcc is required on MicroBlaze,
|
|
# otherwise it fails due to FDE encoding in static libgcc.
|
|
ifeq ($(BR2_microblaze),y)
|
|
EFIVAR_MAKE_OPTS += SOFLAGS="-shared -shared-libgcc"
|
|
endif
|
|
|
|
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) \
|
|
CFLAGS="$(HOST_CFLAGS) -std=gnu99" \
|
|
$(MAKE) -C $(@D)/src gcc_cflags= makeguids
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
|
AR=$(TARGET_AR) NM=$(TARGET_NM) RANLIB=$(TARGET_RANLIB) \
|
|
$(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))
|