kumquat-buildroot/package/sunxi-mali/sunxi-mali.mk
Romain Naour 95426afd59 package/sunxi-mali: remove sunxi-mali libMali for r2p4 Mali kernel modules
sunxi-mali userspace drivers (libMali.so) for r2p4 Mali kernel modules
are linked against libUMP.so.2 but libump package in Buildroot only
provide libUMP.so.3.

In upstream commit 1c5063f43cdc9de341c0d63b2e3921cab86c7742 [1], library
versioning was added. For the r3p* libraries, libUMP.so.3 is used (and
provided by Buildroot libump package), but for the r2p* libraries,
libUMP.so.2 is used (and not provided by Buildroot libump package).

Due to this any program or library trying to link with -lGLESv2 or -lEGL
will fail with the following error:

arm-none-linux-gnueabi/bin/ld: warning: libUMP.so.2, needed by output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libMali.so, not found (try using -rpath or -rpath-link)

output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libEGL.so: undefined reference to `ump_close'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libEGL.so: undefined reference to `ump_mapped_pointer_get'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libEGL.so: undefined reference to `ump_secure_id_get'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libEGL.so: undefined reference to `ump_mapped_pointer_release'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libMali.so: undefined reference to `ump_reference_add'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libMali.so: undefined reference to `ump_size_get'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libEGL.so: undefined reference to `ump_reference_release'
output/host/usr/arm-buildroot-linux-gnueabi/sysroot/armv4t/usr/lib/libEGL.so: undefined reference to `ump_open'
collect2: error: ld returned 1 exit status

Since nothing provides libUMP.so.2, this commit removes the
BR2_PACKAGE_SUNXI_MALI_R2P4 option and adds the BR2_ARM_EABIHF
dependency directly to sunxi-mali package.

Fixes:

  http://autobuild.buildroot.net/results/8d0/8d0b78798abf0c4ca124952d0d0455da6f8fa14f/

[1] 1c5063f43c
[2] http://lists.busybox.net/pipermail/buildroot/2017-February/183500.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Francois Perrad <francois.perrad@gadz.org>
[Thomas: fix conflicts when applying on master, tweak commit log.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-05-07 16:14:29 +02:00

74 lines
2.4 KiB
Makefile

################################################################################
#
# sunxi-mali
#
################################################################################
# last sha1 character dropped to ensure unique filename
SUNXI_MALI_VERSION = d343311efc8db166d8371b28494f0f27b6a5872
SUNXI_MALI_SITE = https://github.com/linux-sunxi/sunxi-mali
SUNXI_MALI_SITE_METHOD = git
# Get the sunxi-mali-proprietary libraries
SUNXI_MALI_GIT_SUBMODULES = YES
SUNXI_MALI_INSTALL_STAGING = YES
SUNXI_MALI_DEPENDENCIES = libump
SUNXI_MALI_PROVIDES = libegl libgles
# The options below must be provided in the environment. Providing these
# through options overrides the value and prevents the makefiles from
# appending to these variables. This is used throughout the sunxi-mali build
# system.
#
# Furthermore, the -lm -dl -lpthread options are included due to a possible bug
# in the way the linaro 2013.06 toolchain handles shared libraries.
SUNXI_MALI_MAKE_ENV = \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) -lm -ldl -lpthread" \
$(TARGET_MAKE_ENV)
SUNXI_MALI_MAKE_OPTS += EGL_TYPE=framebuffer \
ABI=armhf
ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P0),y)
SUNXI_MALI_MAKE_OPTS += VERSION=r3p0
endif
ifeq ($(BR2_PACKAGE_SUNXI_MALI_R3P1),y)
SUNXI_MALI_MAKE_OPTS += VERSION=r3p1
endif
define SUNXI_MALI_BUILD_CMDS
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) all
$(TARGET_CC) $(TARGET_CFLAGS) -o $(@D)/version/version \
$(@D)/version/version.c
endef
define SUNXI_MALI_INSTALL_STAGING_CMDS
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) \
$(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
# test must be built after install because it depends on headers that are
# generated during the install above.
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D) $(SUNXI_MALI_MAKE_OPTS) test
$(INSTALL) -D -m 0644 package/sunxi-mali/egl.pc \
$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
$(INSTALL) -D -m 0644 package/sunxi-mali/glesv2.pc \
$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
endef
define SUNXI_MALI_INSTALL_TARGET_CMDS
$(SUNXI_MALI_MAKE_ENV) $(MAKE) -C $(@D)/lib \
$(SUNXI_MALI_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
$(if $(BR2_PACKAGE_SUNXI_MALI_DBG),
$(INSTALL) -m 755 $(@D)/version/version $(TARGET_DIR)/usr/bin/maliver; \
$(INSTALL) -m 755 $(@D)/test/test $(TARGET_DIR)/usr/bin/malitest
)
endef
define SUNXI_MALI_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/sunxi-mali/S80mali \
$(TARGET_DIR)/etc/init.d/S80mali
endef
$(eval $(generic-package))