[MacPorts] #36055: xorg-server-1.13.0 fails to build on Tiger PPC because of multiple definitions of symbol _XkbFreeGeomOverlayKeys?
MacPorts
noreply at macports.org
Sun Sep 23 03:14:13 PDT 2012
#36055: xorg-server-1.13.0 fails to build on Tiger PPC because of multiple
definitions of symbol _XkbFreeGeomOverlayKeys?
------------------------------+------------------------
Reporter: Peter_Dyballa@… | Owner: jeremyhu@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.1.2
Resolution: | Keywords:
Port: xorg-server |
------------------------------+------------------------
Comment (by Peter_Dyballa@…):
Replying to [comment:4 jeremyhu@…]:
> Yep. This will remain broken until someone with a Tiger machine fixes
it.
I actually do not understand what the compiler is trying to say. (I never
learned these subtleties.)
It seems to me that there is a function – obviously – in
/opt/local/lib/libXfont.dylib – obviously, because the symbol is inside a
library –, coming from the object file miscutil.o. And there is another
library, dix/.libs/libdix.a, which has from the object file globals.o,
which it is built from, another definition of that symbol,
_serverGeneration.
libXfont-1.4.5/src/util/miscutil.c has:
{{{
48 #ifndef NO_WEAK_SYMBOLS
49 /* make sure everything initializes themselves at least once */
50 weak long serverGeneration = 1;
51 #endif
}}}
xorg-server-devel-1.13.99.0/dix/globals.c has:
{{{
88 unsigned long serverGeneration = 0;
}}}
So it seems that the symbol _serverGeneration is indeed only a variable,
serverGeneration, casted a bit differently. If that's the problem, the
same global variable defined and initialised twice, then the cure might be
to make it local to dix which uses it a few times:
{{{
./dix/dixfonts.c:1966: if (last_server_gen < serverGeneration) {
./dix/dixfonts.c:1967: last_server_gen = serverGeneration;
./dix/globals.c:88:unsigned long serverGeneration = 0;
./dix/main.c:155: serverGeneration++;
./dix/main.c:168: if (serverGeneration == 1) {
}}}
Or using a different name for it. (Changes in libXfont might be more
complicated. Or it might be useful to use it weakly, i.e., let dix
initialise it?)
xorg-server-devel-1.13.99.0/xkb/XKBGAlloc.c has:
{{{
241 void
242 XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count,
Bool freeAll)
243 {
244 _XkbFreeGeomLeafElems(freeAll, first, count,
245 &row->num_keys, &row->sz_keys,
246 (char **) &row->keys,
sizeof(XkbOverlayKeyRec));
247 return;
248 }
}}}
If that obvious function is already contained in
/opt/local/lib/libX11.dylib (/opt/local/lib/libX11.dylib:single module:
0007e800 T _XkbFreeGeomOverlayKeys), then the solution seems to be either
to remove it from libX11 or to make xkb use that library function. Xkb
uses that function not at all:
{{{
./XKBGAlloc.c:242:XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first,
int count, Bool freeAll)
./xkbgeom.h:402: XkbFreeGeomOverlayKeys(XkbOverlayRowPtr /* row */ ,
}}}
The first use is already documented here, the second use is this:
{{{
401 extern void
402 XkbFreeGeomOverlayKeys(XkbOverlayRowPtr /* row */ ,
403 int /* first */ ,
404 int /* count */ ,
405 Bool /* freeAll */
406 );
}}}
which looks like a correct and necessary declaration in C. So the function
definition in xorg-server-devel-1.13.99.0/xkb/XKBGAlloc.c should be
removed. And possibly there could be some more similar cases… (for
example: /opt/local/lib/libX11.dylib:single module: 0010817c D
__XkbInternAtomFunc and in xorg-server-devel-1.13.99.0/xkb/xkmread.c)
--
Ticket URL: <https://trac.macports.org/ticket/36055#comment:5>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list