Compiling mesa with default to -fvisibility=hidden

pcpa at pcpa at
Fri Nov 23 17:42:05 PST 2007


  I am working on implementing a X Server build where symbols default
to hidden visibility. At least for the first version, I will only make
the X Server symbols default to hidden, while modules, i.e. anything
that ends in .so and is installed at /usr/lib/xorg/modules defaults
to "public" symbols.
  In one of my builds, when 3d was not functional, due to some
problems with symbols, that for the moment I resolved by compiling
the glx/mesa sources with -fvisibility=default; when it was not
properly working, I had the side effect that, when using WindowMaker
and  switching virtual desktops, there would not exist rendering
corruption, i.e. software rendering, as I was using the vesa driver.
So, while I did not yet find the real cause of the problem, I suspect
it is mesa/composite interference in software rendering, maybe this
gives a hint to someone :-)

  But my real question is if there is some plan about it, or
someone already working on something similar. Otherwise, GL/glx/mesa
is one of the first trees I hope to work once I have a fully
functional X Server with hidden default symbols, as most of the
GL/glx/mesa symbols aren't put on a shared library module, i.e. they
end up in the X Server binary. Basically, most of may patch for
Makefiles, currently is a @SERVER_SYMBOLS@ and @MODULE_SYMBOLS@
AC_SUBST, that is replaced with -fvisibility=hidden and
-fvisibility=default for the moment, but I may change it to a more
descriptive value, possibly something like @HIDDEN_SYMBOLS@ and
@PUBLIC_SYMBOLS@ (The build/patches are still in a somewhat
"proof of concept" state, but I have it now working with the ati
and vesa driver, and with the ati driver it is working properly
with 3 applications, video, etc).

  Most of the symbols resolution can be done by hand by running
nm and some text processing in the output to list undefined symbols,
or just running a installed build and watching for it failing due
to a symbol not found... Most of the "difficulty to find" problems
are due to things like:
#define symbol    (funcion-cast)LoaderSymbol("symbol-string")
and a few "weak" symbols, i.e. close to playing with luck when
resolving symbol clashes as when compiling with -fvisibility=hidden
by default, frequently some stub function will be made public. Other
hard to find symbols are those defined by macros :-)


More information about the xorg mailing list