[patch] xserver:dri

Ian Romanick idr at freedesktop.org
Wed Feb 11 10:10:51 PST 2009


(Sorry for the possibly duplicate post.  I sent it with the wrong "from"
address the first time.)

Shunichi Fuji wrote:
> When X server try to load dri module,
> there isn't noPanoramiXExtension symbol if xserver build without xinerama.

Correct.  I reported this bug, #6009, about three years ago.

In the future, please send patches in-line.  That way people can comment
on your code by clicking "reply".  Few, if any, mail programs will
in-line attachments in replies.

>> (II) LoadModule: "dri"
>> (II) Loading /home/pal/dev/lib/xorg/modules/extensions/libdri.so
>> dlopen: /home/pal/dev/lib/xorg/modules/extensions/libdri.so: undefined symbol: noPanoramiXExtension
>> (EE) Failed to load /home/pal/dev/lib/xorg/modules/extensions/libdri.so
>> (II) UnloadModule: "dri"
>> (EE) Failed to load module "dri" (loader failed, 7)
> 
> this is happened when loading module and resolving symbol name.
> so I guess that xf86LoaderCheckSymbol() is never useful if using
> externed variable directly.
> I make noPanoramiXExtension will be just used through dlopen() like
> other extension modules.
> 
> changes summarize into 4 pieces
> -ifdefed with PANORAMIX
> (just avoid if disable-xinerama builds)
> -drop "extern Bool noPanoramiXExtension".
> (it's declared in include/globals.h if defined PANORAMIX)
> -stop using xf86LoaderCheckSymbol()
> (checking symbol is nonsense if use externed symbols)
> -simplify and drop unuseful xineramaInCore variable.
> (it seems needlessness even using xf86LoaderCheckSymbol())

These are sensible changes, but I don't think it fixes the underlying
problem.  The real problem, as you suggest, is that
xf86LoaderCheckSymbol is a completely worthless interface.  What is
really needed is one of the following:

- xf86LoaderGetSymbol that either returns a pointer to the symbol or NULL.

- Support for weak symbols from the loader.  For example, if
noPanoramiXExtension were weak, there wouldn't be an unresolved symbol
error at dlopen.  The error would come if the loaded module tried to use
the symbol.

Of the two, the later is the much better fix.  Note that this option
also makes the existing code in dri.c work the way the author intended
it to work.


More information about the xorg-devel mailing list