[Xquartz-dev] Building mesa

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Apr 21 11:29:12 PDT 2012


Hi,

I'm trying to build mesa (libGL.1.dylib) with debug info to be able to debug http://xquartz.macosforge.org/trac/ticket/512 . As an aside, valgrind is also an excellent debugging tool for getting to the bottom of such issues.

Anyway, my first problem was figuring out where mesa's git repository was :) After a while, I found git://people.freedesktop.org/~jeremyhu/mesa

I then configured mesa using

  export ACLOCAL="aclocal -I /opt/X11/share/aclocal -I /usr/local/share/aclocal"
  export PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig"
  export CFLAGS="-Wall -O0 -ggdb3 -arch i386 -arch x86_64 -pipe"
  export LDFLAGS=$CFLAGS
  export CXXFLAGS=$CFLAGS
  ./configure --with-gallium-drivers= --prefix=/opt/X11 --disable-egl

(well, I figured out the configure line by trial and error)

Next, when building it I got an error about python not having libxml2 support. I solved that by downloading the libxml2 2.7.3 sources, building/installing them using (based on http://stackoverflow.com/a/3525294 )

  ./configure --with-python=/System/Library/Frameworks/Python.framework/Versions/2.6/
  make
  sudo make install

and then going in the python subdirectory of the libxml2 sources and executing "python setup.py install" (ignoring the error it gave about being unable to overwrite /Library/Python/2.6/site-packages/libxml2mod.so -- which is probably a good thing, since I didn't manage to build it universal).

The next problem was several complains about the linker not supporting the --start-group and --end-group parameters. From what I saw in scons/gallium.py, those parameters should normally be skipped for darwin, but that apparently that did not happen. "Solution":

  find . -name Makefile | while read file; do sed -e 's/-Wl,--start-group//g' -e 's/-Wl,--end-group//g' < $file > $file.new; mv $file.new $file; done

Now I'm getting a bunch of errors I can't solve though:

...
gcc -c -I../../../../include -I../../../../src/mapi -I../../../../src/mesa -I../../../../src/mesa/main -I/opt/X11/include   -Wall -O0 -ggdb3 -arch i386 -arch x86_64 -pipe -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -Wall -O0 -ggdb3 -arch i386 -arch x86_64 -pipe  -fno-common   -DHAVE_POSIX_MEMALIGN -DUSE_XSHM -fvisibility=hidden xm_tri.c -o xm_tri.o
mklib: Making Darwin shared library:  libGL.1.dylib
Undefined symbols:
  "ir_instruction::print() const", referenced from:
      print_program(prog_instruction*, ir_instruction**, int)   in libmesa.a(ir_to_mesa.o)
  "glsl_type::vec4_type", referenced from:
      __ZN9glsl_type9vec4_typeE$non_lazy_ptr in libmesa.a(ir_to_mesa.o)
     (maybe you meant: __ZN9glsl_type9vec4_typeE$non_lazy_ptr)
  "ir_hierarchical_visitor::visit_enter(ir_dereference_record*)", referenced from:
      vtable for get_sampler_namein libmesa.a(sampler.o)
  "ir_hierarchical_visitor::visit_enter(ir_discard*)", referenced from:
      vtable for get_sampler_namein libmesa.a(sampler.o)
  "lower_instructions(exec_list*, unsigned int)", referenced from:
      __mesa_ir_link_shader in libmesa.a(ir_to_mesa.o)
  "vtable for ir_if", referenced from:
      __ZTV5ir_if$non_lazy_ptr in libmesa.a(ir_to_mesa.o)
     (maybe you meant: __ZTV5ir_if$non_lazy_ptr)
...
  "ir_hierarchical_visitor::visit_leave(ir_if*)", referenced from:
      vtable for get_sampler_namein libmesa.a(sampler.o)
  "_mesa_glsl_lexer_ctor(_mesa_glsl_parse_state*, char const*)", referenced from:
      __mesa_glsl_compile_shader in libmesa.a(ir_to_mesa.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Am I missing another configure flag?

Thanks,


Jonas


More information about the Xquartz-dev mailing list