[Mesa-dev] Gallium issue on Haiku scons build, duplicate rtasm, assertion error.

Jakob Bornecrantz wallbraker at gmail.com
Fri Jan 20 16:42:25 PST 2012


On Sat, Jan 21, 2012 at 1:30 AM, Alexander von Gluck
<kallisti5 at unixzen.com> wrote:
> Quick question, I noticed that Mesa and gallium both implement rtasm...
>
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   p->need_emms = 1;
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   assert(p->need_emms);
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   p->need_emms = 0;
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   p->need_emms = 1;
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   p->need_emms = 1;
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   p->need_emms = 1;
> src/gallium/auxiliary/rtasm/rtasm_x86sse.c:   p->need_emms = 1;
> src/gallium/auxiliary/rtasm/rtasm_x86sse.h:   unsigned need_emms:8;
> src/gallium/auxiliary/translate/translate_sse.c:   if (p->func->need_emms)
>
> src/mesa/tnl/t_vertex_sse.c:   if (p->func.need_emms)
> src/mesa/x86/rtasm/x86sse.c:   p->need_emms = 1;
> src/mesa/x86/rtasm/x86sse.c:   assert(p->need_emms);
> src/mesa/x86/rtasm/x86sse.c:   p->need_emms = 0;
> src/mesa/x86/rtasm/x86sse.c:   p->need_emms = 1;
> src/mesa/x86/rtasm/x86sse.c:   p->need_emms = 1;
> src/mesa/x86/rtasm/x86sse.c:   p->need_emms = 1;
> src/mesa/x86/rtasm/x86sse.c:   p->need_emms = 1;
> src/mesa/x86/rtasm/x86sse.h:   int need_emms;

Those lines are really misleading, what the problem is that both export
the function mmx_emms one of which is selected depending on link order.
This couple with the fact that the x86_program struct, an argument to that
function, is layed out differently in the two versions of the helper code.

>
> This causes a conflict when libgallium.a is linked with libmesa.a into
> libGL.so:
>
> http://twitpic.com/89dbuu/full
> (if statement detecting a 1 for need_emms then on the next line seeing a 0)
>
>
> As libmesa's state_tracker and libmesa's rtasm require gallium's rtasm.. it
> seems i've hit a catch 22 here.
>
> Any thoughts on this? I can't figure out how to solve it without large
> changes.

Short term: don't link in Gallium since you have no Gallium driver yet or
disable asm or maybe only rtasm in mesa (slow swrast). On the other
hand you could probably not link in Gallium and then disable Mesa rtasm
when you have llvmpipe working.

Link the driver in different libraries and load them from libGL.

Cheers, Jakob.


More information about the mesa-dev mailing list