Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RA] build fails: undefined reference to 'gfx_ctx_mali_fbdev' #8114

Closed
5schatten opened this issue Jan 28, 2019 · 9 comments · Fixed by #8120
Closed

[RA] build fails: undefined reference to 'gfx_ctx_mali_fbdev' #8114

5schatten opened this issue Jan 28, 2019 · 9 comments · Fixed by #8120
Labels
bisected Issues which have been bisected to a specific commit or change. qb

Comments

@5schatten
Copy link

5schatten commented Jan 28, 2019

Description

Build fails for Vim (S905X) Mali target.

Expected behavior

Should build fine.

Actual behavior

obj-unix/release/gfx/video_driver.o:video_driver.c:gfx_ctx_drivers: error: undefined reference to 'gfx_ctx_mali_fbdev'
collect2: error: ld returned 1 exit status
make: *** [Makefile:195: retroarch] Error 1

Build log -> https://pastebin.com/drC5qyLb

Steps to reproduce the bug

Update your lokal repo to commit 2bd70ab or later and try to compile it for Mali.

Bisect Results

This commit builds fine b2e8a7a <- latest working commit

Environment information

Latest LibreELEC 9.0 build system -> cross compile

Package file: https://github.com/5schatten/LibreELEC.tv/blob/libreelec-9.0-rr/packages/5schatten/emulation-frontends/retroarch/package.mk

@orbea
Copy link
Contributor

orbea commented Jan 28, 2019

Can you find the first bad commit so we know when this started?

I don't have any mali hardware to test.

@orbea
Copy link
Contributor

orbea commented Jan 28, 2019

Please share a full configure and build log.

Does this work?

PKG_CONF_PATH=none ./configure
make

@5schatten
Copy link
Author

5schatten commented Jan 28, 2019

@orbea well... I already included all of these information. There is a full build log included and the last working commit was b2e8a7a and this is the package https://github.com/5schatten/LibreELEC.tv/blob/libreelec-9.0-rr/packages/5schatten/emulation-frontends/retroarch/package.mk

I'm rebuilding an RPi image right now to see if it limited to Mali stuff.

@orbea
Copy link
Contributor

orbea commented Jan 28, 2019

Sorry, I missed the build log and only saw the package.mk.

There are a few commits between b2e8a7a and 2bd70ab so I'm not sure which one is the first bad one.

Now that I am looking at the build log I see you are not building the relevant mali file.

OBJ += gfx/drivers_context/mali_fbdev_ctx.o

I suppose the root issue is this check_pkgconf check is failing.

Checking presence of package egl ... no

check_val '' EGL "-l${VC_PREFIX}EGL $EXTRA_GL_LIBS" '' "${VC_PREFIX}egl" '' ''

The issue probably started here.

2bd70ab#diff-64b12eb68f319652c8ff364e7ef9f561R244

Where before it would fall back to check_lib if check_pkgconf failed which unfortunately subtly broke the version checks...

@orbea
Copy link
Contributor

orbea commented Jan 28, 2019

So I suppose the good solution is to find out why your pkg-config is not finding egl.pc and how to fix it...

@orbea
Copy link
Contributor

orbea commented Jan 28, 2019

Alternatively this will probably work even if the previous suggestion would be better.

diff --git a/qb/config.libs.sh b/qb/config.libs.sh
index fd9a4cdf31..e58a12b4f2 100644
--- a/qb/config.libs.sh
+++ b/qb/config.libs.sh
@@ -107,7 +107,7 @@ if [ "$HAVE_SSE" = "yes" ]; then
 fi
 
 if [ "$HAVE_EGL" != "no" ] && [ "$OS" != 'Win32' ]; then
-   check_val '' EGL "-l${VC_PREFIX}EGL $EXTRA_GL_LIBS" '' "${VC_PREFIX}egl" '' ''
+   check_val '' EGL "-l${VC_PREFIX}EGL $EXTRA_GL_LIBS" '' "${VC_PREFIX}egl" '' '' true
    if [ "$HAVE_EGL" = "yes" ]; then
       EGL_LIBS="$EGL_LIBS $EXTRA_GL_LIBS"
    fi
diff --git a/qb/qb.libs.sh b/qb/qb.libs.sh
index 1dfaeb7f99..8a253ded95 100644
--- a/qb/qb.libs.sh
+++ b/qb/qb.libs.sh
@@ -240,9 +240,10 @@ check_switch()
 # $5 = package
 # $6 = version [checked only if non-empty]
 # $7 = critical error message [checked only if non-empty]
+# $8 = forces check_lib when check_pkgconf fails when true [checked only if non-empty]
 check_val()
 {      check_pkgconf "$2" "$5" "$6" "${7:-}"
-       [ "$PKG_CONF_PATH" = "none" ] || return 0
+       [ "$PKG_CONF_PATH" = "none" ] || [ "${8:-}" = true ] || return 0
        tmpval="$(eval "printf %s \"\$HAVE_$2\"")"
        oldval="$(eval "printf %s \"\$TMP_$2\"")"
        if [ "$tmpval" = 'no' ] && [ "$oldval" != 'no' ]; then

@orbea
Copy link
Contributor

orbea commented Jan 29, 2019

Basically this is a mali bug that was fixed in 2014, but no one bothered to merge the PR...

linux-sunxi/sunxi-mali#8

And further background.

linux-sunxi/meta-sunxi#24

I suppose the above fix is good enough...

@5schatten
Copy link
Author

5schatten commented Jan 29, 2019

@orbea
In fact Generic builds come with egl.pc created by the Mesa 3D package. RPi builds provide brcmegl.pc but the package used by Amlogic builds is missing something similar.

I asked the LE devs about this maybe they have a clue why it's missing. Lakka 3.0 will probably have this issue as well if they use the LE 9.0 repo.

@orbea
Copy link
Contributor

orbea commented Jan 29, 2019

I think the main problem is that even if its fixed everywhere today it will take time for users to update their systems to include these fixes. And I would not be surprised if more than one vendor does this.

Hopefully everyone will move to using only mesa in time and this problem will go away.

@orbea orbea added the bisected Issues which have been bisected to a specific commit or change. label Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bisected Issues which have been bisected to a specific commit or change. qb
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants