[PATCH] fix sdksyms for gcc3
Paulo César Pereira de Andrade
pcpa at mandriva.com.br
Fri Jan 2 03:14:42 PST 2009
Matthieu Herrb wrote:
> gcc 3.3 (at least) doesn't support visibility attributes, so _X_EXPORT
> expands to nothing. This breaks the awk script embedded in
> hw/xfree86/loader/sdksyms.sh that expects that an extern function
> declaration to be in the form "extern __attribute__(___something___)
> type ..."
>
> With the attached patch sdksyms.sh works with gcc 3.3 too.
Thanks.
I thought I had already tested this case. But I cannot guarantee
the problem was not caused by recent changes to sdk headers. I will
check carefully again.
In the meantime, feel free to apply the patch :-)
I don't want to have it in any intrusive or hard to understand
way. But to allow easier handling by automated tools, the syntax
for symbols that should be available to modules is:
extern _X_EXPORT <type-spec><optional-newline> <symbol-name> <ignored...>
One option that I considered was to use linux kernel format, that
is, something like:
EXPORT_SYMBOL(symbol_name);
written in the C sources. This has the advantage of a more clear
way to handle what should be done inside the macro expansion, while
the format used in the Xorg sdk requires a tool to parse the headers
(what can cause problems if the parser doesn't understand the
specification). But the format in the sdk headers was also preferred
to attempt to reduce the amount of patches, and keep the sources
with free definition of symbols from macro expansions.
The real problem with "sdksyms.*" is that it is trying to resolve
a problem that should not exist in the first place. If the symbols
are not "referenced", the linker will not add "unreachable" symbols
to the Xorg binary. The problem is that the symbols "dropped" are
only reachable from loadable modules.
The proper solution should be either have the Xorg binary actually
reference those symbols, or have them in separate modules, or possibly
have then in a shared library...
Paulo
More information about the xorg
mailing list