From bruno@clisp.org Tue Apr 4 07:43:39 2006 X-Gmail-Received: 634136b3eb71c68720807c0dc42a05f789878fc0 Delivered-To: vapierfilter@gmail.com Received: by 10.48.14.2 with SMTP id 2cs30096nfn; Tue, 4 Apr 2006 04:44:40 -0700 (PDT) Received: by 10.35.105.18 with SMTP id h18mr894204pym; Tue, 04 Apr 2006 04:44:39 -0700 (PDT) Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by mx.gmail.com with ESMTP id j76si793610pyd.2006.04.04.04.44.39; Tue, 04 Apr 2006 04:44:39 -0700 (PDT) Received-SPF: neutral (gmail.com: 134.68.220.30 is neither permitted nor denied by best guess record for domain of bruno@clisp.org) Received: from ftp.ilog.fr ([81.80.162.195]) by smtp.gentoo.org with esmtp (Exim 4.54) id 1FQjxe-0000RA-IW for vapier@gentoo.org; Tue, 04 Apr 2006 11:44:38 +0000 Received: from laposte.ilog.fr (cerbere-qfe0 [81.80.162.193]) by ftp.ilog.fr (8.13.1/8.13.1) with ESMTP id k34Biauj030654; Tue, 4 Apr 2006 13:44:37 +0200 Received: from marbore.ilog.biz (marbore.ilog.biz [172.17.2.61]) by laposte.ilog.fr (8.13.1/8.13.1) with ESMTP id k34BiVfG029935; Tue, 4 Apr 2006 13:44:31 +0200 Received: from honolulu.ilog.fr ([172.16.15.122]) by marbore.ilog.biz with Microsoft SMTPSVC(6.0.3790.1830); Tue, 4 Apr 2006 13:45:44 +0200 Received: from localhost (localhost [127.0.0.1]) by honolulu.ilog.fr (Postfix) with ESMTP id 35A8F3BD91; Tue, 4 Apr 2006 11:43:41 +0000 (UTC) From: Bruno Haible To: Mike Frysinger , bug-gnu-gettext@gnu.org Subject: Re: update gettext to handle expat-2.0.0 Date: Tue, 4 Apr 2006 13:43:39 +0200 User-Agent: KMail/1.5 References: <200604021741.42445.vapier@gentoo.org> In-Reply-To: <200604021741.42445.vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604041343.39461.bruno@clisp.org> X-OriginalArrivalTime: 04 Apr 2006 11:45:45.0226 (UTC) FILETIME=[4F0CB6A0:01C657DD] Status: R X-Status: NC X-KMail-EncryptionState: X-KMail-SignatureState: X-KMail-MDN-Sent: Hello, Mike Frysinger wrote: > i'm not sure if this has been discussed at all as i cant seem to find any > mailing list archives for this list ... > > expat-2.0.0 was released recently and this version changed ABI #'s ... so > it now installs as libexpat.so.1 instead of libexpat.so.0 Thanks for making me aware of this! > the trouble is the x-glade.c file tries to dlopen "libexpat.so.0" which > will obviously fail on systems that only have expat-2.0.0 ... would it be > safe to change the code to just dlopen("libexpat.so") or should it be > changed to read something like: > void *handle = dlopen ("libexpat.so.1", RTLD_LAZY); > if (handle == NULL) > handle = dlopen ("libexpat.so.0", RTLD_LAZY); There is a reason why they changed the major version number of the library: Its binary API changed (functions were removed or function signatures changed or function return types were changed). You cannot simply ignore these changes and use whatever version of the library is found - except if by luck gettext was not using the API portions that were changed (which is not the case). Find attached a patch. Bruno 2006-04-03 Bruno Haible * x-glade.c (p_XML_GetCurrentLineNumber, p_XML_GetCurrentColumnNumber): Declare differently for expat >= 2.0.0. (load_libexpat): Search for a differently library name for expat >= 2.0.0. (do_extract_glade): Update. Reported by Mike Frysinger . diff -r -c3 --exclude='*.po*' --exclude='*.info*' --exclude='*_*.html' --exclude='*.*.html' --exclude='*.[13]' --exclude='*.1.in' --exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure --exclude=version.texi --exclude=stamp-vti --exclude='po-*-gen*.[ch]' --exclude='*.o' --exclude='*.lo' --exclude='*.gmo' --exclude=ABOUT-NLS --exclude='javadoc[12]' --exclude=CVS gettext-cvs/gettext-tools/src/x-glade.c gettext-6/gettext-tools/src/x-glade.c *** gettext-cvs/gettext-tools/src/x-glade.c Sat Apr 1 23:40:50 2006 --- gettext-6/gettext-tools/src/x-glade.c Tue Apr 4 02:47:32 2006 *************** *** 125,132 **** --- 125,137 ---- static void (*p_XML_SetCommentHandler) (XML_Parser parser, XML_CommentHandler handler); static int (*p_XML_Parse) (XML_Parser parser, const char *s, int len, int isFinal); static enum XML_Error (*p_XML_GetErrorCode) (XML_Parser parser); + #if XML_MAJOR_VERSION >= 2 + static XML_Size (*p_XML_GetCurrentLineNumber) (XML_Parser parser); + static XML_Size (*p_XML_GetCurrentColumnNumber) (XML_Parser parser); + #else static int (*p_XML_GetCurrentLineNumber) (XML_Parser parser); static int (*p_XML_GetCurrentColumnNumber) (XML_Parser parser); + #endif static void (*p_XML_ParserFree) (XML_Parser parser); static const XML_LChar * (*p_XML_ErrorString) (int code); *************** *** 148,154 **** { if (libexpat_loaded == 0) { ! void *handle = dlopen ("libexpat.so.0", RTLD_LAZY); if (handle != NULL && (p_XML_ParserCreate = dlsym (handle, "XML_ParserCreate")) != NULL && (p_XML_SetElementHandler = dlsym (handle, "XML_SetElementHandler")) != NULL --- 153,166 ---- { if (libexpat_loaded == 0) { ! void *handle; ! /* Be careful to use exactly the version of libexpat that matches the ! binary interface declared in . */ ! #if XML_MAJOR_VERSION >= 2 ! handle = dlopen ("libexpat.so.1", RTLD_LAZY); ! #else ! handle = dlopen ("libexpat.so.0", RTLD_LAZY); ! #endif if (handle != NULL && (p_XML_ParserCreate = dlsym (handle, "XML_ParserCreate")) != NULL && (p_XML_SetElementHandler = dlsym (handle, "XML_SetElementHandler")) != NULL *************** *** 413,428 **** } if (XML_Parse (parser, buf, count, 0) == 0) ! error (EXIT_FAILURE, 0, _("%s:%d:%d: %s"), logical_filename, ! XML_GetCurrentLineNumber (parser), ! XML_GetCurrentColumnNumber (parser) + 1, XML_ErrorString (XML_GetErrorCode (parser))); } if (XML_Parse (parser, NULL, 0, 1) == 0) ! error (EXIT_FAILURE, 0, _("%s:%d:%d: %s"), logical_filename, ! XML_GetCurrentLineNumber (parser), ! XML_GetCurrentColumnNumber (parser) + 1, XML_ErrorString (XML_GetErrorCode (parser))); XML_ParserFree (parser); --- 425,440 ---- } if (XML_Parse (parser, buf, count, 0) == 0) ! error (EXIT_FAILURE, 0, _("%s:%lu:%lu: %s"), logical_filename, ! (unsigned long) XML_GetCurrentLineNumber (parser), ! (unsigned long) XML_GetCurrentColumnNumber (parser) + 1, XML_ErrorString (XML_GetErrorCode (parser))); } if (XML_Parse (parser, NULL, 0, 1) == 0) ! error (EXIT_FAILURE, 0, _("%s:%lu:%lu: %s"), logical_filename, ! (unsigned long) XML_GetCurrentLineNumber (parser), ! (unsigned long) XML_GetCurrentColumnNumber (parser) + 1, XML_ErrorString (XML_GetErrorCode (parser))); XML_ParserFree (parser);