Bug 30203 - Mesa 7.8.3-rc1 fails to compile
Summary: Mesa 7.8.3-rc1 fails to compile
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-15 01:15 UTC by Jos van Wolput
Modified: 2010-09-16 22:30 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
link to pthread (848 bytes, patch)
2010-09-15 02:59 UTC, Chia-I Wu
Details | Splinter Review

Description Jos van Wolput 2010-09-15 01:15:00 UTC
Mesa 7.8.3-rc1 from git branch 7.8 fails to compile.
make shows the following error:
---
/usr/bin/ld: xeglthreads.o: undefined reference to symbol 'pthread_join@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_join@@GLIBC_2.2.5' is defined in DSO //lib64/libpthread.so.0 so try adding it to the linker command line
//lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [xeglthreads] Error 1
make[2]: Leaving directory `/home/jos/src/xorg/mesa-7.8/progs/egl'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/jos/src/xorg/mesa-7.8/progs'
make: *** [default] Error 1
---
Comment 1 Chia-I Wu 2010-09-15 02:59:33 UTC
Created attachment 38719 [details] [review]
link to pthread

Does this patch help?
Comment 2 Jos van Wolput 2010-09-15 03:40:21 UTC
(In reply to comment #1)
> Does this patch help?
I applied your patch but now I get another compilation error:
---
/usr/bin/ld: xeglthreads.o: undefined reference to symbol 'XNextEvent'
/usr/bin/ld: note: 'XNextEvent' is defined in DSO //usr/lib64/libX11.so.6 so try adding it to the linker command line
//usr/lib64/libX11.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [xeglthreads] Error 1
make[2]: Leaving directory `/home/jos/src/xorg/mesa-7.8/progs/egl'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/jos/src/xorg/mesa-7.8/progs'
make: *** [default] Error 1
---
Comment 3 Chia-I Wu 2010-09-15 03:48:54 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Does this patch help?
> I applied your patch but now I get another compilation error:
> ---
> /usr/bin/ld: xeglthreads.o: undefined reference to symbol 'XNextEvent'
> /usr/bin/ld: note: 'XNextEvent' is defined in DSO //usr/lib64/libX11.so.6 so
> try adding it to the linker command line
> //usr/lib64/libX11.so.6: could not read symbols: Invalid operation
> collect2: ld returned 1 exit status
Does adding -lX11 to the Makefile help?  How do you configure your build and what does X11_LIBS in $(TOP)/configs/current expand to?
> make[2]: *** [xeglthreads] Error 1
> make[2]: Leaving directory `/home/jos/src/xorg/mesa-7.8/progs/egl'
> make[1]: *** [subdirs] Error 1
> make[1]: Leaving directory `/home/jos/src/xorg/mesa-7.8/progs'
> make: *** [default] Error 1
> ---
Comment 4 Jos van Wolput 2010-09-15 04:57:42 UTC
(In reply to comment #3)

I configure with ./autogen.sh --prefix=/usr --enable-debug=no  --disable-gallium  --with-dri-drivers=r600
which always works when compiling mesa 7.9
---
jos@debian:~/src/xorg/mesa-7.8$ ./autogen.sh --prefix=/usr --enable-debug=no  --disable-gallium  --with-dri-drivers=r600
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf
autoreconf: configure.ac: not using Autoheader
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gmake... no
checking for make... make
checking for makedepend... /usr/bin/makedepend
checking for sed... /bin/sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether gcc version is sufficient... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking whether gcc supports -fvisibility=hidden... yes
checking whether to enable assembly... yes, x86_64
checking for gcc option to produce PIC... -fPIC
checking for dlopen... no
checking for dlopen in -ldl... yes
checking for posix_memalign... yes
checking pkg-config files for X11 are available... yes
checking for LIBDRM... yes
checking for DRI2PROTO... yes
checking for GLPROTO... yes
checking for DRIGL... yes
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for XML_ParserCreate in -lexpat... yes
checking for LIBDRM_RADEON... yes
checking for EGL_DRI2... yes
checking for GLW... yes
checking for GLUT... yes
checking for XORG... yes
checking for XEXT... yes
configure: creating ./config.status
config.status: creating configs/autoconf
config.status: executing configs commands

        prefix:          /usr
        exec_prefix:     ${prefix}
        libdir:          ${exec_prefix}/lib
        includedir:      ${prefix}/include

        Driver:          dri
        OSMesa:          no
        DRI drivers:     r600
        DRI driver dir:  ${libdir}/dri
        Use XCB:         no

        Gallium:         no

        Shared libs:     yes
        Static libs:     no
        EGL:             glx dri2
        GLU:             yes
        GLw:             yes (Motif: no)
        glut:            yes
        Demos:           xdemos egl demos redbook samples glsl

        CFLAGS:          -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing -fPIC
        CXXFLAGS:        -g -O2 -Wall -fno-strict-aliasing -fPIC
        Macros:          -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XEXTPROTO_71 -DUSE_X86_64_ASM

        Run 'make' to build Mesa
---
Comment 5 Chia-I Wu 2010-09-15 08:21:20 UTC
(In reply to comment #4)
> (In reply to comment #3)
> 
> I configure with ./autogen.sh --prefix=/usr --enable-debug=no 
> --disable-gallium  --with-dri-drivers=r600
> which always works when compiling mesa 7.9
> ---
> jos@debian:~/src/xorg/mesa-7.8$ ./autogen.sh --prefix=/usr --enable-debug=no 
> --disable-gallium  --with-dri-drivers=r600
> autoreconf: Entering directory `.'
> autoreconf: configure.ac: not using Gettext
> autoreconf: running: aclocal
> autoreconf: configure.ac: tracing
> autoreconf: configure.ac: not using Libtool
> autoreconf: running: /usr/bin/autoconf
> autoreconf: configure.ac: not using Autoheader
> autoreconf: configure.ac: not using Automake
> autoreconf: Leaving directory `.'
> checking build system type... x86_64-unknown-linux-gnu
> checking host system type... x86_64-unknown-linux-gnu
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking how to run the C preprocessor... gcc -E
> checking for gcc... (cached) gcc
> checking whether we are using the GNU C compiler... (cached) yes
> checking whether gcc accepts -g... (cached) yes
> checking for gcc option to accept ISO C89... (cached) none needed
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking for gmake... no
> checking for make... make
> checking for makedepend... /usr/bin/makedepend
> checking for sed... /bin/sed
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether gcc version is sufficient... yes
> checking for pkg-config... /usr/bin/pkg-config
> checking pkg-config is at least version 0.9.0... yes
> checking whether gcc supports -fvisibility=hidden... yes
> checking whether to enable assembly... yes, x86_64
> checking for gcc option to produce PIC... -fPIC
> checking for dlopen... no
> checking for dlopen in -ldl... yes
> checking for posix_memalign... yes
> checking pkg-config files for X11 are available... yes
It should then print "checking for X11... yes" and set X11_LIBS to -lX11.

Can you show me the result of executing "pkg-config --libs x11" on your system?  Also, you may want to upgrade your autoconf, pkg-config, and libx11-dev and see if it helps?

7.9 compiles fine because the demos are moved to another repository.
> checking for LIBDRM... yes
> checking for DRI2PROTO... yes
> checking for GLPROTO... yes
> checking for DRIGL... yes
> checking expat.h usability... yes
> checking expat.h presence... yes
> checking for expat.h... yes
> checking for XML_ParserCreate in -lexpat... yes
> checking for LIBDRM_RADEON... yes
> checking for EGL_DRI2... yes
> checking for GLW... yes
> checking for GLUT... yes
> checking for XORG... yes
> checking for XEXT... yes
> configure: creating ./config.status
> config.status: creating configs/autoconf
> config.status: executing configs commands
> 
>         prefix:          /usr
>         exec_prefix:     ${prefix}
>         libdir:          ${exec_prefix}/lib
>         includedir:      ${prefix}/include
> 
>         Driver:          dri
>         OSMesa:          no
>         DRI drivers:     r600
>         DRI driver dir:  ${libdir}/dri
>         Use XCB:         no
> 
>         Gallium:         no
> 
>         Shared libs:     yes
>         Static libs:     no
>         EGL:             glx dri2
>         GLU:             yes
>         GLw:             yes (Motif: no)
>         glut:            yes
>         Demos:           xdemos egl demos redbook samples glsl
> 
>         CFLAGS:          -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math
> -fvisibility=hidden -fno-strict-aliasing -fPIC
>         CXXFLAGS:        -g -O2 -Wall -fno-strict-aliasing -fPIC
>         Macros:          -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN
> -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING
> -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XEXTPROTO_71 -DUSE_X86_64_ASM
> 
>         Run 'make' to build Mesa
> ---
Comment 6 Jos van Wolput 2010-09-15 20:40:39 UTC
(In reply to comment #5)
> 
> Can you show me the result of executing "pkg-config --libs x11" on your system?
>  Also, you may want to upgrade your autoconf, pkg-config, and libx11-dev and
> see if it helps?
> 

pkg-config --libs x11
-lX11  
As I am using (upgraded) Debian/Sid autoconf and pkg-config are the latest Debian versions. 
Installing the git master branch version of libx11 did not help.
Because I was compiling with gcc4.5 v.4.5.1-7 (Debian/Experimental) I tried reverting to gcc4.4 (v.4.4.4-14) which solved the compilation problem!
Comment 7 Chia-I Wu 2010-09-15 22:02:42 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > 
> > Can you show me the result of executing "pkg-config --libs x11" on your system?
> >  Also, you may want to upgrade your autoconf, pkg-config, and libx11-dev and
> > see if it helps?
> > 
> 
> pkg-config --libs x11
> -lX11  
> As I am using (upgraded) Debian/Sid autoconf and pkg-config are the latest
> Debian versions. 
> Installing the git master branch version of libx11 did not help.
> Because I was compiling with gcc4.5 v.4.5.1-7 (Debian/Experimental) I tried
> reverting to gcc4.4 (v.4.4.4-14) which solved the compilation problem!
It sounds like a version mismatch between the packages, but I am not sure how that happens.  You may compare the results of running ./configure on both compilers for hints.  I've committed the pthread patch and am closing this bug.
Comment 8 Jos van Wolput 2010-09-15 23:00:36 UTC
(In reply to comment #7)

> > Because I was compiling with gcc4.5 v.4.5.1-7 (Debian/Experimental) I tried
> > reverting to gcc4.4 (v.4.4.4-14) which solved the compilation problem!
> It sounds like a version mismatch between the packages, but I am not sure how
> that happens.  You may compare the results of running ./configure on both
> compilers for hints.  I've committed the pthread patch and am closing this bug.

./configure of both compilers are identical.
Comment 9 Chia-I Wu 2010-09-15 23:08:58 UTC
(In reply to comment #8)
> (In reply to comment #7)
> 
> > > Because I was compiling with gcc4.5 v.4.5.1-7 (Debian/Experimental) I tried
> > > reverting to gcc4.4 (v.4.4.4-14) which solved the compilation problem!
> > It sounds like a version mismatch between the packages, but I am not sure how
> > that happens.  You may compare the results of running ./configure on both
> > compilers for hints.  I've committed the pthread patch and am closing this bug.
> 
> ./configure of both compilers are identical.
Weird.  What was the command gcc4.5 build use to link xeglthreads?  What does

  $ grep X11_LIBS configs/current

give?
Comment 10 Jos van Wolput 2010-09-16 03:04:07 UTC
(In reply to comment #9)

> > ./configure of both compilers are identical.
> Weird.  What was the command gcc4.5 build use to link xeglthreads?

---
/usr/bin/ld: xeglthreads.o: undefined reference to symbol 'XNextEvent'
/usr/bin/ld: note: 'XNextEvent' is defined in DSO //usr/lib64/libX11.so.6 so
try adding it to the linker command line
//usr/lib64/libX11.so.6: could not read symbols: Invalid operation
---

> 
> What does  $ grep X11_LIBS configs/current give?
> 

$ grep X11_LIBS configs/current
$ nothing!
Comment 11 Chia-I Wu 2010-09-16 03:53:13 UTC
(In reply to comment #10)
> (In reply to comment #9)
> 
> > > ./configure of both compilers are identical.
> > Weird.  What was the command gcc4.5 build use to link xeglthreads?
> 
> ---
> /usr/bin/ld: xeglthreads.o: undefined reference to symbol 'XNextEvent'
> /usr/bin/ld: note: 'XNextEvent' is defined in DSO //usr/lib64/libX11.so.6 so
> try adding it to the linker command line
> //usr/lib64/libX11.so.6: could not read symbols: Invalid operation
> ---
> 
> > 
> > What does  $ grep X11_LIBS configs/current give?
> > 
> 
> $ grep X11_LIBS configs/current
> $ nothing!
Now something is broken.  What is the output of

  $ grep X11_LIBS configs/current configs/autoconf configs/autoconf.in

?
Comment 12 Jos van Wolput 2010-09-16 05:07:32 UTC
(In reply to comment #11)
> Now something is broken.  What is the output of
> 
>   $ grep X11_LIBS configs/current configs/autoconf configs/autoconf.in
> 
> ?
jos@debian:~/src/xorg/mesa-7.8$ grep X11_LIBS configs/current configs/autoconf configs/autoconf.in
jos@debian:~/src/xorg/mesa-7.8$ nothing, when using gcc4.4 and 4.5, although pkg-config --libs x11
-lX11  

When compiling mesa-7.9:
jos@debian:~/src/xorg/mesa-7.9$ grep X11_LIBS configs/current configs/autoconf configs/autoconf.in
configs/current:X11_LIBS = -lX11
configs/autoconf:X11_LIBS = -lX11
configs/autoconf.in:X11_LIBS = @X11_LIBS@
Comment 13 Chia-I Wu 2010-09-16 06:08:13 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Now something is broken.  What is the output of
> > 
> >   $ grep X11_LIBS configs/current configs/autoconf configs/autoconf.in
> > 
> > ?
> jos@debian:~/src/xorg/mesa-7.8$ grep X11_LIBS configs/current configs/autoconf
> configs/autoconf.in
> jos@debian:~/src/xorg/mesa-7.8$ nothing, when using gcc4.4 and 4.5, although
> pkg-config --libs x11
> -lX11  
> 
> When compiling mesa-7.9:
> jos@debian:~/src/xorg/mesa-7.9$ grep X11_LIBS configs/current configs/autoconf
> configs/autoconf.in
> configs/current:X11_LIBS = -lX11
> configs/autoconf:X11_LIBS = -lX11
> configs/autoconf.in:X11_LIBS = @X11_LIBS@
It looks like your ~/src/xorg/mesa-7.8/configs/autoconf.in has local modifications.
Comment 14 Brian Paul 2010-09-16 06:32:35 UTC
BTW, do you have these problems with Mesa 7.8.2?
Comment 15 Jos van Wolput 2010-09-16 06:48:30 UTC
(In reply to comment #13)

> It looks like your ~/src/xorg/mesa-7.8/configs/autoconf.in has local
> modifications.
No local modifications, it's the one I got from mesa-7.8.tar.bz2
http://cgit.freedesktop.org/mesa/mesa/commit/?h=7.8
Comment 16 Jos van Wolput 2010-09-16 07:07:36 UTC
(In reply to comment #14)
> BTW, do you have these problems with Mesa 7.8.2?

I just tried and yes, 7.8.2 too doesn't compile when using gcc-4.5
but contrary to 7.8.3 I get:
~/src/xorg/mesa-7.8.2$ grep X11_LIBS configs/current configs/autoconf configs/autoconf.in
configs/current:X11_LIBS = -lX11
configs/autoconf:X11_LIBS = -lX11
configs/autoconf.in:X11_LIBS = @X11_LIBS@

The compilation error is the same as given by 7.8.3:
---
/usr/bin/ld: xeglthreads.o: undefined reference to symbol 'pthread_join@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_join@@GLIBC_2.2.5' is defined in DSO //lib64/libpthread.so.0 so try adding it to the linker command line
//lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [xeglthreads] Error 1
make[2]: Leaving directory `/home/jos/src/xorg/mesa-7.8.2/progs/egl'
make[1]: *** [subdirs] Error 1
---
No compilation error when using gcc4.4
Comment 17 Jos van Wolput 2010-09-16 19:45:08 UTC
(In reply to comment #14)
> BTW, do you have these problems with Mesa 7.8.2?

After applying the patch (id=38719)'link to pthread'
mesa 7.8.2 compiles well when using gcc-4.5
Comment 18 Chia-I Wu 2010-09-16 21:34:23 UTC
(In reply to comment #15)
> (In reply to comment #13)
> 
> > It looks like your ~/src/xorg/mesa-7.8/configs/autoconf.in has local
> > modifications.
> No local modifications, it's the one I got from mesa-7.8.tar.bz2
> http://cgit.freedesktop.org/mesa/mesa/commit/?h=7.8
I see.  The tarball is mesa 7.8.  You need to click on the the commit to get the latest release

http://cgit.freedesktop.org/mesa/mesa/commit/?h=7.8&id=340e063525831d817df7f48fd34f1a00fd2720d5
Comment 19 Jos van Wolput 2010-09-16 22:30:41 UTC
(In reply to comment #18)
> (In reply to comment #15)
> > (In reply to comment #13)
> > 
> > > It looks like your ~/src/xorg/mesa-7.8/configs/autoconf.in has local
> > > modifications.
> > No local modifications, it's the one I got from mesa-7.8.tar.bz2
> > http://cgit.freedesktop.org/mesa/mesa/commit/?h=7.8
> I see.  The tarball is mesa 7.8.  You need to click on the the commit to get
> the latest release
> 
> http://cgit.freedesktop.org/mesa/mesa/commit/?h=7.8&id=340e063525831d817df7f48fd34f1a00fd2720d5

OK! that's the right patched one.
It compiles well using gcc-4.5
Thanks.


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.