Bug 80034

Summary: compile error eglGetSyncValuesCHROMIUM undeclared
Product: Mesa Reporter: charlie <bug0xa3d2>
Component: EGLAssignee: mesa-dev
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: mesa build log

Description charlie 2014-06-14 20:03:16 UTC
Created attachment 101063 [details]
mesa build log

mesa compile error: 

eglapi.c:1097:48: error: 'eglGetSyncValuesCHROMIUM' undeclared (first use in this function)

Here are my build flags:

export CONFFLAGS=" \
--enable-${LIBDIRSUFFIX}-bit \
--prefix=${XBUILD} \
--libdir=${XBUILD}/lib${LIBDIRSUFFIX} \
--exec-prefix=${XBUILD}  \
--bindir=${XBUILD}/bin  \
--sbindir=${XBUILD}/sbin  \
--sysconfdir=${XBUILD}/etc  \
--datadir=${XBUILD}/share  \
--includedir=${XBUILD}/include  \
--libexecdir=${XBUILD}/libexec  \
--localstatedir=${XBUILD}/var  \
--mandir=${XBUILD}/share/man  \
--infodir=${XBUILD}/share/info \
--enable-xcb \
--with-kernel-source=/usr/src/linux \
--disable-intel \
--disable-nouveau \
--disable-vmwgfx \
--disable-nouveau-experimental-api \
--enable-xinput \
--silent \
--enable-silent-rules \
--disable-ipv6 \
--enable-egl \
--with-dri-drivers=radeon \
--disable-gallium-r300 \
--enable-glamor \
--with-egl-platforms=drm,x11 \
--sysconfdir=/etc \
--with-llvm-shared-libs        \
--enable-gbm \
--enable-gallium-egl          \
--enable-gallium-llvm \
--enable-gallium-gbm          \
--enable-glx-tls              \
--enable-texture-float        \
--with-dri-driverdir=${XBUILD}/lib${LIBDIRSUFFIX}/xorg/modules/dri  \
--with-dri-searchpath=${XBUILD}/lib${LIBDIRSUFFIX}/xorg/modules/dri,${XBUILD}/lib${LIBDIRSUFFIX}/dri  \
--enable-xa \
--enable-xorg \
--with-gallium-drivers=radeonsi \
--disable-systemd-logind \
--build=$ARCH-pc-linux \
--host=$ARCH-pc-linux \
--target=$ARCH-pc-linux"
Comment 1 Emil Velikov 2014-06-14 21:20:34 UTC
(In reply to comment #0)
> Created attachment 101063 [details]
> mesa build log
> 
Which version of mesa is this ? Is this a regression ?

> mesa compile error: 
> 
> eglapi.c:1097:48: error: 'eglGetSyncValuesCHROMIUM' undeclared (first use in
> this function)
> 
Strange...

The symbols is defined in
include/EGL/eglextchromium.h

with is included via (at least)
include/EGL/eglext.h
src/egl/main/egltypedefs.h
src/egl/main/eglcontext.h
src/egl/main/eglapi.c

I'm assuming that you have some thing that is messing with CFLAGS.

> Here are my build flags:
> 
...
> --prefix=${XBUILD} \
> --libdir=${XBUILD}/lib${LIBDIRSUFFIX} \
> --exec-prefix=${XBUILD}  \
> --bindir=${XBUILD}/bin  \
> --sbindir=${XBUILD}/sbin  \
> --sysconfdir=${XBUILD}/etc  \
> --datadir=${XBUILD}/share  \
> --includedir=${XBUILD}/include  \
> --libexecdir=${XBUILD}/libexec  \
> --localstatedir=${XBUILD}/var  \
> --mandir=${XBUILD}/share/man  \
> --infodir=${XBUILD}/share/info \
IMHO from the above flags you should only need the prefix and libdir

> --sysconfdir=/etc \
Missing ${XBUILD} ? Might be worth dropping this one as well.

> --disable-intel \
> --disable-nouveau \
> --disable-vmwgfx \
> --disable-nouveau-experimental-api \
These seem like libdrm configure flags. Not sure what are they doing here.

> --enable-glamor \
> --enable-xcb \
> --with-kernel-source=/usr/src/linux \
> --enable-xinput \
> --disable-ipv6 \
> --disable-systemd-logind \
What are these doing here ?

> --build=$ARCH-pc-linux \
> --host=$ARCH-pc-linux \
> --target=$ARCH-pc-linux"
Please avoid setting these if they are identical. IIRC there was a bug (automake/autoconf) that was incorrectly setting the cross-compile variable.

If nuking the above does not resolve the problem I would recommend explicitly purging CFLAGS and CPPFLAGS before calling the configure, and bisecting the options to see which one is causing the issue.

Cheers
Comment 2 charlie 2014-06-16 06:25:31 UTC
>Which version of mesa is this ? Is this a regression ?

mesa git and probably a regression.

>I'm assuming that you have some thing that is messing with CFLAGS.

I don't believe the CFLAGS have changed since I last successfully built mesa with them.

export CFLAGS="-m${LIBDIRSUFFIX} -O3 -march=native -pipe"
export CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
export CPPFLAGS="${CXXLAGS} -I${XBUILD}/include -L${XBUILD}/lib${LIBDIRSUFFIX}:${XBUILD}/lib:/usr/lib${LIBDIRSUFFIX}"

I disabled the CFLAGS/CXXFLAGS/CPPFLAGS variables and mesa built successfully.

>Missing ${XBUILD} ? Might be worth dropping this one as well.

Not missing--it is a variable pointing to the installation directory.

>These seem like libdrm configure flags. Not sure what are they doing here.
>What are these doing here ?

The above statements suggest you never used http://cgit.freedesktop.org/xorg/util/modular/plain/build.sh to build all of X.  I assume you are compiling mesa by hand or are on another platform.

>Please avoid setting these if they are identical.  IIRC there was a bug (automake/autoconf) that was incorrectly setting the cross-compile variable.

Thanks for the heads up.  Unsetting build/host/target has no effect on the building bug.

My conclusion is that something changed in the mesa code that will not allow me to use my old CFLAGS/CXXFLAGS/CPPFLAGS.

It might take me a while to figure out where in git the change effects the build.
Comment 3 Tapani Pälli 2014-06-16 07:43:14 UTC
(In reply to comment #2)
> export CFLAGS="-m${LIBDIRSUFFIX} -O3 -march=native -pipe"
> export CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
> export CPPFLAGS="${CXXLAGS} -I${XBUILD}/include
> -L${XBUILD}/lib${LIBDIRSUFFIX}:${XBUILD}/lib:/usr/lib${LIBDIRSUFFIX}"

Note that there is typo setting CPPFLAGS ("CXXLAGS"). Also feeding CXXFLAGS to CPPFLAGS can potentially cause problems (?) At least you should see following errors when compiling:

"cc1: warning: command line option '-fvisibility-inlines-hidden' is valid for C++/ObjC++ but not for C [enabled by default]"

(just noticed this when I tried to reproduce the bug)
Comment 4 Emil Velikov 2014-06-16 10:37:58 UTC
(In reply to comment #2)
...
> I don't believe the CFLAGS have changed since I last successfully built mesa
> with them.
> 
> export CFLAGS="-m${LIBDIRSUFFIX} -O3 -march=native -pipe"
> export CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
> export CPPFLAGS="${CXXLAGS} -I${XBUILD}/include
> -L${XBUILD}/lib${LIBDIRSUFFIX}:${XBUILD}/lib:/usr/lib${LIBDIRSUFFIX}"
> 
> I disabled the CFLAGS/CXXFLAGS/CPPFLAGS variables and mesa built
> successfully.
> 
I would recommend setting PKG_CONFIG_PATH/PKG_CONFIG_LIBDIR which should make the above CPPFLAGS obsolete. Your choice of CPPFLAGS is very hacky imho.

Also as Tapani mentioned CPPFLAGS="${CXXLAGS}... may not be the best of ideas.

> >Missing ${XBUILD} ? Might be worth dropping this one as well.
> 
> Not missing--it is a variable pointing to the installation directory.
> 
AFAIK as one provides a new sysconfdir, the value is independent of PREFIX/EPREFIX. Thus setting it to /etc while the latter two are ${XBUILD} is not something I've seen and/or encourage.

> >These seem like libdrm configure flags. Not sure what are they doing here.
> >What are these doing here ?
> 
> The above statements suggest you never used
> http://cgit.freedesktop.org/xorg/util/modular/plain/build.sh to build all of
> X.  I assume you are compiling mesa by hand or are on another platform.
> 
Guilty, I've never used the script as mesa's build has changed substantially since it originated. I use a simple 10-liner script that sets the options that I need from mesa.

...
> It might take me a while to figure out where in git the change effects the
> build.
Please set PKG_CONFIG_... as suggested above and drop the CPPFLAGS altogether. Mesa's build has always been less than stellar, and allowed people to exploit it to the limits. Recent changes have made things a bit saner.
Comment 5 charlie 2014-06-16 23:45:59 UTC
Solved. Mesa compiled fine after I fixed the typo in CPPFLAGS but I removed CPPFLAGS as suggested anyway.

>I use a simple 10-liner script that sets the options that I need from mesa.

People, your time was not a total waste as I will incorporate all your tips and suggestions I learned here maybe in a build script or .bash_profile so other people can test mesa more easily in the future.

>Thus setting it to /etc while the latter two are ${XBUILD} is not something I've seen and/or encourage.

I probably did that so that I could use one /etc for 3 different installs of X on my system.

Thanks guys.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.