Bug 53835

Summary: [build error] /usr/bin/ld: cannot find -l-O2
Product: Mesa Reporter: Fabio Pedretti <pedretti.fabio>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: askrsw, mattst88
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Fabio Pedretti 2012-08-20 10:45:53 UTC
I am getting this error when compiling mesa:

  CCLD   libGL.la
/usr/bin/ld: cannot find -l-O2

Full log at:
https://launchpadlibrarian.net/112995027/buildlog_ubuntu-precise-i386.mesa_8.1~git1208201137.c51f8e~gd~p_FAILEDTOBUILD.txt.gz
Comment 1 Kevin Hobbs 2012-08-20 13:44:51 UTC
I got the same error and started a thread in the developers list:

http://lists.freedesktop.org/archives/mesa-dev/2012-August/025659.html

I was building from git with the configuration :

./autogen.sh \
  --prefix=/home/kevin/mesa_build/ \
  --disable-dri \
  --enable-glx \
  --enable-xlib-glx \
  --enable-osmesa \
  --without-gallium-drivers

How are you building?

For me adding --disable-shared-glapi solved the problem.
Comment 2 Matt Turner 2012-08-20 16:27:05 UTC
Patches on the list to fix this now.
Comment 3 Fabio Pedretti 2012-08-21 10:53:36 UTC
Is this the patch:
http://lists.freedesktop.org/archives/mesa-dev/2012-August/025679.html

It gives a different error here:
  CCLD   libglapi.la
/bin/mkdir -p ../../../i386-linux-gnu
ln -f .libs/libglapi.so.0.0.0 ../../../i386-linux-gnu/libglapi.so.0.0.0
ln: accessing `.libs/libglapi.so.0.0.0': No such file or directory

Full log at:
https://launchpadlibrarian.net/113066012/buildlog_ubuntu-precise-i386.mesa_8.1~git1208211230.c1114c~gd~p_FAILEDTOBUILD.txt.gz
Comment 5 Kevin Hobbs 2012-08-21 16:49:09 UTC
(In reply to comment #4)
> 
> but they may require some other(s) from the series to apply cleanly.

If there's a branch that can be checked out I'll happily test it.
Comment 6 Matt Turner 2012-08-21 17:38:51 UTC
Here you go: http://cgit.freedesktop.org/~mattst88/mesa/log/?h=configure-cleanups
Comment 7 Kevin Hobbs 2012-08-21 19:43:50 UTC
(In reply to comment #6)
> Here you go:
> http://cgit.freedesktop.org/~mattst88/mesa/log/?h=configure-cleanups

I did :

$ git clone git://people.freedesktop.org/~mattst88/mesa
$ cd mesa/
$ git checkout configure-cleanups
$ ./autogen.sh \
  --prefix=/home/kevin/mesa_build/ \
  --disable-dri \
  --enable-glx \
  --enable-xlib-glx \
  --enable-osmesa \
  --without-gallium-drivers
$ make -ij8
$ make

and this is the tail of what I got :

gmake[4]: Entering directory `/tmp/mesa/src/mesa'
  CC     es1_conversion.lo
../../src/mesa/main/es1_conversion.c: In function '_es_DrawTexxOES':
../../src/mesa/main/es1_conversion.c:130:5: error: implicit declaration of function '_mesa_DrawTexf' [-Werror=implicit-function-declaration]
../../src/mesa/main/es1_conversion.c: In function '_es_DrawTexxvOES':
../../src/mesa/main/es1_conversion.c:147:5: error: implicit declaration of function '_mesa_DrawTexfv' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
gmake[4]: *** [es1_conversion.lo] Error 1
gmake[4]: Leaving directory `/tmp/mesa/src/mesa'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory `/tmp/mesa/src/mesa'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/tmp/mesa/src/mesa'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/tmp/mesa/src'
make: *** [all-recursive] Error 1
Comment 8 Matt Turner 2012-08-22 18:11:50 UTC
Just pushed my branch. Should be fixed.
Comment 9 Kevin Hobbs 2012-08-22 19:10:10 UTC
(In reply to comment #8)
> Just pushed my branch. Should be fixed.

Yup, this seems to work.

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.