From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20092 invoked by alias); 9 Mar 2007 22:09:45 -0000 Received: (qmail 20083 invoked by uid 22791); 9 Mar 2007 22:09:44 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Mar 2007 22:09:39 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l29M9aa6010193 for ; Fri, 9 Mar 2007 17:09:36 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l29M9akT004095 for ; Fri, 9 Mar 2007 17:09:36 -0500 Received: from opsy.redhat.com (ton.toronto.redhat.com [172.16.14.15]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l29M9Y1F025009; Fri, 9 Mar 2007 17:09:34 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 7EA973781EA; Fri, 9 Mar 2007 14:55:56 -0700 (MST) To: GCJ-patches Subject: Patch: FYI: disable XML service files From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Fri, 09 Mar 2007 22:09:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2007-q1/txt/msg00661.txt.bz2 I'm checking this in on the trunk and the RH 4.1 branch. This removes the XML service files from libgcj.so. This lets us override things properly again. Andrew, I tried your test case from ifoox, but I can only see the failure if I back out some of the latest XML bug fixes. However a simpler test case shows which thing we're actually loading: import javax.xml.parsers.*; public class q { public static void main(String[] args) throws Throwable{ DocumentBuilderFactory tf = DocumentBuilderFactory.newInstance(); System.out.println(tf.getClass()); } } Eg, here's the bug in action: opsy. gij -Djava.class.path=/usr/share/java/xerces-j2.jar:. q class gnu.xml.dom.DomDocumentBuilderFactory Tom Index: ChangeLog from Tom Tromey * sources.am, Makefile.in: Rebuilt. * scripts/makemake.tcl (scan_directory): Allow service files to be omitted. Omit all XML-related service files. Index: scripts/makemake.tcl =================================================================== --- scripts/makemake.tcl (revision 122761) +++ scripts/makemake.tcl (working copy) @@ -123,6 +123,14 @@ # We haven't merged locale resources yet. set properties_map(gnu/java/locale) _ +# We want to be able to load xerces if it is on the class path. So, +# we have to avoid compiling in the XML-related service files. +set properties_map(META-INF/services/javax.xml.parsers.DocumentBuilderFactory) _ +set properties_map(META-INF/services/javax.xml.parsers.SAXParserFactory) _ +set properties_map(META-INF/services/javax.xml.parsers.TransformerFactory) _ +set properties_map(META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory) _ +set properties_map(META-INF/services/org.w3c.dom.DOMImplementationSourceList) _ +set properties_map(META-INF/services/org.xml.sax.driver) _ # List of all properties files. set properties_files {} @@ -223,8 +231,10 @@ } elseif {[file isdirectory $file]} { lappend subdirs $subdir/$file } elseif {$subdir == "META-INF/services"} { - # All service files are included as properties. - lappend properties_files $basedir/$subdir/$file + # Service files are generally included as properties. + if {! [info exists properties_map($subdir/$file)]} { + lappend properties_files $basedir/$subdir/$file + } } } cd $here