[MacPorts] #36055: Tiger PPC: xorg-server-1.13.0 fails to build on Tiger PPC because of multiple definitions of symbol _XkbFreeGeomOverlayKeys?

MacPorts noreply at macports.org
Fri Sep 13 12:57:43 PDT 2013


#36055: Tiger PPC: 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:  closed
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.1.2
Resolution:  wontfix          |   Keywords:  tiger
      Port:  xorg-server      |
------------------------------+------------------------

Comment (by Peter_Dyballa@…):

 Here are the other comparisons:

 {{{
 libXfont-1.4.6/src/stubs/csignal.c                      xorg-server-
 devel-1.14.99.0/dix/dixutils.c
 --------------------------------------------------------------------------------------------------
                                                         Bool
 ClientSignal(ClientPtr client)
                                                         {
                                                             SleepQueuePtr
 q;

                                                             for (q =
 sleepQueue; q; q = q->next)
 weak Bool                                                       if
 (q->client == client) {
 ClientSignal(ClientPtr client)                                      return
 QueueWorkProc(q->function, q->client, q->closure);
 {                                                               }
     return True;                                            return FALSE;
 }                                                       }


 libXfont-1.4.6/src/stubs/servclient.c                   xorg-server-
 devel-1.14.99.0/dix/globals.c
 --------------------------------------------------------------------------------------------------

 weak void *serverClient = 0;                            ClientPtr
 serverClient;

 libXfont-1.4.6/src/util/miscutil.c                              xorg-
 server-devel-1.14.99.0/dix/globals.c
 ----------------------------------------------------------------------------------------------------------

 #ifndef NO_WEAK_SYMBOLS
 /* make sure everything initializes themselves at least once */
 weak long serverGeneration = 1;                                 unsigned
 long serverGeneration = 0;
 #endif

 libXfont-1.4.6/src/util/atom.c
 xorg-server-devel-1.14.99.0/dix/atom.c
 --------------------------------------------------------------------------------------------------------------------------
 weak int
 Bool
 ValidAtom(Atom atom)
 ValidAtom(Atom atom)
 {
 {
     return (atom != None) && (atom <= lastAtom);
 return (atom != None) && (atom <= lastAtom);
 }
 }

 const char *
 NameForAtom(Atom atom)
 {
 NodePtr node;
 weak char *
 NameForAtom(Atom atom)
 if (atom > lastAtom)
 {
 return 0;
     if (atom != None && atom <= lastAtom)
 if ((node = nodeTable[atom]) == NULL)
         return reverseMap[atom]->name;
 return 0;
     return NULL;
 return node->string;
 }
 }

 weak Atom
 MakeAtom(const char *string, unsigned len, int makeit)
 {
     AtomListPtr a;
 Atom
     int         hash;
 MakeAtom(const char *string, unsigned len, Bool makeit)
     int         h = 0;
 {
     int         r;
 NodePtr *np;
 unsigned i;
     hash = Hash (string, len);
 int comp;
     if (hashTable)
 unsigned int fp = 0;
     {
         h = hash & hashMask;
 np = &atomRoot;
         if (hashTable[h])
 for (i = 0; i < (len + 1) / 2; i++) {
         {
 fp = fp * 27 + string[i];
             if (hashTable[h]->hash == hash && hashTable[h]->len == len &&
 fp = fp * 27 + string[len - 1 - i];
                 NameEqual (hashTable[h]->name, string, len))
 }
             {
 while (*np != NULL) {
                 return hashTable[h]->atom;
 if (fp < (*np)->fingerPrint)
             }
 np = &((*np)->left);
             r = (hash % rehash) | 1;
 else if (fp > (*np)->fingerPrint)
             for (;;)
 np = &((*np)->right);
             {
 else {                  /* now start testing the strings */
                 h += r;
 comp = strncmp(string, (*np)->string, (int) len);
                 if (h >= hashSize)
 if ((comp < 0) || ((comp == 0) && (len < strlen((*np)->string))))
                     h -= hashSize;
 np = &((*np)->left);
                 if (!hashTable[h])
 else if (comp > 0)
                     break;
 np = &((*np)->right);
                 if (hashTable[h]->hash == hash && hashTable[h]->len == len
 &&               else
                     NameEqual (hashTable[h]->name, string, len))
 return (*np)->a;
                 {
 }
                     return hashTable[h]->atom;
 }
                 }
 if (makeit) {
             }
 NodePtr nd;
         }
     }
 nd = malloc(sizeof(NodeRec));
     if (!makeit)
 if (!nd)
         return None;
 return BAD_RESOURCE;
     a = malloc (sizeof (AtomListRec) + len + 1);
 if (lastAtom < XA_LAST_PREDEFINED) {
     if (a == NULL) {
 nd->string = string;
         fprintf(stderr, "MakeAtom(): Error: Couldn't allocate AtomListRec"
 }
                 " (%ld)\n", (unsigned long)sizeof (AtomListRec) + len +
 1);             else {
         return None;
 nd->string = strndup(string, len);
     }
 if (!nd->string) {
     a->name = (char *) (a + 1);
 free(nd);
     a->len = len;
 return BAD_RESOURCE;
     strncpy (a->name, string, len);
 }
     a->name[len] = '\0';
 }
     a->atom = ++lastAtom;
 if ((lastAtom + 1) >= tableLength) {
     a->hash = hash;
 NodePtr *table;
     if (hashUsed >= hashSize / 2)
     {
 table = realloc(nodeTable, tableLength * (2 * sizeof(NodePtr)));
         ResizeHashTable ();
 if (!table) {
         h = hash & hashMask;
 if (nd->string != string) {
         if (hashTable[h])
 /* nd->string has been strdup'ed */
         {
 free((char *) nd->string);
             r = (hash % rehash) | 1;
 }
             do {
 free(nd);
                 h += r;
 return BAD_RESOURCE;
                 if (h >= hashSize)
 }
                     h -= hashSize;
 tableLength <<= 1;
             } while (hashTable[h]);
 nodeTable = table;
         }
 }
     }
 *np = nd;
     hashTable[h] = a;
 nd->left = nd->right = NULL;
     hashUsed++;
 nd->fingerPrint = fp;
     if (reverseMapSize <= a->atom) {
 nd->a = ++lastAtom;
         if (!ResizeReverseMap())
 nodeTable[lastAtom] = nd;
             return None;
 return nd->a;
     }
 }
     reverseMap[a->atom] = a;
 else
     return a->atom;
 return None;
 }
 }

 ===================================================================================================
 libXfont-1.4.6/src/stubs/errorf.c                       xorg-server-
 devel-1.14.99.0/os/log.c
 --------------------------------------------------------------------------------------------------
                                                         void
                                                         ErrorF(const char
 *f, ...)
                                                         {
                                                             va_list args;

 weak void                                                   va_start(args,
 f);
 ErrorF(const char *f, ...)                                  VErrorF(f,
 args);
 {                                                           va_end(args);
 }                                                       }

 libXfont-1.4.6/src/stubs/fatalerror.c                   xorg-server-
 devel-1.14.99.0/os/log.c
 --------------------------------------------------------------------------------------------------
                                                         void
                                                         FatalError(const
 char *f, ...)
                                                         {
                                                             va_list args;
                                                             va_list args2;
                                                             static Bool
 beenhere = FALSE;

                                                             if (beenhere)
 ErrorF("\nFatalError re-entered, aborting\n");
                                                             else
 ErrorF("\nFatal server error:\n");

                                                             va_start(args,
 f);

                                                             /* Make a copy
 for OsVendorFatalError */
                                                             va_copy(args2,
 args);

                                                         #ifdef __APPLE__
                                                             {
                                                                 va_list
 apple_args;

 va_copy(apple_args, args);
 (void)vsnprintf(__crashreporter_info_buff__,
 sizeof(__crashreporter_info_buff__), f, apple_args);
 va_end(apple_args);
                                                             }
                                                         #endif
                                                             VErrorF(f,
 args);
                                                             va_end(args);
                                                             ErrorF("\n");
                                                             if (!beenhere)
 OsVendorFatalError(f, args2);
                                                             va_end(args2);
                                                             if (!beenhere)
 {
                                                                 beenhere =
 TRUE;
 AbortServer();
 weak void                                                   }
 FatalError(const char *f, ...)                              else
 {                                                               OsAbort();
 }                                                        /*NOTREACHED*/}

 libXfont-1.4.6/src/stubs/gettime.c                      xorg-server-
 devel-1.14.99.0/os/utils.c
 --------------------------------------------------------------------------------------------------
                                                         CARD32
 GetTimeInMillis(void)
                                                         {
                                                             struct timeval
 tv;

                                                         #ifdef
 MONOTONIC_CLOCK
                                                             struct
 timespec tp;
                                                             static
 clockid_t clockid;

                                                             if (!clockid)
 {
                                                         #ifdef
 CLOCK_MONOTONIC_COARSE
                                                                 if
 (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
 (tp.tv_nsec / 1000) <= 1000 &&
 clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
 clockid = CLOCK_MONOTONIC_COARSE;
                                                                 else
                                                         #endif
                                                                 if
 (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
 clockid = CLOCK_MONOTONIC;
                                                                 else
 clockid = ~0L;
                                                             }
                                                             if (clockid !=
 ~0L && clock_gettime(clockid, &tp) == 0)
                                                                 return
 (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
 weak unsigned long                                      #endif
 GetTimeInMillis (void)
 {
 X_GETTIMEOFDAY(&tv);
     return 0;                                               return
 (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
 }                                                       }

 libXfont-1.4.6/src/stubs/setfntauth.c
 xorg-server-devel-1.14.99.0/os/utils.c
 --------------------------------------------------------------------------------------------------------------------------
 /* Implement a simple-minded font authorization scheme.  The authorization
 name is "hp-hostname-1", the contents are simply the host name. */
 int
 set_font_authorizations(char **authorizations, int *authlen, pointer
 client)
 {
 #define AUTHORIZATION_NAME "hp-hostname-1"
 #if defined(TCPCONN) || defined(STREAMSCONN)
 static char *result = NULL;
 static char *p = NULL;

 if (p == NULL) {
 char hname[1024], *hnameptr;
 unsigned int len;

 #if defined(IPv6) && defined(AF_INET6)
 struct addrinfo hints, *ai = NULL;
 #else
 struct hostent *host;

 #ifdef XTHREADS_NEEDS_BYNAMEPARAMS
 _Xgethostbynameparams hparams;
 #endif
 #endif

 gethostname(hname, 1024);
 #if defined(IPv6) && defined(AF_INET6)
 memset(&hints, 0, sizeof(hints));
 hints.ai_flags = AI_CANONNAME;
 if (getaddrinfo(hname, NULL, &hints, &ai) == 0) {
 hnameptr = ai->ai_canonname;
 }
 else {
 hnameptr = hname;
 }
 #else
 host = _XGethostbyname(hname, hparams);
 if (host == NULL)
 hnameptr = hname;
 else
 hnameptr = host->h_name;
 #endif

 len = strlen(hnameptr) + 1;
 result = malloc(len + sizeof(AUTHORIZATION_NAME) + 4);

 p = result;
 *p++ = sizeof(AUTHORIZATION_NAME) >> 8;
 *p++ = sizeof(AUTHORIZATION_NAME) & 0xff;
 *p++ = (len) >> 8;
 *p++ = (len & 0xff);

 memmove(p, AUTHORIZATION_NAME, sizeof(AUTHORIZATION_NAME));
 p += sizeof(AUTHORIZATION_NAME);
 memmove(p, hnameptr, len);
 p += len;
 #if defined(IPv6) && defined(AF_INET6)
 if (ai) {
 freeaddrinfo(ai);
 }
 #endif
 }
 *authlen = p - result;
 *authorizations = result;
 weak int
 return 1;
 set_font_authorizations(char **authorizations, int *authlen, ClientPtr
 client)  #else                           /* TCPCONN */
 {
 return 0;
     return 0;
 #endif                          /* TCPCONN */
 }
 }
 }}}

 Pretty clear is that:

 {{{
 libX11-1.6.1/src/xkb/XKBGAlloc.c                        xorg-server-
 devel-1.14.99.0/xkb/XKBGAlloc.c
 --------------------------------------------------------------------------------------------------
                 void
                 XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row,int first,int
 count,Bool freeAll)
                 {
                     _XkbFreeGeomLeafElems(freeAll,first,count,
 &row->num_keys,&row->sz_keys,
                                                 (char **)&row->keys,
                                                 sizeof(XkbOverlayKeyRec));
                     return;
                 }
 }}}

 Both C source files use exactly the same code. So it should be possible to
 build xorg-server-1.13.x which has only this one complaint. If it uses the
 same code as xorg-server-devel 1.14.99.0. I'll to build that version with
 the patch as mentioned above.

-- 
Ticket URL: <https://trac.macports.org/ticket/36055#comment:21>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list