Re: Next steps for GNU Classpath
On 16/09/14 22:04, Bill Chatfield wrote: I went looking for Zulu's source code. It should available since OpenJDK is GPLed. But they do not provide it unless you request it and then it looks like they only provide the parts that were based on GPL code, which implies that there is more code to their product that they aren't going to provide. As I understand it, they're supporting an unaltered version of OpenJDK. But I do not speak for Azul. Thus is really off-topic for this list, BTW. We should continue this on distro-pkg-...@openjkd.java.net if necessary. Andrew.
Re: Next steps for GNU Classpath
On 09/16/2014 04:47 PM, Bill Chatfield wrote: OpenJDK is Linux-only. It does not work on Windows. Huh? Since when? Andrew.
Re: Clarification and apologies (was Re: Re: GCJ ------ file type not supported by system)
On 06/09/14 00:36, Brian Jones wrote: On Sep 5, 2014, at 2:04 PM, Andrew Haley a...@redhat.com wrote: On 09/05/2014 06:53 PM, Brian Jones wrote: GCJ needs to use IcedTea. What for? Just mean updating to OpenJDK, understanding Java 6,7,8,9,... Absolutely. I know what this involves, and have been looking for a reason to do this for a long time. I think that in some areas this could be very useful. But it's a lot of work, and it might be hard to get high performance. Andrew.
Re: Clarification and apologies (was Re: Re: GCJ ------ file type not supported by system)
On 09/05/2014 12:07 PM, Guillermo Rodriguez Garcia wrote: After reading in a previous post that Classpath was not being actively developed anymore, I said that it would be a pity to let the project die, and suggested that perhaps it was time to look for an adopter (http://developer.classpath.org/pipermail/classpath/2014-August/003270.html) That was perhaps my fault; I said it was not being actively developed, when I should have said it was not much being actively developed. That's a subtle distinction, but one that matters to some people. Andrew.
Re: GCJ ------ file type not supported by system
On 03/09/14 18:59, Per Bothner wrote: On 09/03/2014 09:35 AM, Guillermo Rodriguez Garcia wrote: What would you like me to do? How can I help ? More useful than updating Classoath per se would be creating a version of GCJ that uses OpenJDK's javac for compiling to bytecodes, Why? Eclipse's javac seems fine. (I don't believe Eclipse's compiler is as solid or complete, though that may be my bias from having worked with javac engineers. It's probably good enough for at least the initial stages of merging in OpenJDK classes.) Oh, OK. Most of the world I know about uses Eclipse for everything. Andrew.
Re: GCJ ------ file type not supported by system
On 09/04/2014 09:07 PM, Pekka Enberg wrote: El jueves, 4 de septiembre de 2014, Pekka Enberg penb...@kernel.org escribió: No, it's really not unfair at all. You are basically saying Andrew is doing a crappy job as a maintainer On Thu, Sep 4, 2014 at 10:29 PM, Guillermo Rodriguez Garcia guille.rodrig...@gmail.com wrote: No, I am definitely NOT saying that, nothing even close. Please don't put your words in my mouth, thank you. Of course you are saying that. Why else would you even bring up the issue of finding a competent successor which implies that Andrew is no longer interested in GNU Classpath and neglecting its maintenance? Whoa Pekka, be nice. Let's just assume that Guillermo is sincere, and he wants to help. The problem isn't competence. All of us are competent. It's a lack of time. All of us, I believe, have day jobs, and none of them are in GNU Classpath development. El jueves, 4 de septiembre de 2014, Pekka Enberg penb...@kernel.org escribió: Once you answer the hypothetical question *who* should be the successor, you will understand why. On Thu, Sep 4, 2014 at 10:29 PM, Guillermo Rodriguez Garcia guille.rodrig...@gmail.com wrote: I see, so if I don't have the answer, the question makes no sense. Ok. You didn't even try to answer the question, did you? If Andrew actually needed a competent successor (he doesn't), what is required of that person? The person needs to be an active developer, needs to understand GNU Classpath well, and has to have support from people who actually developed the project, right? Are you able to make an educated guess who actually meets that criteria? Guillermo, please. You phrased your point badly, in a way that was likely to annoy people. I believe that you didn't want to do that. Everyone: let's have a proper discussion. Is there something we can do with GNU Classpath that takes it further forward. And, if so, what? What would our goals be? Andrew.
Re: GCJ ------ file type not supported by system
On 09/03/2014 05:12 PM, Guillermo Rodriguez Garcia wrote: 1. Development of GNU Classpath seems to be stalled now (quoting from an earlier post from Andrew Haley: I have to tell you that Classpath is not being actively developed, so your problem is unlikely to be fixed.) 2. This is due to the lack of manpower, which in turn is probably due to the lack of interested developers, but also to the fact that most of the development effort of the current team is going to OpenJDK instead. 3. Given the above, perhaps the current maintainers should consider switching priorities and start actively looking for a competent successor (as in lesson #5 of ESR's The Cathedral and the Bazaar). Your opinion has been noted. Now, what do *you* intend to do to help? Andrew.
Re: GCJ ------ file type not supported by system
Hi, On 09/03/2014 05:35 PM, Guillermo Rodriguez Garcia wrote: Hi Andrew, 2014-09-03 18:30 GMT+02:00 Andrew Haley a...@redhat.com: On 09/03/2014 05:12 PM, Guillermo Rodriguez Garcia wrote: 1. Development of GNU Classpath seems to be stalled now (quoting from an earlier post from Andrew Haley: I have to tell you that Classpath is not being actively developed, so your problem is unlikely to be fixed.) 2. This is due to the lack of manpower, which in turn is probably due to the lack of interested developers, but also to the fact that most of the development effort of the current team is going to OpenJDK instead. 3. Given the above, perhaps the current maintainers should consider switching priorities and start actively looking for a competent successor (as in lesson #5 of ESR's The Cathedral and the Bazaar). Your opinion has been noted. Now, what do *you* intend to do to help? I am willing to help where possible. Sending patches or bugfixes is OK (and I will do so if I come across any problems), but in my opinion this does not address the real problem. For example *I* cannot update the GNU Classpath page to list 0.99, and not 0.98, as the current version. Almost all of GNU Classpath is under source control, and patches are welcome. A new version of the web page is welcome. Having said that, I don't have access to the web page, but I think we can get it. What would you like me to do? How can I help ? I think I'd like people to fix problems when they find them. Update Classpath to Java 1.6. isn't a reasonable interim goal. Andrew.
Fwd: Re: GCJ ------ file type not supported by system
I don't have an answer for you. Maybe someone on the Classpath list does. But I have to tell you that Classpath is not being actively developed, so your problem is unlikely to be fixed. You'll have to debug it yourself or find someone to debug it. Sorry. Andrew. ---BeginMessage--- I create a native exe [...] And at this point crashes the program [...] http://sscce.org/ Regards, Bodo I apologise for my trifling. I think too much on this problematic error message, and I forgot to take notice of correct form of requiring a support. I create a native exe for windows by Cygvin.gcj v4.8.3. This ended perfectally. And when I like to run, than exe start and run to the point where I like to write to output a sound stream with the Audio stream with the javax.sound.sampled.AudioSystem.write(...) method. 2nd parameter of this method is AudioFileFormat.Type.WAVE. Exactly the Java source is: private long genSliceFeat(int featStart, int featEnd) throws Exception { WaveReader reader = new WaveFileReader(audioFile); AudioFormat format = reader.getFormat(); int framStart = ((int) (featStart * freqRatio)); int framEnd = ((int) (featEnd * freqRatio)); int frameSize = format.getFrameSize(); long pos = framStart * frameSize; byte[] wbytes = new byte[(framEnd - framStart) * frameSize]; int read = reader.read(pos, wbytes); ByteArrayInputStream bais = new ByteArrayInputStream(wbytes); AudioInputStream ais = new AudioInputStream(bais, format, read / frameSize); AudioSystem.write(ais, AudioFileFormat.Type.WAVE, sliceWavFile); bais.close(); ais.close(); bais = null; ais = null; System.gc(); return extractWave(sliceWavFile, featureFile, FRONTEND_NAME_FOR_WAVE); } And the error message concerns to the AudioFileFormat.Type.WAVE parameter which gives the type of output sound file. And at this point crashes the program with the next error message: java.lang.IllegalArgumentException: file type not supported by system at javax.sound.sampled.AudioSystem.write(Unknown Source) at com.all.smws.speech.SpeechFilter.genSliceFeat(Unknown Source) at com.all.smws.speech.SpeechFilter.getAnnotations(Unknown Source) at com.all.sndsep.segmentation.Segmentor.getNewAnnotations(Unknown Source) at com.all.sndsep.segmentation.Segmentor.getNewAnnotations(Unknown Source) at com.all.sndsep.segmentation.Segmentor.getNewAnnotations(Unknown Source) at com.all.sndsep.segmentation.Segmentor.getAllAnnotations(Unknown Source) at com.all.smws.speech.SpeechFilter.getSmwsAnnotations(Unknown Source) at com.all.smws.speech.SMWS.getSpeech(Unknown Source) at com.all.onins.oi.stream.OnlineInputStream.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Please, help me someone with any words about why. The command line, which generates the exe in Cygwin gcj -fjni -mwindows --main=com.all.onins.oi.OnlineInputStub ./Jars/sndsep.jar ./Jars/sns.jar ./Jars/smws.jar ./Jars/onins.jar -o onins_noopt.exe Best regards Gyozo Karsai from Hungary ---End Message---
Re: Remove obsolete Solaris 9 support
On 04/16/2014 12:16 PM, Rainer Orth wrote: * I'm removing the sys/loadavg.h check from classpath. Again, I'm uncertain if this is desirable. In the past, classpath changes were merged upstream by one of the libjava maintainers. We should not diverge from GNU Classpath unless there is a strong reason to do so. Andrew.
Re: [cp-patches] ask help about cross complier of supportting java
Hi, On 12/27/2012 06:32 AM, 阿林 wrote: I want to build cross compiler of gcc of 4.4.4. I can built success for c,c++. But when I try to add language of java. I failed. I also read the document , the cross section is too short and non detailed. In the document, only If the cross compiler is to be built with support for the Java programming language and the ability to compile .java source files is desired, the installed native compiler used to build the cross compiler needs to be the same GCC version as the cross compiler. In addition the cross compiler needs to be configured with --with-ecj-jar=... . Since I use ppc64 and try to build ppc. I don't know how to use this option. I use the ecj of 64-bit package, I am not sure if it is ok. That's fine. ecj.jar is good for 32- and 64-bit builds. Andrew.
[cp-patches] [4.8 Regression] gjavah throws an exception
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55716 This bug is caused by http://cvs.savannah.gnu.org/viewvc/classpath/tools/gnu/classpath/tools/javah/Main.java?root=classpathr1=1.13r2=1.14 Automagic handling of inner classes was added, but in a bogus way. If a class has inner classes, those inner classes are searched on the classpath. This is wrong if the argument to javah is a filename: the inner class may not exist on the classpath, and even if they do they will be the wrong versions. IMO, if given filenames gjavah should not search for inner classes at all. This patch does so. I have another patch that finds the correct inner class files for a a class, but this is better. As a whitespace diff it is simply Index: Main.java === --- Main.java (revision 194553) +++ Main.java (working copy) @@ -370,6 +370,8 @@ results.put(filename, klass); parsed.add(item.toString()); +if (! (item instanceof File)) + { // Check to see if there are inner classes to also parse Iterator? innerClasses = klass.innerClasses.iterator(); HashSetObject innerNames = new HashSetObject(); @@ -381,6 +383,7 @@ } results.putAll(parseClasses(innerNames.iterator())); } + } return results; } Andrew. 2012-12-17 Andrew Haley a...@redhat.com * tools/gnu/classpath/tools/javah/Main.java (parseClasses): Dont scan inner classes if our item is a file. Index: Main.java === --- Main.java (revision 194553) +++ Main.java (working copy) @@ -370,16 +370,19 @@ results.put(filename, klass); parsed.add(item.toString()); -// Check to see if there are inner classes to also parse -Iterator? innerClasses = klass.innerClasses.iterator(); -HashSetObject innerNames = new HashSetObject(); -while (innerClasses.hasNext()) +if (! (item instanceof File)) { -String innerName = ((InnerClassNode) innerClasses.next()).name; -if (!parsed.contains(innerName)) - innerNames.add(innerName); +// Check to see if there are inner classes to also parse +Iterator? innerClasses = klass.innerClasses.iterator(); +HashSetObject innerNames = new HashSetObject(); +while (innerClasses.hasNext()) + { +String innerName = ((InnerClassNode) innerClasses.next()).name; +if (!parsed.contains(innerName)) + innerNames.add(innerName); + } +results.putAll(parseClasses(innerNames.iterator())); } -results.putAll(parseClasses(innerNames.iterator())); } return results; }
Re: [cp-patches] tagging classpath for GCC import
On 12/03/2012 09:05 AM, Mark Wielaard wrote: Ah, sorry. That must make it look like GNU Classpath is even less active than it is :{ It is good to keep the CVS repo around for some time, just for the historical information like branches and tags that didn't transfer to the git repo. But that's not supposed to happen, surely. The transfer to GIT isn't complete until the tags have been copied. Andrew.
Re: [cp-patches] GNU Classpath
On 10/20/2012 10:03 AM, Chris Burdess wrote: Mario Torre wrote: No. Updating the ChangeLog is a requirement. Maybe it's a requirement, but to be honest, is also a very redundant piece of information that is already in the commit log, The commit log is not part of the package. People may want to download the package and see who the contributors were and when; the ChangeLog is a long established convention for them to do this. Exactly. It makes no sense to make such a process change at this point in Classpath's history. We have always been able, in theory, to build the ChangeLog from the commit log. Nothing in this respect has changed. It's not a very onerous requirement. Andrew.
Re: [cp-patches] GNU Classpath
On 10/13/2012 02:50 AM, Ivan Maidanski wrote: May be it's time to change the policy of patch acceptance from please find a person who reviews (among 1 or 2 guys) your code to if signed FSF paper, and you have patches, post them to ML, commit to some feature development branch and, if no objections within 2-3 weeks, merge the branch to master, in case of further objections revert the patches. Sorry about that. There are quite a few people who can review patches, but we might need prompting. No reason why you shouldn't review patches too, but you should still have someone else look at them. It is true that it's better to accept a patch that looks basically OK than hold it back because no-one has time to go through it line-by-line. Please post a summary mail of the patches. Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 05:02 PM, Pekka Enberg wrote: git push savannah master That worked, thanks. I'm sure someone will let me know if I did it wrong. :-) Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 09:54 PM, Ivan Maidanski wrote: Hi Andrew, Thank you for the explanation. Thu, 29 Mar 2012 18:33:45 +0100 Andrew Haley a...@redhat.com: On 03/29/2012 06:19 PM, Ivan Maidanski wrote: Hi Andrew, Thu, 29 Mar 2012 17:42:17 +0100 от Andrew Haley a...@redhat.com: On 03/29/2012 04:58 PM, Ivan Maidanski wrote: It would be good to deprecate ChangeLog (used as commit log) as well. Why? I think this sentence is missing a because ... clause. Sorry for not explaining you how does git merge work. if you don't have a special ChangeLog-aware merge driver installed (like git-merge-changelog) you would almost always get merge conflicts when pulling public modifications into a privately modified ChangeLog file (same for rebasing). Every merge conflict requires manual handling. If it is decided to move to VCS that simplifies parallel development and branch merging, staying with old commit policy (relying on ChangeLog) neutralizes that benefits. But that's what the git ChangeLog plugin is for. GNU projects have ChangeLogs; The plugin is merely a workaround. I don't understand this comment. The plugin makes git handle ChangeLogs correctly; there are plugins to make it handle other formats correctly, too. You say GNU projects have X Why? (because is missing) Because the ChangeLog is useful to have, independently of any particular VCS. You you put ChangeLog to ignored list and regenerate on tarball release via git log would it be possible to say the project has ChangeLog or not? As long as there is a ChangeLog, it doesn't matter at all how it is created, as long as it's correct, complete, and properly formatted. In any case, let's not have this mailing list degenerate into my VCS versus yours flame wars, just like every other list. Agree but if there is a choice - augmented pros and cons are generally welcomed. But I don't think there is a choice. It's too late, so all this discussion is moot. Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/30/2012 09:17 AM, Andrew Haley wrote: You you put ChangeLog to ignored list and regenerate on tarball release via git log would it be possible to say the project has ChangeLog or not? As long as there is a ChangeLog, it doesn't matter at all how it is created, as long as it's correct, complete, and properly formatted. One thing I forgot to mention: tooling is critical. I don't have to create properly-formatted ChangeLog entries by myself because there are tools to do it. Any change to policies requires complete tooling support or people will waste time having to generate entries by hand. Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 03:52 PM, Andrew Hughes wrote: The CVS repository is obsolete. Current development takes place in git: I missed that. OK, I'll push the patch to git. We need at least to make the CVS read-only. Why are we using yet another VCS, anyway? We can pretty much guarantee that free Java devs are used to Mercural and maybe Subversion, but git? Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 04:12 PM, Chris Burdess wrote: Because nobody spoke up during the review period, so the first suggestion was accepted. Yes, I'm sure that's the meta-reason, and I should have been paying more attention. :-( Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 04:58 PM, Ivan Maidanski wrote: It would be good to deprecate ChangeLog (used as commit log) as well. Why? I think this sentence is missing a because ... clause. Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 06:19 PM, Ivan Maidanski wrote: Hi Andrew, Thu, 29 Mar 2012 17:42:17 +0100 от Andrew Haley a...@redhat.com: On 03/29/2012 04:58 PM, Ivan Maidanski wrote: It would be good to deprecate ChangeLog (used as commit log) as well. Why? I think this sentence is missing a because ... clause. Sorry for not explaining you how does git merge work. if you don't have a special ChangeLog-aware merge driver installed (like git-merge-changelog) you would almost always get merge conflicts when pulling public modifications into a privately modified ChangeLog file (same for rebasing). Every merge conflict requires manual handling. If it is decided to move to VCS that simplifies parallel development and branch merging, staying with old commit policy (relying on ChangeLog) neutralizes that benefits. But that's what the git ChangeLog plugin is for. GNU projects have ChangeLogs; it's up to the VCS to keep up. PS. I was surprised to hear that free Java developers prefer SVN to Git. So was I. Who said that Java developers prefer SVN to Git? How many free Java developers have been contributing to Classpath over the passed 3-4 years? And which of them prefer to stay with CVS and SVN? Well, I vastly prefer SVN to anything I've seen recently because of its branch handling, but maybe that's only me. In any case, let's not have this mailing list degenerate into my VCS versus yours flame wars, just like every other list. Andrew.
Weirdness in native/jni/java-io/java_io_VMConsole.c
There's a very odd comment in this file: it clearly refers to some method in another file. But what was it for, anyway? Surely the name of a method and its signature is contained in the code. I'd just delete it. /* * Class: java_io_VMConsole * Method:echo * Signature: (Z)Z */ JNIEXPORT jstring JNICALL Java_java_io_VMConsole_readPassword (JNIEnv * env, jclass clazz __attribute__ ((__unused__)), jobject con) { Andrew.
Re: [cp-patches] [commit-cp] classpath ChangeLog native/jni/java-io/java_io_...
On 03/29/2012 03:52 PM, Andrew Hughes wrote: The CVS repository is obsolete. Current development takes place in git: http://git.savannah.gnu.org/cgit/classpath.git See this thread: http://developer.classpath.org/pipermail/classpath/2012-March/003181.html -- zebedee:classpath $ git push ssh://git.savannah.gnu.org/cgit/classpath.git/ fatal: '/cgit/classpath.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly Any idea what git wants to do the push? Andrew.
Re: [cp-patches] Fix libjava bootstrap failure around IUCLC
On 03/26/2012 11:47 AM, Pekka Enberg wrote: On Mon, Mar 26, 2012 at 1:11 PM, Mark Wielaard m...@klomp.org wrote: On Mon, 2012-03-26 at 10:01 +0100, Andrew Haley wrote: On 03/25/2012 05:08 PM, Gerald Pfeifer wrote: 2012-03-25 Gerald Pfeifer ger...@pfeifer.com PR libgcj/52694 * java/io/natVMConsole.cc (IUCLC): Define, if undefined. Sure. WTF is IUCLC anyway? :-) (map) Input (characters) UpperCase (to) Lower Case. It is a non-posix termios extension. patch should also go into upstream classpath. Yes, please. Btw, why are people not fixing GNU Classpath upstream-first? Because, I guess, no-one is using it. At least, if they were, this bug would have been noticed. Andrew.
Fwd: classpath configure update?
---BeginMessage--- Hi all, I recently pushed a commit to gcc head and gcc-4.6 to fix the detection of FreeBSD-10. http://gcc.gnu.org/ml/gcc-cvs/2011-11/msg00886.html Now I see that I need to do that for libjava/classpath/configure too. My question, how do I do that? Means, can I simply commit the fix to the gcc/libjava/classpath and don't care about upstream classpath? Or how do I proceed? Thanks for your help. Andreas ---End Message---
Re: [cp-patches] [RFC/PATCH] Generate META-INF/INDEX.LIST file for glibj.zip
On 05/27/2011 04:45 AM, Dr Andrew John Hughes wrote: On 15:39 Thu 26 May , Pekka Enberg wrote: This patch changes the glibj.zip packaging so that META-INF/INDEX.LIST is generated to the file. This is needed for VMClassLoader.getBootPackages() to work correctly: private static String[] getBootPackages() { URL indexList = getResource(META-INF/INDEX.LIST); if (indexList != null) { NOTE! This problem is only seen with Jato currently as it's the only VM I'm aware of that doesn't override any of the classes in vm/reference. CACAO and JamVM override the whole classloading parts themselves. I asked about this on IRC and Mark Wielaard explained background on the issue: mjw 2006-04-19 Olivier Jolly olivier.jo...@pcedev.com mjw* vm/reference/java/lang/VMClassLoader.java (getBootPackages): Loads mjwboot packages list from the META-INF/INDEX.LIST file if it exists. mjw http://developer.classpath.org/pipermail/classpath-patches/2006-April/001704.html mjw the patch to support the -i option should be incorporated soon and we'll be able to add the creation of the index to the glibj.zip by default. mjw soon just happens the be 5 years... Signed-off-by: Pekka Enberg penb...@kernel.org --- lib/Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index 8104ee7..50d1baa 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -71,7 +71,7 @@ glibj.zip: else if WITH_JAR -CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF +CREATE_GLIBJ_ZIP=$(JAR) cf glibj.zip gnu java javax org sun META-INF $(JAR) i glibj.zip else CREATE_GLIBJ_ZIP=$(ZIP) -r -D glibj.zip gnu java javax org sun META-INF /dev/null endif -- 1.7.4.1 My only concern with the patch (as I think Mark also raised on IRC) is that it means the index is only generated if WITH_JAR is set and not if $(ZIP) is used. Should we just drop the $(ZIP) option and require jar to be available? I suspect the reason we haven't done this is a bootstrapping issue. That's right. Is there some reason that zip can't generate the index? I thought it was just another file. Andrew.
Re: MessageBundle ???
On 04/01/2011 08:32 PM, Mark Wielaard wrote: On Fri, 2011-04-01 at 18:43 +0100, Andrew Haley wrote: java.lang.NumberFormatException: invalid character at position 2 in 09 That's just a bug: leading zeroes in format fields aren't being handled correctly. The 09 is being parsed as an octal number because it begins with a zero. The fix for the exception is Coincidentally the exact same problem and fix were discovered by Pekka and went into GNU Classpath recently. gcc is in Stage 1, so we could just bulk-import Classpath. What do you think? Andrew.
Re: [cp-patches] gcj/classpath cosmetic configure improvement
On 01/31/2011 05:32 AM, Alexandre Oliva wrote: I noticed by accident that classpath's configure printed “no: command not found”. It turned out that “no” isn't a very good command to pass to AM_CONDITIONAL, because although it works, it's a bit noisy. I changed it to false, that should have the same effect, except that it won't be noisy on most systems. I'm checking this in at this point in the development cycle although it doesn't fix any open bug reports and I have no idea whether it's a regression just because it's such a trivial patch. OK, but please also send to classpath. We don't want divergences. Andrew.
Re: Segmentation faults when calling into libjavanio.so
On 12/21/2010 07:09 AM, Rob Hammond wrote: Hi, I wonder if anyone could help me here. I have been trying to cross compile classpath to Freescale MCP85xx using ELDK 4.1 toolchain. The configuration of the toolchain of classpath looks fine ( I can provide it if nessisary ) but when I use it in conjunction with JamVM I am getting a segmentation fault on the first call into the classpath shared libraries ( gnu.java.nio.VMChannel.initID ). I did an ObjDump of both Classpath Jamvm headers to check I had compiled it to PowerPC which it did.. It all works fine on x86. I suspect that the shared libraries are malformed in some way but I'm kinda stuck now. I don't know what else to try. It seems there are many people out there using these two packages cross-compiled to powerpc and it has just worked for them. I don't understand why I'm getting these problems. You're going to have to use gdb. Andrew.
Re: [cp-patches] [PATCH] Fix java.lang.Class field and method API for null names
On 12/12/2010 11:46 AM, Pekka Enberg wrote: This patch fixes Class getDeclaredField, getDeclaredMethod, getField, and getMethod API to throw NullPointerException if given name is null. Thanks, but two things: a. What happens with the current code base? b. We need a change log entry. Andrew.
Re: Future blog
On 12/08/2010 05:17 PM, Dr Andrew John Hughes wrote: On 11:13 Wed 08 Dec , Andrew Haley wrote: On 12/08/2010 10:58 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 12:32 PM, Andrew Haley a...@redhat.com wrote: I hereby offer to review some patches. Please send pointers to the list. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006511.html This needs a ChangeLog, otherwise OK. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006513.html This needs a ChangeLog, otherwise OK. I've already seen these and I agree both seem fine. But Pekka needs a copyright assignment before any more work can be committed. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006512.html What compatibility problem does this fix? I'd like to see a test case in Mauve for this before we change this. That's not a good reason not to commit: the fix is in other versions, including gcj. Andrew.
Re: Future blog
On 12/08/2010 05:15 PM, Dr Andrew John Hughes wrote: In Ivan's case, I've reviewed a number of the patches and I've had to do work on most of them to get them in a state where they can be committed. This is why I've been hesitant on giving commit access if the result is that it will break things that may be hard to trace later. I'm not saying every patch has to be perfect. But I do think that they should generally be reviewed, especially when the developer is new to Classpath development. Sure. I'll try to have a look at a few of them today. Andrew.
Re: Future blog
On 12/08/2010 08:02 PM, Ivan Maidanski wrote: I remember you (or someone else) had pointed me about of inconvenience of reading my patches in the form they were attached and I had promised to use .diff.txt file extension but forgot about it after a long delay. (there is such problem in, say, hpl.com mailing list where I frequently send my patches to; besides, I have no problem in opening the attachment in the link below in Firefox which I use). I apologies for the inconvenience and I'll try to keep in my mind that it's better to use .txt extension when posting to this ML. And every ML, I would have thought. What possible advantage could there be in generating patch mails in which the patch doesn't appear in the body of the mail? Andrew.
Re: Future blog
On 12/08/2010 08:02 PM, Ivan Maidanski wrote: I remember you (or someone else) had pointed me about of inconvenience of reading my patches in the form they were attached and I had promised to use .diff.txt file extension but forgot about it after a long delay. (there is such problem in, say, hpl.com mailing list where I frequently send my patches to; besides, I have no problem in opening the attachment in the link below in Firefox which I use). I apologies for the inconvenience and I'll try to keep in my mind that it's better to use .txt extension when posting to this ML. This turns out to be a known Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=327323 The bugzilla shows a way around this problem. I appended the following line to my .mailcap: application/octet-stream;/usr/bin/emacs %u So, at least it is now possible to see the patches without first saving them and then opening in an editor as a separate action. Note that I am not recommending that anyone use incorrect MIME-types in future, just that there is at least a workaround. Andrew.
Re: Future blog
On 12/09/2010 12:44 PM, Dr Andrew John Hughes wrote: On 11:03 Thu 09 Dec , Andrew Haley wrote: On 12/08/2010 08:02 PM, Ivan Maidanski wrote: I remember you (or someone else) had pointed me about of inconvenience of reading my patches in the form they were attached and I had promised to use .diff.txt file extension but forgot about it after a long delay. (there is such problem in, say, hpl.com mailing list where I frequently send my patches to; besides, I have no problem in opening the attachment in the link below in Firefox which I use). I apologies for the inconvenience and I'll try to keep in my mind that it's better to use .txt extension when posting to this ML. This turns out to be a known Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=327323 The bugzilla shows a way around this problem. I appended the following line to my .mailcap: application/octet-stream;/usr/bin/emacs %u So, at least it is now possible to see the patches without first saving them and then opening in an editor as a separate action. Note that I am not recommending that anyone use incorrect MIME-types in future, just that there is at least a workaround. It also only solves part of the problem. AFAICS, you still have to open the patch in an external application instead of reading it in the mail itself. Yes, of course. It's a lot less painful, though. Andrew.
Re: Future blog
On 12/09/2010 12:45 PM, Dr Andrew John Hughes wrote: On 09:42 Thu 09 Dec , Andrew Haley wrote: On 12/08/2010 05:17 PM, Dr Andrew John Hughes wrote: On 11:13 Wed 08 Dec , Andrew Haley wrote: On 12/08/2010 10:58 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 12:32 PM, Andrew Haley a...@redhat.com wrote: I hereby offer to review some patches. Please send pointers to the list. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006511.html This needs a ChangeLog, otherwise OK. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006513.html This needs a ChangeLog, otherwise OK. I've already seen these and I agree both seem fine. But Pekka needs a copyright assignment before any more work can be committed. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006512.html What compatibility problem does this fix? I'd like to see a test case in Mauve for this before we change this. That's not a good reason not to commit: the fix is in other versions, including gcj. I disagree. Just because the version in gcj is different doesn't mean it's correct. Well, it means it's been reviewed already. In this case I know it's already been tested because I tested it, as the mails show. As far as I'm aware, Pekka already has a testcase for this so it would be good to have it in Mauve. Definitely. Andrew.
Re: [cp-patches] Minor refactoring of Character class
On 06/15/2010 07:00 PM, Ivan Maidanski wrote: Hi! Here, I replaced numerous String.zeroBasedStringValue(CharData.xxx[i]) with a single call to convertCharData() (which does the work). The other changes are several minor optimizations of expressions. ChangeLog entries: * java/lang/Character.java (UnicodeBlock.of, UnicodeBlock.forName): Remove the trailing dot character for exception messages. * java/lang/Character.java (charCache): Make the private field final. * java/lang/Character.java (convertCharData): New private static function (called during the class initialization only). * java/lang/Character.java (blocks, data, numValue, upper, lower, direction): Call convertCharData() (which creates the appropriate array and calls zeroBasedStringValue() for each array element). * java/lang/Character.java (readCodePoint, reverseBytes): Remove unnecessary operation. * java/lang/Character.java (isSpace): Simplify the expression. OK. Andrew.
Re: Future blog
On 12/08/2010 10:56 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 12:32 PM, Andrew Haley a...@redhat.com wrote: Anyway, I don't mind that as long as someone else does it. (Clearly, the issue of developers without commit access is a red herring, as every developer should have commit access.) But it's not a red herring! I don't expect to have commit rights to GNU Classpath. I'm more than happy to send patches to the list and have someone else merge them (that's in fact a model I personally prefer). This model does not scale. Also, it is unreliable: no-one should commit a patch they haven't tested themselves. It leads to extra work. It's also bad because it leads to two classes of developers, those with and those without commit access. Every developer should commit their own patches. Andrew.
Re: Future blog
On 12/08/2010 10:58 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 12:32 PM, Andrew Haley a...@redhat.com wrote: I hereby offer to review some patches. Please send pointers to the list. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006511.html http://developer.classpath.org/pipermail/classpath-patches/2010-November/006513.html http://developer.classpath.org/pipermail/classpath-patches/2010-November/006512.html There's also 10-15 patches from Ivan sitting in the archives and from last count roughly the same amount of patches in Bugzilla. The Classpath route is to post patches to the list. I think this is true of most GNU projectes. Andrew.
Re: Future blog
On 12/08/2010 10:58 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 12:32 PM, Andrew Haley a...@redhat.com wrote: I hereby offer to review some patches. Please send pointers to the list. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006511.html This needs a ChangeLog, otherwise OK. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006513.html This needs a ChangeLog, otherwise OK. http://developer.classpath.org/pipermail/classpath-patches/2010-November/006512.html What compatibility problem does this fix? There's also 10-15 patches from Ivan sitting in the archives Hmm, I had seen some discussion around those and thought they were being addressed. Bring them on! Andrew.
Re: Future blog
On 12/08/2010 11:32 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 1:13 PM, Andrew Haley a...@redhat.com wrote: There's also 10-15 patches from Ivan sitting in the archives Hmm, I had seen some discussion around those and thought they were being addressed. Bring them on! I'm not sure if this is all of it but it's a start anyway: http://developer.classpath.org/pipermail/classpath-patches/2010-June/006411.html Ah, yes, these were the patches that were sent hex encoded with a MIME type of application/octet-stream. Needless to say these didn't get reviewed. I'll have a look, but IMO it is unreaslistic to expect a reviewer to save an attachment and open it in an external editor. And I did point this out at the time. Andrew.
Re: Future blog
On 12/08/2010 11:37 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 1:13 PM, Andrew Haley a...@redhat.com wrote: http://developer.classpath.org/pipermail/classpath-patches/2010-November/006512.html What compatibility problem does this fix? That the result is not what we get with OpenJDK. JamVM, for example, (and I guess CACAO) has fixed this in their tree as has GCJ. The test case I used for this is ClassTest.testGetSimpleName() here: https://github.com/penberg/malva/blob/master/src/malva/java/lang/ClassTest.java The patch is OK. I'm not sure about this bit, but I can live with it: @@ -299,24 +299,24 @@ final class VMClass if (isAnonymousClass(klass)) return ; if (isArray(klass)) - { -return getComponentType(klass).getSimpleName() + []; - } + return getComponentType(klass).getSimpleName() + []; + Andrew.
Re: Future blog
On 12/08/2010 11:47 AM, Gary Benson wrote: Andrew Haley wrote: On 12/08/2010 11:23 AM, Pekka Enberg wrote: In any case, even if everyone did have commit access, CVS is still painful for *local* development. Not for me. I mean, it's not great, but it's hardly a big factor in the time it takes to develop code. I think different people use their VCS different amounts as they work. I use it *constantly*: mambo$ awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -nr 416 hg 66 bin/thingtest 53 emacs 50 cd 34 chmod 33 cat 28 ls ...etc... So for me, how the VCS works is paramount to my getting anything done, and with CVS specifically I almost can't work offline. I'm guessing you use your VCS a lot less than I do... Possibly, but I don't work offline. Ever. Andrew.
Re: Future blog
On 12/08/2010 11:49 AM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 1:47 PM, Andrew Haley a...@redhat.com wrote: That the result is not what we get with OpenJDK. JamVM, for example, (and I guess CACAO) has fixed this in their tree as has GCJ. The test case I used for this is ClassTest.testGetSimpleName() here: https://github.com/penberg/malva/blob/master/src/malva/java/lang/ClassTest.java The patch is OK. I'm not sure about this bit, but I can live with it: No need to live with it, I'll fix it up and resend. This is truly weird. The gcj patch says: 2008-05-22 Andrew Haley a...@redhat.com PR libgcj/35020 * java/lang/Class.java (getSimpleName): Import from GNU Classpath. http://gcc.gnu.org/ml/java-patches/2008-q2/msg00016.html There's a complex thread of replies to that. Still, I'm pretty sure the current gcj version is right. Andrew.
Re: Future blog
On 12/08/2010 12:09 PM, Pekka Enberg wrote: On Wed, Dec 8, 2010 at 2:03 PM, Andrew Haley a...@redhat.com wrote: No need to live with it, I'll fix it up and resend. This is truly weird. The gcj patch says: 2008-05-22 Andrew Haley a...@redhat.com PR libgcj/35020 * java/lang/Class.java (getSimpleName): Import from GNU Classpath. http://gcc.gnu.org/ml/java-patches/2008-q2/msg00016.html There's a complex thread of replies to that. Still, I'm pretty sure the current gcj version is right. I didn't check gcj code but lifted the copy from JamVM. The issues is bit weird for sure as it's been ongoing for ages now: http://www.mail-archive.com/classpath-patc...@gnu.org/msg10757.html http://draenog.blogspot.com/2009/03/i-read-with-interest-jeroens-recent.html In any case, the test case I mentioned passes with OpenJDK and fails with Classpath CVS unless I apply the patch I sent. The patch is still OK. :-) Andrew.
Re: Future blog
On 12/08/2010 12:57 PM, Mario Torre wrote: Il giorno mer, 08/12/2010 alle 13.45 +0200, Pekka Enberg ha scritto: I completely agree. I have Ivan's patches locally and I'm planning to go through them and resend them to the list unless he beats me to it. Pekka If we were using mecurial we could use review board or webrew. We could, but these just introduce extra barriers: it's very easy to just read a mail. Let's not get obsessed with tools: the issue here is social, not technical. Andrew.
Re: Future blog
On 12/08/2010 01:23 PM, Mario Torre wrote: Il giorno mer, 08/12/2010 alle 13.03 +, Andrew Haley ha scritto: On 12/08/2010 12:57 PM, Mario Torre wrote: If we were using mecurial we could use review board or webrew. We could, but these just introduce extra barriers: it's very easy to just read a mail. Let's not get obsessed with tools: the issue here is social, not technical. I don't think they introduce any other overhead than preparing the patch itself. You just post the patch via mercurial directly rather than via first a mailing list (and mercurial takes care of sending the mail to the patches list), and it makes line by line review easier, so this is no obsession. If you think this is overkill, because the number of patches we have to review is pretty limited, then this is a different issue and then I may agree with you. I use webrevs all the time. I use patch mails all the time. I use Mercurial all the time. It's not that I don't understand how all this works, so you don't need to explain. I just don't agree with you. I prefer simple tools. Andrew.
Re: Free Java @ FOSDEM 2011 DevRoom Proposal
On 10/27/2010 12:12 PM, Mario Torre wrote: Il giorno mer, 27/10/2010 alle 12.01 +0200, Mark Wielaard ha scritto: The event itself will be free (as in beer). See http://fosdem.org/ And the beer? ;) The beer will be expensive (as in Belgium. :) Andrew.
[cp-patches] Fix infinite recursion in JobStateReasons.add()
I'm doing software archaeology again. This is an unfortunate bit of history. This bug was fixed by 2006-01-24 Wolfgang Baer wb...@gmx.de * javax/print/SimpleDoc.java: Make class final. * javax/print/attribute/standard/PrinterIsAcceptingJobs.java: Likewise. * javax/print/attribute/DateTimeSyntax.java: (toString): New overridden method. * javax/print/attribute/standard/JobStateReasons.java: (add): Use the super.add method to avoid recursion. * javax/print/attribute/standard/PrinterStateReasons.java: (put): Use the super.put method to avoid recursion. but was re-broken by the merge of generics-branch to HEAD: diff -u -r1.6 -r1.7 --- javax/print/attribute/standard/JobStateReasons.java 24 Jan 2006 20:42:30 - 1.6 +++ javax/print/attribute/standard/JobStateReasons.java 10 Dec 2006 20:25:47 - 1.7 @@ -126,12 +126,12 @@ * @throws ClassCastException if given object is not an instance of * codeJobStateReason/code. */ - public boolean add(Object o) + public boolean add(JobStateReason o) { if (o == null) throw new NullPointerException(reason is null); -return super.add((JobStateReason) o); +return add(o); } /** Fixed thusly. Andrew. 2010-07-30 Andrew Haley a...@localhost.localdomain * javax/print/attribute/standard/JobStateReasons.java (add): Fix infinite recursion with call to super. Index: classpath/javax/print/attribute/standard/JobStateReasons.java === --- classpath/javax/print/attribute/standard/JobStateReasons.java (revision 159065) +++ classpath/javax/print/attribute/standard/JobStateReasons.java (working copy) @@ -129,7 +129,7 @@ if (o == null) throw new NullPointerException(reason is null); -return add(o); +return super.add(o); } /**
[commit-cp] classpath ChangeLog javax/print/attribute/stand...
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 10/07/30 10:58:20 Modified files: . : ChangeLog javax/print/attribute/standard: JobStateReasons.java Log message: 2010-07-30 Andrew Haley a...@redhat.com * javax/print/attribute/standard/JobStateReasons.java (add): Fix infinite recursion with call to super. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9798r2=1.9799 http://cvs.savannah.gnu.org/viewcvs/classpath/javax/print/attribute/standard/JobStateReasons.java?cvsroot=classpathr1=1.9r2=1.10
Re: [cp-patches] Bug fixes for StrictMath
On 07/24/2010 09:47 AM, Ivan Maidanski wrote: Hello, Andrew! Hi, 1. As for .diff extensions - what should be tunable in a browser which app to use for opening the file. All I was saying is: please don't mark text attachments as binary. Most mail readers will not display such attachments. This means that fewer people will see the patch. 2. As for testing for zero sign - I can't agree with you because: - Sun writes Floating-point positive zero and floating-point negative zero compare as equal, but there are other operations that can distinguish them; for example, dividing 1.0 by 0.0 produces positive infinity, but dividing 1.0 by -0.0 produces negative infinity. (http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html); - your consideration about the asm code produced for doubleToRawLongBits are valid for machines which use the same FP formats as JVM; Which is all of them! :-) - yes it's always better to say what you mean and let the optimizer worry about optimization if the latter is capable of doing such things but doubleToBits(x)0 and 1/x0 are equally far from what I mean (x==-0) in that comment. Well, your claim was that 1/x0 was cheaper than doubleToBits(x)0, and I showed why that probably isn't true in many cases. If you still want to keep that form, even though it isn't cheaper, that's OK. But it's important not to base decisions on false data. Andrew.
Re: [cp-patches] Bug fixes for StrictMath
On 07/20/2010 07:06 PM, Ivan Maidanski wrote: Hello, Andrew! On 06/29/2010 10:22 AM, Ivan Maidanski wrote: Hi! I've fixed a number of bugs in StrictMath class (the RI here is fdlibm of some version). ChangeLog entries: * java/lang/StrictMath.java: (acos(double)): Bug fix for x = -1/2 case. (atan(double)): Fix documentation typo. (pow(double,double)): Fix a comment; put y == 1/2 case handling after x == -0 case (since pow(-0, 1/2) == 0 but sqrt(-0) == -0); return -0 (or -INF) for pow(-0, 2*k) where k is non-zero integer; simplify expression for negative variable. (IEEEremainder(double,double)): Bug fix for x == -0 and x == -|y| cases; bug fix for |y| = 2**-1021 and |x| |y|/2. (remPiOver2(double[],double[],int,int)): Reset recompute at the beginning of every do/while iteration. (tan(double,double,boolean)): Negate the result if x = -0.6744. Hi Ivan, Firstly please attach patches as type text; that way people can read them in their mailers. I don't understand. I attach patches with .diff extension. Shall I use .txt? I think they had a mime-type of application/binary. Can you please send test cases that pass with this patch? Ok. I'll write them a bit later... diff -ru CVS/classpath/java/lang/StrictMath.java updated/classpath/java/lang/StrictMath.java --- CVS/classpath/java/lang/StrictMath.java 2010-06-29 10:11:06.0 +0400 +++ updated/classpath/java/lang/StrictMath.java 2010-06-29 12:51:50.0 +0400 @@ -1,5 +1,6 @@ /* java.lang.StrictMath -- common mathematical functions, strict Java - Copyright (C) 1998, 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1998, 2001, 2002, 2003, 2006, 2010 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -456,9 +457,10 @@ double r = x - (PI_L / 2 - x * (p / q)); return negative ? PI / 2 + r : PI / 2 - r; } +double z = (1 - x) * 0.5; if (negative) // x=-0.5. { -double z = (1 + x) * 0.5; +// z = (1+orig_x)*0.5 Please don't leave commented lines in code. If they're wrong, please take them out. This is not a commented code - it's a reference C code from fdlibm. It might be better to use some words instead of a formular like x is not modified in fdlibm unlike in this implementation so we use 1-x (where x==-orig_x) instead of 1+x. @@ -1554,10 +1553,18 @@ else if (yisint == 1) ax = -ax; } +else + { +// Check for x == -0 with odd y. +if (1 / x 0 Why use 1 / x 0 ? What's else to use? The alternative is Double.doubleToRawLongBits(x) 0 but (1/x)0 is cheaper (recall that |x| is zero). In class T { boolean foo(double x) { return Double.doubleToRawLongBits(x) 0; } boolean bar(double x) { return (1/x) 0; } } gcj gives you T.foo(double)boolean: movsd %xmm0, -16(%rsp) movq-16(%rsp), %rax shrq$63, %rax ret for the first, and T.bar(double)boolean: movsd .LC0(%rip), %xmm1 divsd %xmm0, %xmm1 movapd %xmm1, %xmm0 xorpd %xmm1, %xmm1 ucomisd %xmm0, %xmm1 seta%al ret for the second. Any JIT might do something similar. IMO it's always better to say what you mean and let the optimizer worry about optimization. Andrew.
Re: [cp-patches] Bug fixes for StrictMath
On 06/29/2010 10:22 AM, Ivan Maidanski wrote: Hi! I've fixed a number of bugs in StrictMath class (the RI here is fdlibm of some version). ChangeLog entries: * java/lang/StrictMath.java: (acos(double)): Bug fix for x = -1/2 case. (atan(double)): Fix documentation typo. (pow(double,double)): Fix a comment; put y == 1/2 case handling after x == -0 case (since pow(-0, 1/2) == 0 but sqrt(-0) == -0); return -0 (or -INF) for pow(-0, 2*k) where k is non-zero integer; simplify expression for negative variable. (IEEEremainder(double,double)): Bug fix for x == -0 and x == -|y| cases; bug fix for |y| = 2**-1021 and |x| |y|/2. (remPiOver2(double[],double[],int,int)): Reset recompute at the beginning of every do/while iteration. (tan(double,double,boolean)): Negate the result if x = -0.6744. Hi Ivan, Firstly please attach patches as type text; that way people can read them in their mailers. Can you please send test cases that pass with this patch? diff -ru CVS/classpath/java/lang/StrictMath.java updated/classpath/java/lang/StrictMath.java --- CVS/classpath/java/lang/StrictMath.java 2010-06-29 10:11:06.0 +0400 +++ updated/classpath/java/lang/StrictMath.java 2010-06-29 12:51:50.0 +0400 @@ -1,5 +1,6 @@ /* java.lang.StrictMath -- common mathematical functions, strict Java - Copyright (C) 1998, 2001, 2002, 2003, 2006 Free Software Foundation, Inc. + Copyright (C) 1998, 2001, 2002, 2003, 2006, 2010 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -456,9 +457,10 @@ double r = x - (PI_L / 2 - x * (p / q)); return negative ? PI / 2 + r : PI / 2 - r; } +double z = (1 - x) * 0.5; if (negative) // x=-0.5. { -double z = (1 + x) * 0.5; +// z = (1+orig_x)*0.5 Please don't leave commented lines in code. If they're wrong, please take them out. @@ -1554,10 +1553,18 @@ else if (yisint == 1) ax = -ax; } +else + { +// Check for x == -0 with odd y. +if (1 / x 0 Why use 1 / x 0 ? Andrew.
Fwd: can get mouse events with javac but not gcj ... what's wrong?
Any suggestions from Classpath hackers? Andrew. ---BeginMessage--- Java code NoMouse.java is at the bottom of this posting. NoMouse works with javac but not gcj. You test by moving moving mouse in-and-out-of-window: $ javac NoMouse.java ; java NoMouse mouseEntered mouseEntered mouseEntered ... But I do _not_ get mouseEntered whin compiling with gcj: $ gcj --main=NoMouse NoMouse.java ; ./a.out What am I doing wrong? Is there a workaround? How can I get mouse events when using gcj? --- NoMouse.java follows --- import java.awt.event.*; import javax.swing.*; public class NoMouse extends JFrame { public static void main(String [] args) { new NoMouse(); } public NoMouse() { setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(500, 300); addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { System.out.format(mouseEntered\n); } }); setVisible(true); } } ---End Message---
Re: [cp-patches] [build, libjava, v3, testsuite] Unreviewed patches/backport requests
On 06/04/2010 11:40 AM, Rainer Orth wrote: Andrew Haley a...@redhat.com writes: On 06/02/2010 07:19 PM, Rainer Orth wrote: The following patches have remained unreviewed for some time: [build, classpath] Avoid unportable diff -u/-U http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01881.html Needs a libjava maintainer to approve the check_jni_methods.sh.in part. [build, v3] 4.4 backport requests http://gcc.gnu.org/ml/gcc-patches/2010-05/msg02158.html Needs build and/or libstdc++ maintainers. [testsuite] 4.4 backport requests http://gcc.gnu.org/ml/gcc-patches/2010-05/msg02165.html Hmm, these are fairly unpleasant changes, so I'm not surprised no-one approved them. I'll say OK, but are there really no readable diff options on Solaris? Not before Solaris 10, which added -u/-U. But other platforms are affected as well (like IRIX and Tru64 UNIX). Since the diff output isn't intended for human consumption in those cases (unlike contrib/compare-all-tests) and absense of GNU diff breaks bootstrap, I think this is a good change to make. The patches are OK. Andrew.
Re: [cp-patches] FYI: Disable the plugin by default in GNU Classpath
On 05/27/2010 04:45 PM, Andrew John Hughes wrote: This patch disables the plugin by default and adds a warning about its unmaintained status, should it be enabled. 2010-05-27 Andrew John Hughes ahug...@redhat.com * configure.ac: Disable plugin by default and warn about unmaintained status when enabled. Mmm. gcj too, please. And gcj 3.5 branch. Andrew.
Re: [cp-patches] FYI: Disable the plugin by default in GNU Classpath
On 05/27/2010 04:49 PM, Andrew Haley wrote: On 05/27/2010 04:45 PM, Andrew John Hughes wrote: This patch disables the plugin by default and adds a warning about its unmaintained status, should it be enabled. 2010-05-27 Andrew John Hughes ahug...@redhat.com * configure.ac: Disable plugin by default and warn about unmaintained status when enabled. Mmm. gcj too, please. And gcj 3.5 branch. Err, 4.5 branch. Andrew.
[commit-cp] classpath ChangeLog lib/gen-classlist.sh.in
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 10/05/05 13:11:53 Modified files: . : ChangeLog lib: gen-classlist.sh.in Log message: 2010-05-04 Andrew Haley a...@redhat.com * lib/gen-classlist.sh.in: Use absolute pathnames for all the directory names in the output file. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9789r2=1.9790 http://cvs.savannah.gnu.org/viewcvs/classpath/lib/gen-classlist.sh.in?cvsroot=classpathr1=1.42r2=1.43
[cp-patches] Make gen-classlist.sh use absolute pathnames
This changes the list of source files from relative filenames to absolute ones. We need this in the gcj build because the same list of source files is used from more than one place; the alternative of fixing up the file is too messy. I don't think this will affect anything but gcj. Andrew. 2010-05-04 Andrew Haley a...@redhat.com * lib/gen-classlist.sh.in: Use absolute pathnames for all the directory names in the output file. Index: libjava/classpath/lib/gen-classlist.sh.in === --- libjava/classpath/lib/gen-classlist.sh.in (revision 158610) +++ libjava/classpath/lib/gen-classlist.sh.in (working copy) @@ -7,13 +7,17 @@ LC_ALL=C; export LC_ALL LANG=C; export LANG -echo Adding java source files from srcdir '@top_srcdir@'. +abs_top_builddir=`cd ${top_builddir}; pwd` +abs_top_srcdir=`cd @top_srcdir@; pwd` + +echo Adding java source files from srcdir '${abs_top_srcdir}'. + # We construct 'classes.1' as a series of lines. Each line # has three fields, which are separated by spaces. The first # field is the package of this class (separated by /s). -# The second field is the name of the top-level directory for -# this file, relative to the build directory. E.g., it might -# look like ../../classpath/vm/reference. +# The second field is the absolute pathname of the top-level directory +# for this file. E.g., it might look like +# /home/jezebel/classpath/vm/reference. # The third field is the file name, like java/lang/Object.java. # We do this because it makes splitting for the gcj build much # cheaper. @@ -21,15 +25,15 @@ @FIND@ java javax gnu org sun -follow -name '*.java' -print | sort -r | sed -e 's,/\([^/]*\)$, \1,' | while read pkg file; do -echo $pkg @top_srcdir@ $pkg/$file +echo $pkg ${abs_top_srcdir} $pkg/$file done) ${top_builddir}/lib/classes.1 # The same, but for the external code. for dir in \ - @top_srcdir@/external/w3c_dom \ - @top_srcdir@/external/sax \ - @top_srcdir@/external/relaxngDatatype \ - @top_srcdir@/external/jsr166 \ + ${abs_top_srcdir}/external/w3c_dom \ + ${abs_top_srcdir}/external/sax \ + ${abs_top_srcdir}/external/relaxngDatatype \ + ${abs_top_srcdir}/external/jsr166 \ ; do (cd $dir for subdir in java javax gnu org sun; do @@ -62,8 +66,6 @@ done # Only include generated files once. -abs_top_builddir=`cd ${top_builddir}; pwd` -abs_top_srcdir=`cd @top_srcdir@; pwd` if test $abs_top_builddir != $abs_top_srcdir; then echo Adding generated files in builddir '${top_builddir}'. # Currently the only generated files are in gnu.*.
Fix PrintServiceLookup.lookupPrintServices
PrintServiceLookup.lookupPrintServices doesn't work because of a few holes in its implementation. Fixed thusly. Andrew. 2010-04-27 Andrew Haley a...@redhat.com * gnu/javax/print/ipp/IppResponse.java (parseAttributes): Handle IppValueTag.UNKNOWN. * gnu/javax/print/ipp/IppRequest.java (writeOperationAttributes): Handle RequestedAttributes. * gnu/javax/print/ipp/IppPrintService.java (processResponse): Add DocFlavor.SERVICE_FORMATTED.PAGEABLE and DocFlavor.SERVICE_FORMATTED.PRINTABLE. Index: gnu/javax/print/ipp/IppRequest.java === --- gnu/javax/print/ipp/IppRequest.java (revision 158610) +++ gnu/javax/print/ipp/IppRequest.java (working copy) @@ -434,6 +434,8 @@ PrinterURI printerUri = (PrinterURI) attributes.get(PrinterURI.class); JobUri jobUri = (JobUri) attributes.get(JobUri.class); JobId jobId = (JobId) attributes.get(JobId.class); + RequestedAttributes reqAttrs + = (RequestedAttributes)attributes.get(RequestedAttributes.class); if (printerUri != null jobId == null jobUri == null) { write(printerUri); @@ -467,6 +469,12 @@ logger.log(Component.IPP, Attribute: Name: + jobUri.getCategory() .getName() + Value: + jobUri.toString() + ); } + else if (reqAttrs != null) + { + write(reqAttrs); + attributes.remove(RequestedAttributes.class); + logger.log(Component.IPP, RequestedAttributes: + reqAttrs + ); + } else { throw new IppException(Unknown target operation attribute combination.); Index: gnu/javax/print/ipp/IppPrintService.java === --- gnu/javax/print/ipp/IppPrintService.java(revision 158610) +++ gnu/javax/print/ipp/IppPrintService.java(working copy) @@ -356,8 +356,17 @@ // should not happen, all fields are public } } + + if (this.getClass() + .isAssignableFrom(gnu.javax.print.CupsPrintService.class)) + { +// CUPS always provides filters to convert from Postscript. +// This logic looks odd, but it's what OpenJDK does. + flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE); + flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE); + } } - + // printer uris Set uris = getPrinterAttributeSet(PrinterUriSupported.class); printerUris = new ArrayList(uris.size()); Index: gnu/javax/print/ipp/IppResponse.java === --- gnu/javax/print/ipp/IppResponse.java(revision 158610) +++ gnu/javax/print/ipp/IppResponse.java(working copy) @@ -302,11 +302,14 @@ // out-of-band values case IppValueTag.UNSUPPORTED: case IppValueTag.UNKNOWN: + // TODO implement out-of-band handling + // We currently throw an exception to see when it occurs - not yet :-) + throw new IppException( +Unexpected name value for out-of-band value tag + tag); case IppValueTag.NO_VALUE: - // TODO implement out-of-band handling - // We currently throw an exception to see when it occurs - not yet :-) - throw new IppException( -Unexpected name value for out-of-band value tag); + attribute = null; + + break; case IppValueTag.INTEGER: int intValue = IppUtilities.convertToInt(value); attribute = IppUtilities.getIntegerAttribute(name, intValue);
Fix CopyOnWriteArrayList.java
Obvious/trivial. remove() fails if a list is empty. Andrew. 2010-04-27 Andrew Haley a...@redhat.com * java/util/concurrent/CopyOnWriteArrayList.java: Fix for empty list. Index: java/util/concurrent/CopyOnWriteArrayList.java === --- java/util/concurrent/CopyOnWriteArrayList.java (revision 158610) +++ java/util/concurrent/CopyOnWriteArrayList.java (working copy) @@ -452,7 +452,12 @@ public synchronized boolean remove(Object element) { E[] snapshot = this.data; -E[] newData = (E[]) new Object[snapshot.length - 1]; +int len = snapshot.length; + +if (len == 0) + return false; + +E[] newData = (E[]) new Object[len - 1]; // search the element to remove while filling the backup array // this way we can run this method in O(n)
[commit-cp] classpath ChangeLog java/util/concurrent/CopyOn...
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 10/04/27 17:30:46 Modified files: . : ChangeLog java/util/concurrent: CopyOnWriteArrayList.java Log message: 2010-04-27 Andrew Haley a...@redhat.com * java/util/concurrent/CopyOnWriteArrayList.java: Fix for empty list. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9781r2=1.9782 http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/concurrent/CopyOnWriteArrayList.java?cvsroot=classpathr1=1.10r2=1.11
[commit-cp] classpath ChangeLog gnu/javax/print/ipp/IppPrin...
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 10/04/27 16:52:33 Modified files: . : ChangeLog gnu/javax/print/ipp: IppPrintService.java IppRequest.java IppResponse.java Log message: 2010-04-27 Andrew Haley a...@redhat.com * gnu/javax/print/ipp/IppResponse.java (parseAttributes): Handle IppValueTag.UNKNOWN. * gnu/javax/print/ipp/IppRequest.java (writeOperationAttributes): Handle RequestedAttributes. * gnu/javax/print/ipp/IppPrintService.java (processResponse): Add DocFlavor.SERVICE_FORMATTED.PAGEABLE and DocFlavor.SERVICE_FORMATTED.PRINTABLE. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9780r2=1.9781 http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/print/ipp/IppPrintService.java?cvsroot=classpathr1=1.1r2=1.2 http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/print/ipp/IppRequest.java?cvsroot=classpathr1=1.4r2=1.5 http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/print/ipp/IppResponse.java?cvsroot=classpathr1=1.1r2=1.2
Re: Classpath IPP Logging
On 04/23/2010 06:26 PM, Andrew Haley wrote: Does anyone here have any idea how to turn on IPP logging in GNU Classpath? It's used like: logger.log(Component.IPP, Attribute: Name: + jobUri.getCategory() .getName() + Value: + jobUri.toString() + ); It would be very useful to enable this, but I just can't figure it out. Is there really no-one understands how to use Classpath's system logger, or is it that no-one reads this list any more? Andrew.
Re: Classpath IPP Logging
On 04/26/2010 12:15 PM, Robert Lougher wrote: On 26 April 2010 11:23, Andrew Haley a...@redhat.com wrote: On 04/23/2010 06:26 PM, Andrew Haley wrote: Does anyone here have any idea how to turn on IPP logging in GNU Classpath? It's used like: logger.log(Component.IPP, Attribute: Name: + jobUri.getCategory() .getName() + Value: + jobUri.toString() + ); It would be very useful to enable this, but I just can't figure it out. Is there really no-one understands how to use Classpath's system logger, or is it that no-one reads this list any more? I still read this list, but unfortunately I know nothing about logging in GNU Classpath, or even what IPP is! A quick google search did turn this up, but I expect you aready know this: Logger for tracing - enable by passing -Dgnu.classpath.debug.components=ipp to the vm. http://www.docjar.org/docs/api/gnu/javax/print/ipp/IppPrintService.html Hmm, that gives me a blank page. Never mind, that's the clue I needed. Thanks very much, Andrew.
Re: Classpath IPP Logging
On 04/26/2010 12:33 PM, Andrew Haley wrote: On 04/26/2010 12:15 PM, Robert Lougher wrote: On 26 April 2010 11:23, Andrew Haley a...@redhat.com wrote: On 04/23/2010 06:26 PM, Andrew Haley wrote: Does anyone here have any idea how to turn on IPP logging in GNU Classpath? It's used like: logger.log(Component.IPP, Attribute: Name: + jobUri.getCategory() .getName() + Value: + jobUri.toString() + ); It would be very useful to enable this, but I just can't figure it out. Is there really no-one understands how to use Classpath's system logger, or is it that no-one reads this list any more? I still read this list, but unfortunately I know nothing about logging in GNU Classpath, or even what IPP is! A quick google search did turn this up, but I expect you aready know this: Logger for tracing - enable by passing -Dgnu.classpath.debug.components=ipp to the vm. http://www.docjar.org/docs/api/gnu/javax/print/ipp/IppPrintService.html Hmm, that gives me a blank page. Never mind, that's the clue I needed. Thanks very much, Right, got it working. As above, plus java.util.logging.ConsoleHandler.level = FINEST There seems to be some bug (?) where simply setting .level = FINEST doesn't work, and this was stopping all output. Ta, Andrew.
Classpath IPP Logging
Does anyone here have any idea how to turn on IPP logging in GNU Classpath? It's used like: logger.log(Component.IPP, Attribute: Name: + jobUri.getCategory() .getName() + Value: + jobUri.toString() + ); It would be very useful to enable this, but I just can't figure it out. Thanks, Andrew.
Re: James Gosling leaves Oracle
On 04/11/2010 04:41 PM, theUser BL wrote: Hopefully it don't end like with OpenGL. Since OpenGL is owned by the Khronos Group, I have the feeling, that the OpenGL evolution goes a lot slower on, then on times, where OpenGL was part of SGI (Silicon Graphics). Direct3D is not platformindependent, but much more advanced then OpenGL - even though on Windows 95/98 times, a lot of the Microsoft screensavers have used OpenGL instead of Direct3D. And now it seems, the same will be with Java. I fear, that in the future .net dominates over the JVM. Panic now! The Sky Is Falling! Andrew.
Re: [SAXParser] org.xml.sax.SAXParseException: not a name start character: U+26
On 02/13/2010 11:24 AM, Emmanuel Engelhart wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, not sure to be on the right ML to report this behavior, please help me to find the right place to do it if not... and sorry for the noise. I use gcj on a LTS Ubuntu: gcj (Ubuntu 4.4.1-5ubuntu2) 4.4.1 My sample code may be downloaded here as Test.java: https://bugzilla.wikimedia.org/attachment.cgi?id=7115 and looks like that: import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.helpers.DefaultHandler; public class Test { public static void main(String argv[]) { try { SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser saxParser = factory.newSAXParser(); DefaultHandler handler = new DefaultHandler() {}; saxParser.parse(test.xml, handler); } catch (Exception e) { e.printStackTrace(); } } } I compile it like following: gcj -o test --main=Test Test.java My XML file test.xml may be downloaded here: https://bugzilla.wikimedia.org/attachment.cgi?id=7114 By running the the binary I get the following error: $ ./test org.xml.sax.SAXParseException: not a name start character: U+26 at gnu.xml.stream.SAXParser.parse(libgcj.so.10) at javax.xml.parsers.SAXParser.parse(libgcj.so.10) at javax.xml.parsers.SAXParser.parse(libgcj.so.10) at Test.main(test) Caused by: javax.xml.stream.XMLStreamException: not a name start character: U+26 at gnu.xml.stream.XMLParser.error(libgcj.so.10) at gnu.xml.stream.XMLParser.readNmtoken(libgcj.so.10) at gnu.xml.stream.XMLParser.readNmtoken(libgcj.so.10) at gnu.xml.stream.XMLParser.readCharData(libgcj.so.10) at gnu.xml.stream.XMLParser.next(libgcj.so.10) at gnu.xml.stream.SAXParser.parse(libgcj.so.10) ...3 more Although the XML should be valid. Has someone an idea to explain this behavior? This bug impacts the Mediawiki mwdumper SW. T The related bug (with more details) is available here: https://bugzilla.wikimedia.org/show_bug.cgi?id=22137 Mmmm, looks like it probably is a real bug. If you remind me next week I'll have a look. Andrew. ___ Classpath mailing list Classpath@gnu.org http://lists.gnu.org/mailman/listinfo/classpath
Re: [PATCH] classpath/StrictMath: Correct the description of atan()
On 12/31/2009 10:46 PM, Mark Wielaard wrote: On Thu, 2009-12-31 at 15:13 +, Andrew Haley wrote: On 12/30/2009 10:30 PM, Richard Guenther wrote: On Mon, Dec 28, 2009 at 12:54 PM, Andrew Haley a...@redhat.com wrote: On 12/27/2009 10:31 PM, Maciej W. Rozycki wrote: It's been over two weeks now since I sent the proposal included below Gosh, two whole weeks over the Christmas holidays and *still* no replies! Quelle horreur! You mean like the fix for the segfaults in gjar? Ok, maybe the mail to classpath-dev is still in the moderation queue. I can't recall ever seeing it. URL ? The gjar fix was committed a couple of months ago: Oh, that. I thought he must must have been talking about something else: tht bug isn't a segfault, it's just a NullPointerException. A real segfault that isn't caught would indicate something very broken in libgcj. Andrew.
Re: [PATCH] classpath/StrictMath: Correct the description of atan()
On 12/30/2009 10:30 PM, Richard Guenther wrote: On Mon, Dec 28, 2009 at 12:54 PM, Andrew Haley a...@redhat.com wrote: On 12/27/2009 10:31 PM, Maciej W. Rozycki wrote: It's been over two weeks now since I sent the proposal included below Gosh, two whole weeks over the Christmas holidays and *still* no replies! Quelle horreur! You mean like the fix for the segfaults in gjar? Ok, maybe the mail to classpath-dev is still in the moderation queue. I can't recall ever seeing it. URL ? OTOH classpath seems dead, we should probably remove the GCC copy and not ship with a complete java runtime. Try as hard as I can, I cannot understand how this would help anyone. Replacing Classpath with a newer library: now there's a good idea. But it's a fair bit of work, and I'm having trouble figuring out how I can justify spending the time. Andrew.
[commit-cp] classpath java/util/TreeMap.java ChangeLog
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 09/11/18 14:24:24 Modified files: java/util : TreeMap.java . : ChangeLog Log message: 2009-11-18 Andrew Haley a...@redhat.com * java/util/TreeMap.java (anonymous class.size()): Debogosify. anonymous class.clear(): Likewise. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/java/util/TreeMap.java?cvsroot=classpathr1=1.35r2=1.36 http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9774r2=1.9775
[cp-patches] Err...
recursion: n. See recursion. :-) Andrew. 2009-11-13 Andrew Haley a...@redhat.com * java/util/TreeMap.java (anonymous class.size()): Debogosify. anonymous class.clear(): Likewise. Index: classpath/java/util/TreeMap.java === --- classpath/java/util/TreeMap.javax (revision 153739) +++ classpath/java/util/TreeMap.java(working copy) @@ -2745,7 +2745,7 @@ { public int size() { - return size(); + return DescendingMap.this.size(); } public IteratorDV iterator() @@ -2786,7 +2786,7 @@ public void clear() { - clear(); + DescendingMap.this.clear(); } }; return values;
Re: Aliasing violations in gnu_java_nio_VMChannel.c
Andrew John Hughes wrote: 2009/10/22 Andrew Haley a...@redhat.com: This: #ifdef HAVE_GETPEERNAME #ifdef HAVE_INET6 struct sockaddr_in6 *addr6; struct sockaddr_in6 sock_storage; socklen_t socklen = sizeof (struct sockaddr_in6); #else struct sockaddr_in sock_storage; socklen_t socklen = sizeof (struct sockaddr_in); #endif /* HAVE_INET6 */ struct sockaddr *sockaddr = (struct sockaddr *) sock_storage; is clearly an aliasing violation: sock_storage is of type struct sockaddr_in6, and *sockaddr is of type struct sockaddr. It would be easy enough to fix the code with a union, but I can't test it because gcj doesn't use this code. I could simply compile with -fno-strict-aliasing. Thoughts? Andrew. I posted a patch sometime ago to do exactly that (use a union), but received no response: http://developer.classpath.org/pipermail/classpath-patches/2009-June/006341.html It does need more testing than I've had chance to give it so far, I just haven't had time to do any more work on it. I seriously wonder if it's worth the effort. I just did this: Index: configure.ac === RCS file: /sources/classpath/classpath/configure.ac,v retrieving revision 1.244 diff -c -u -r1.244 configure.ac --- configure.ac6 Feb 2009 02:21:23 - 1.244 +++ configure.ac23 Oct 2009 09:10:33 - @@ -514,7 +514,7 @@ dnl CFLAGS that are used for all native code. We want to compile dnl everything with unwinder data so that backtrace() will always dnl work. -EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables' +EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables -fno-strict-aliasing' AC_SUBST(EXTRA_CFLAGS) dnl Strict warning flags which not every module uses. which is a much safer change. It will somewhat pessimize other native code, that's true, but will that make any real difference to anyone these days? Andrew.
Re: Aliasing violations in gnu_java_nio_VMChannel.c
Andrew John Hughes wrote: 2009/10/23 Andrew Haley a...@redhat.com: Andrew John Hughes wrote: 2009/10/22 Andrew Haley a...@redhat.com: This: #ifdef HAVE_GETPEERNAME #ifdef HAVE_INET6 struct sockaddr_in6 *addr6; struct sockaddr_in6 sock_storage; socklen_t socklen = sizeof (struct sockaddr_in6); #else struct sockaddr_in sock_storage; socklen_t socklen = sizeof (struct sockaddr_in); #endif /* HAVE_INET6 */ struct sockaddr *sockaddr = (struct sockaddr *) sock_storage; is clearly an aliasing violation: sock_storage is of type struct sockaddr_in6, and *sockaddr is of type struct sockaddr. It would be easy enough to fix the code with a union, but I can't test it because gcj doesn't use this code. I could simply compile with -fno-strict-aliasing. Thoughts? Andrew. I posted a patch sometime ago to do exactly that (use a union), but received no response: http://developer.classpath.org/pipermail/classpath-patches/2009-June/006341.html It does need more testing than I've had chance to give it so far, I just haven't had time to do any more work on it. I seriously wonder if it's worth the effort. I just did this: Index: configure.ac === RCS file: /sources/classpath/classpath/configure.ac,v retrieving revision 1.244 diff -c -u -r1.244 configure.ac --- configure.ac6 Feb 2009 02:21:23 - 1.244 +++ configure.ac23 Oct 2009 09:10:33 - @@ -514,7 +514,7 @@ dnl CFLAGS that are used for all native code. We want to compile dnl everything with unwinder data so that backtrace() will always dnl work. -EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables' +EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables -fno-strict-aliasing' AC_SUBST(EXTRA_CFLAGS) dnl Strict warning flags which not every module uses. which is a much safer change. It will somewhat pessimize other native code, that's true, but will that make any real difference to anyone these days? Why not just amend the CFLAGS in the local Makefile.am for cpnet? Sure. It won't make much difference, I suspect. Andrew.
Re: [cp-patches] [PATCH] Fix PR39177
Richard Guenther wrote: This fixes the GCC bootstrap failures in libjava when using gjar from GCC 4.4 or later. Ok for the trunk and the 4.4 branch? Please somebody deal with the classpath repo. OK, thanks. Andrew.
[cp-patches] Fix ' dereferencing type-punned pointer will break strict-aliasing rules'
The warning is bogus. Fixed thusly. Andrew. 2009-10-22 Andrew Haley a...@redhat.com * native/jni/native-lib/cpnet.c (cpnet_addMembership): Fix aliasing warning. (cpnet_dropMembership): Likewise. Index: cpnet.c === RCS file: /sources/classpath/classpath/native/jni/native-lib/cpnet.c,v retrieving revision 1.10 diff -u -p -r1.10 cpnet.c --- cpnet.c 25 Jun 2007 09:44:36 - 1.10 +++ cpnet.c 22 Oct 2009 16:18:07 - @@ -578,9 +578,10 @@ jint cpnet_addMembership (JNIEnv *env UN { struct ip_mreq req; int ret; + struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr-data; memset(req, 0, sizeof(req)); - req.imr_multiaddr = ((struct sockaddr_in *)addr-data)-sin_addr; + req.imr_multiaddr = sockaddr-sin_addr; req.imr_interface.s_addr = INADDR_ANY; ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, req, sizeof(req)); if (ret != 0) @@ -593,9 +594,10 @@ jint cpnet_dropMembership (JNIEnv *env U { struct ip_mreq req; int ret; + struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr-data; memset(req, 0, sizeof(req)); - req.imr_multiaddr = ((struct sockaddr_in *)addr-data)-sin_addr; + req.imr_multiaddr = sockaddr-sin_addr; req.imr_interface.s_addr = INADDR_ANY; ret = setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, req, sizeof(req)); if (ret != 0) z
Aliasing violations in gnu_java_nio_VMChannel.c
This: #ifdef HAVE_GETPEERNAME #ifdef HAVE_INET6 struct sockaddr_in6 *addr6; struct sockaddr_in6 sock_storage; socklen_t socklen = sizeof (struct sockaddr_in6); #else struct sockaddr_in sock_storage; socklen_t socklen = sizeof (struct sockaddr_in); #endif /* HAVE_INET6 */ struct sockaddr *sockaddr = (struct sockaddr *) sock_storage; is clearly an aliasing violation: sock_storage is of type struct sockaddr_in6, and *sockaddr is of type struct sockaddr. It would be easy enough to fix the code with a union, but I can't test it because gcj doesn't use this code. I could simply compile with -fno-strict-aliasing. Thoughts? Andrew.
[commit-cp] classpath ChangeLog native/jni/native-lib/cpnet...
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 09/10/22 16:51:21 Modified files: . : ChangeLog native/jni/native-lib: cpnet.c tools/gnu/classpath/tools/jar: Creator.java Log message: 2009-10-22 Andrew Haley a...@redhat.com * native/jni/native-lib/cpnet.c (cpnet_addMembership): Fix aliasing warning. (cpnet_dropMembership): Likewise. 2009-10-21 Richard Guenther rguent...@suse.de PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9773r2=1.9774 http://cvs.savannah.gnu.org/viewcvs/classpath/native/jni/native-lib/cpnet.c?cvsroot=classpathr1=1.10r2=1.11 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/jar/Creator.java?cvsroot=classpathr1=1.9r2=1.10
[cp-patches] [Fwd: [PATCH] Fix PR39177]
Apparently this bounced when it was sent because Richard isn't a subscriber. Andrew. ---BeginMessage--- This fixes the GCC bootstrap failures in libjava when using gjar from GCC 4.4 or later. Ok for the trunk and the 4.4 branch? Please somebody deal with the classpath repo. Thanks, Richard. 2009-10-21 Richard Guenther rguent...@suse.de PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest. * tools/classes/gnu/classpath/tools/jar/Creator.class: Re-generated. Index: libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java === *** libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java (revision 152176) --- libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java (working copy) *** public class Creator *** 216,226 manifest = createManifest(parameters); /* If no version is specified, provide the same manifest version default * as Sun's jar tool */ ! Attributes attr = manifest.getMainAttributes(); ! if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) ! attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), 1.0); ! attr.putValue(Created-By, System.getProperty(java.version) + ( + System.getProperty(java.vendor) + )); outputStream = new JarOutputStream(os, manifest); // FIXME: this sets the method too late for the manifest file. outputStream.setMethod(parameters.storageMode); --- 216,229 manifest = createManifest(parameters); /* If no version is specified, provide the same manifest version default * as Sun's jar tool */ ! if (parameters.wantManifest) ! { ! Attributes attr = manifest.getMainAttributes(); ! if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) ! attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), 1.0); ! attr.putValue(Created-By, System.getProperty(java.version) + ( + System.getProperty(java.vendor) + )); + } outputStream = new JarOutputStream(os, manifest); // FIXME: this sets the method too late for the manifest file. outputStream.setMethod(parameters.storageMode); ---End Message---
Re: getLocalHost and localhost fail
Claude Vittoria wrote: I get an issue with getLocalHost. I trace and I see getLocalHostname return localhost and after the call at getbyname, getallbyname then getHostbyName !?! and fails. I see with strace a request to the nameserver ?!? My question why the nameserver is called to resolv localhost ? Java calls the resolver library. Why in InetAddress.java l.579 the test: if (hostname == null || hostname.length() == 0) is not if (hostname == null || hostname.length() == 0 || locahost.equals(hostname)) Because there isn't any need, as far as I can see. Andrew.
[commit-cp] classpath/gnu/javax/swing/text/html/parser HTML...
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 09/08/14 14:02:27 Modified files: gnu/javax/swing/text/html/parser: HTML_401F.java Log message: 2009-08-14 Jakub Jelinek ja...@redhat.com * gnu/javax/swing/text/html/parser/HTML_401F.java (defineElements): Split this huge method into... (defineElements1, defineElements2, defineElements3, defineElements4, defineElements5, defineElements6): ... these smaller methods. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/swing/text/html/parser/HTML_401F.java?cvsroot=classpathr1=1.5r2=1.6
Re: [cp-patches] Split gnu/javax/swing/text/html/parser/HTML_401F.java
On 07/28/2009 12:55 AM, Andrew John Hughes wrote: 2009/7/14 Audrius Meskauskas audri...@bluewin.ch: On Sun, Jul 12, 2009 at 10:27:07PM +0200, Gerald Pfeifer wrote: On Wed, 1 Jul 2009, Andrew Haley wrote: I haven't studied how exactly is --enable-java-maintainer-mode compiling the classes; if I just gcj -C HTML_401F.java on Fedora 11 (GCC 4.4.0, ecj 3.4.2), the compile time with patched VTA is only 4:53 with 1.5GB top memory usage, if I patch HTML_401F.java with the following patch, it compiles within 0:55 and maxes at 250MB. That's quite a nice improvement. HTML_401F.java has been causing troubles for many years, and splitting it really helps, for example building on (virtual) machines with not so much main memory or in limited settings where there is a process limit for 512MB. It's not an ABI change. This patch is OK iff accompanied by a comment in the code that explains the problem. I believe the patch has not made it into GCC Subversion yet. Are the two of you still planning to apply it? See http://gcc.gnu.org/viewcvs?root=gccview=revrev=149148 Jakub Masters, where is the beginning of this discussion and where is the proposed patch? I have received four messages about HTML_401F that look completely in the middle of the context. While it is great when somebody continues your work, I think it would make no harm for me to look into the patch on the class I once wrote. Audrius Meskauskas Audrius, the patch is visible from the link posted by Jakub: http://gcc.gnu.org/viewcvs?root=gccview=revrev=149148 It simply splits the method which defines the entities into five separate methods to reduce load on the compiler. Is this generally useful? If so, it should go into GNU Classpath rather than just the downstream copy in GCJ. I think it should go into Classpath anyway: it doesn't hurt anything and it reduces divergence with gcj. Andrew.
Re: unable to cross compile classpath for arm linux
On 07/20/2009 05:20 AM, asutosh gopinath wrote: Hi, I am getting following error when i want to build classpath-0.98 for xscale linux platform. Same error is throw when i try to build it for my Fedora linux. gcc Versions: arm-linux-gcc 3.4.4 gcc 4.1.0 I think you need either to install cairo-devel or use --disable-gtk-peer as an argument to configure. Andrew.
Re: Does SSL works at all in classpath version 0.98 ???
On 07/20/2009 08:28 AM, alk.shr wrote: Thanks for reply and filing bug to Bugzilla. Please tell me what extra information do you requires to test reported issues in the SSL? If requires, i can send you all source files of classpath modified by me. one more thing, i got one more issue.In SSL implementation of classpath, Full SSL handshake (including secret key generation ) is happening on selecting every link (HTTP GET) from web application. This is not the case with SUN JRE where SSL handshake happen in beginning and after SSL session time out. Again i suspect bug in the SSL implementation because it creates new SSL session for every GET request instead of sharing previous session. Quite possibly. But if you want the best chance of getting the bug fixed, create a small test case that demonstrates the problem. Andrew.
Re: Fwd: [gnu.org #463369] Reg: Query on GNU class path Libraries
Deepak Sriramdas wrote: We are working on an Embeeded Systems Project. In this process we want to run our java jdk 1.5 compiled code on TS-Linux ARM boards.But these boards seems support only Jam VM java run time enviornment,which uses GNU class path libraries.Now should i modify my existing jdk 1.5 code using GNU class Path Libraries or should i compile code using the GNU compiler. Please can you specify me how should i use this GNU clapath libraries. I guess I don't even understand the question. You run code on Jam VM with Classpath just like you would do on any Java VM. Andrew.
Re: [cp-patches] Split gnu/javax/swing/text/html/parser/HTML_401F.java
Gerald Pfeifer wrote: On Wed, 1 Jul 2009, Andrew Haley wrote: I haven't studied how exactly is --enable-java-maintainer-mode compiling the classes; if I just gcj -C HTML_401F.java on Fedora 11 (GCC 4.4.0, ecj 3.4.2), the compile time with patched VTA is only 4:53 with 1.5GB top memory usage, if I patch HTML_401F.java with the following patch, it compiles within 0:55 and maxes at 250MB. That's quite a nice improvement. HTML_401F.java has been causing troubles for many years, and splitting it really helps, for example building on (virtual) machines with not so much main memory or in limited settings where there is a process limit for 512MB. It's not an ABI change. This patch is OK iff accompanied by a comment in the code that explains the problem. I believe the patch has not made it into GCC Subversion yet. I believe it has. Andrew.
[cp-patches] Split gnu/javax/swing/text/html/parser/HTML_401F.java (Was [vta] Add chains from referenced VALUEs to DVs that reference them)
Jakub Jelinek wrote: On Tue, Jun 30, 2009 at 03:50:11PM +0100, Andrew Haley wrote: Gerald Pfeifer wrote: On Tue, 30 Jun 2009, Jakub Jelinek wrote: Alternatively we could split the huge HTML_401F.java function into say 4 smaller ones. Pleease! :-) This one has been causing troubles beyond the context of just vta (where, for example, on some system one needs to boot with a special kernel option to provide sufficient amounts of memory to GCJ). I can split the function, but papering over the problem by splitting one function won't make the problem go away for others who use gcc. It'll just mean that gcc developers don't notice it. Sure, that's why I've spent last 2 weeks on var-tracking.c improvements for this exact testcase. The question just is, if we really need to include so huge testcases as part of everybody's daily bootstrap/regtest cycle, or if it is sufficient to keep such testcases on the side, for automated testers that track their compile time/memory usage and nag us if we regress too much on it. The big function is about 250k lines of GIMPLE. jc1 uses about 474m of RAM at -O2 on a 64-bit system, 414m at -O1, 536m at -O0. On what class of machines are you trying to build this? From var-tracking POV, especially on VTA branch, the main problem is that this function has 1 basic blocks and on VTA needs to track over 15000 of variables/VALUEs across all those bbs. Vanilla VTA branch needs 2.9GB of memory and 25 minutes to compile this at -g -O2, with all the patches I've sent it needs just 1.6GB of memory and 8 minutes. Don't we have some sort of heuristic that says this function is freaking huge, don't do any expensive optimizations. ? For var-tracking we just bail out on highly connected large cfgs: if (n_basic_blocks 500 n_edges / n_basic_blocks = 20) return 0; I haven't studied how exactly is --enable-java-maintainer-mode compiling the classes; if I just gcj -C HTML_401F.java on Fedora 11 (GCC 4.4.0, ecj 3.4.2), the compile time with patched VTA is only 4:53 with 1.5GB top memory usage, if I patch HTML_401F.java with the following patch, it compiles within 0:55 and maxes at 250MB. I have no idea whether it will work correctly (what to test it with) and whether it is or is not an ABI change. It's not an ABI change. This patch is OK iff accompanied by a comment in the code that explains the problem. Thanks, Andrew.
Re: [cp-patches] namespace namespace
It turns out that the mangling of C++ keywords used by gcj is completely broken: In particular, when a member name is a C++ keyword, $ is appended to the name. However, this is results in an illegal mangled name so it is not possible to refer to the member from CNI code. Also, the set of C++ keywords in gjavah is different from the set in gcj. Also, types are not checked for C++ keywords, so javax.xml.namespace.* cannot be referenced from CNI code. This patch fixes the problem. This is an ABI change. However, the ABI was almost completely broken anyway. Andrew. 2009-06-29 Andrew Haley a...@redhat.com PR java/40590 * tools/gnu/classpath/tools/javah/FieldHelper.java (print): Use printName(). * tools/gnu/classpath/tools/javah/MethodHelper.java (print): Use printName(). * tools/gnu/classpath/tools/javah/CniStubPrinter.java (printDecl): Use printName(). * tools/gnu/classpath/tools/javah/Keywords.java (words): Replace with keywords list from gcc/java/mangle.c. * tools/gnu/classpath/tools/javah/ClassWrapper.java (printMethods): Don't pre-convert a C++ keyword. (print(CniPrintStream)): Call CniPrintStream.printName(). (printContents): Likewise. * tools/gnu/classpath/tools/javah/CniPrintStream.java (getClassName): Don't call replaceAll(/, ::). (print(Type)): Add :: befor name, * after. Use printName(), not print. (printName(PrintStream, String), printName(String), printlnName): New methods. (moveToPackage): Use printName(). 2009-06-29 Andrew Haley a...@redhat.com PR java/40590 * java-tree.h (cxx_keyword_p): New declaration. * mangle_name.c (utf8_cmp): Move here from mangle.c. (cxx_keywords): Likewise. (cxx_keyword_p): Likewise. (MANGLE_CXX_KEYWORDS): New macro. (append_gpp_mangled_name): Use MANGLE_CXX_KEYWORDS. (append_gpp_mangled_name): Likewise. * mangle.c: Move code to mangle_name.c. (mangle_member_name): Don't call cxx_keyword_p. Index: gcc/java/mangle_name.c === --- gcc/java/mangle_name.c (revision 149053) +++ gcc/java/mangle_name.c (working copy) @@ -41,6 +41,183 @@ extern struct obstack *mangle_obstack; +static int +utf8_cmp (const unsigned char *str, int length, const char *name) +{ + const unsigned char *limit = str + length; + int i; + + for (i = 0; name[i]; ++i) +{ + int ch = UTF8_GET (str, limit); + if (ch != name[i]) + return ch - name[i]; +} + + return str == limit ? 0 : 1; +} + +/* A sorted list of all C++ keywords. */ +static const char *const cxx_keywords[] = +{ + _Complex, + __alignof, + __alignof__, + __asm, + __asm__, + __attribute, + __attribute__, + __builtin_va_arg, + __complex, + __complex__, + __const, + __const__, + __extension__, + __imag, + __imag__, + __inline, + __inline__, + __label__, + __null, + __real, + __real__, + __restrict, + __restrict__, + __signed, + __signed__, + __typeof, + __typeof__, + __volatile, + __volatile__, + and, + and_eq, + asm, + auto, + bitand, + bitor, + bool, + break, + case, + catch, + char, + class, + compl, + const, + const_cast, + continue, + default, + delete, + do, + double, + dynamic_cast, + else, + enum, + explicit, + export, + extern, + false, + float, + for, + friend, + goto, + if, + inline, + int, + long, + mutable, + namespace, + new, + not, + not_eq, + operator, + or, + or_eq, + private, + protected, + public, + register, + reinterpret_cast, + return, + short, + signed, + sizeof, + static, + static_cast, + struct, + switch, + template, + this, + throw, + true, + try, + typedef, + typeid, + typename, + typeof, + union, + unsigned, + using, + virtual, + void, + volatile, + wchar_t, + while, + xor, + xor_eq +}; + +/* Return true if NAME is a C++ keyword. */ +int +cxx_keyword_p (const char *name, int length) +{ + int last = ARRAY_SIZE (cxx_keywords); + int first = 0; + int mid = (last + first) / 2; + int old = -1; + + for (mid = (last + first) / 2; + mid != old; + old = mid, mid = (last + first) / 2) +{ + int kwl = strlen (cxx_keywords[mid]); + int min_length = kwl length ? length : kwl; + int r = utf8_cmp ((const unsigned char *) name, min_length, cxx_keywords[mid]); + + if (r == 0) + { + int i; + /* We've found a match if all the remaining characters are `$'. */ + for (i = min_length; i length name[i] == '$'; ++i) + ; + if (i == length) + return 1; + r = 1; + } + + if (r 0) + last = mid; + else + first = mid; +} + return 0; +} + +/* If NAME happens to be a C++ keyword, add `$'. */ +#define MANGLE_CXX_KEYWORDS(NAME, LEN
[commit-cp] classpath ChangeLog tools/gnu/classpath/tools/j...
CVSROOT:/sources/classpath Module name:classpath Changes by: Andrew Haley aph 09/06/30 15:52:15 Modified files: . : ChangeLog tools/gnu/classpath/tools/javah: ClassWrapper.java CniPrintStream.java CniStubPrinter.java FieldHelper.java Keywords.java MethodHelper.java Log message: 2009-06-29 Andrew Haley a...@redhat.com PR java/40590 * tools/gnu/classpath/tools/javah/FieldHelper.java (print): Use printName(). * tools/gnu/classpath/tools/javah/MethodHelper.java (print): Use printName(). * tools/gnu/classpath/tools/javah/CniStubPrinter.java (printDecl): Use printName(). * tools/gnu/classpath/tools/javah/Keywords.java (words): Replace with keywords list from gcc/java/mangle.c. * tools/gnu/classpath/tools/javah/ClassWrapper.java (printMethods): Don't pre-convert a C++ keyword. (print(CniPrintStream)): Call CniPrintStream.printName(). (printContents): Likewise. * tools/gnu/classpath/tools/javah/CniPrintStream.java (getClassName): Don't call replaceAll(/, ::). (print(Type)): Add :: befor name, * after. Use printName(), not print. (printName(PrintStream, String), printName(String), printlnName): New methods. (moveToPackage): Use printName(). CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpathr1=1.9767r2=1.9768 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java?cvsroot=classpathr1=1.6r2=1.7 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/javah/CniPrintStream.java?cvsroot=classpathr1=1.3r2=1.4 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/javah/CniStubPrinter.java?cvsroot=classpathr1=1.4r2=1.5 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/javah/FieldHelper.java?cvsroot=classpathr1=1.3r2=1.4 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/javah/Keywords.java?cvsroot=classpathr1=1.2r2=1.3 http://cvs.savannah.gnu.org/viewcvs/classpath/tools/gnu/classpath/tools/javah/MethodHelper.java?cvsroot=classpathr1=1.3r2=1.4
Re: [cp-patches] [patch] use the classpath version for gjdoc as well
Matthias Klose wrote: Mark Wielaard schrieb: 2009-06-13 Alexander Sack a...@jwsdot.com * tools/gnu/classpath/tools/gjdoc/Main.java (start): Use gnu.classpath.Configuration.CLASSPATH_VERSION as version number. * tools/classes/gnu/classpath/tools/gjdoc/Main.class: Regenerate. --- tools/gnu/classpath/tools/gjdoc/Main.java (revision 148452) +++ tools/gnu/classpath/tools/gjdoc/Main.java (working copy) @@ -1128,7 +1128,7 @@ //--- Show version and exit if requested by user if (option_showVersion) { -System.out.println(gjdoc + getGjdocVersion()); +System.out.println(gjdoc + gnu.classpath.Configuration.CLASSPATH_VERSION); System.exit(0); } The idea is fine. But then please do also submit a patch to GNU Classpath that just removes the whole getGjdocVersion() method. Note that there is another variant called getDocletVersion() in HtmlDoclet.java that you also want to change in this case. attached. I didn't remove the methods yet, so that the patch can be applied to the gcc-4.4 branch as well. This should be done in classpath only, and then imported into libgcj. ok for the attached patch on the libgcj branch and trunk? OK. Andrew.
Re: java.lang.UnsatisfiedLinkError: preInit on using gkeytool
alk.shr wrote: I am getting below exception at the time of using gkeytool for generating key pair/certificate- Exception in thread main java.lang.UnsatisfiedLinkError: preInit at gnu.classpath.VMSystemProperties.preInit(Native Method) at gnu.classpath.SystemProperties.clinit(SystemProperties.java:69) at gnu.classpath.tools.keytool.Command.setKeystoreURLParam(Command.java:570) at gnu.classpath.tools.keytool.Command.setKeyStoreParams(Command.java:419) at gnu.classpath.tools.keytool.Command.setKeyStoreParams(Command.java:395) at gnu.classpath.tools.keytool.ListCmd.setup(ListCmd.java:178) at gnu.classpath.tools.keytool.Command.doCommand(Command.java:205) at gnu.classpath.tools.keytool.Main.start(Main.java:238) at gnu.classpath.tools.keytool.Main.main(Main.java:144) It seems that some shared library file is missing or not generated during GNU classpath build. can anyone tell me in which .so file this native api preInit will be present and how to generate it ? We need to know what VM and which build you're using. Andrew.
[Fwd: compiling errors with latest gcc 4.4 and AWT/Swing]
FYI, Classpath people. Please help! ---BeginMessage--- Hi All, I was recently trying to run a java project, developed for and run with Sun's java, with the gcc compiler instead. When I first installed the gcj available from the Ubuntu repository, I ran into compilation erros and then realised that the version shipped on the repos was relatively old (4.2.4) so I decided to upgrade it to the latest one, hoping that these compilation issues will get resolved. With great help from this forum, I got the newest GCC running on my machine with the following commands: $ svn co http://gcc.gnu.org/svn/gcc/branches/gcc-4_4-branch/ $ mkdir gcc-4_4-branch/obj-x86_64-unknown-linux-gnu $ cd gcc-4_4-branch/obj-x86_64-unknown-linux-gnu $ `pwd`/../configure --enable-languages=java --prefix=/local/gcc-4_4-branch/install --enable-java-home --enable-java-awt=gtk $ make make install $ /local/gcc-4_4-branch/install/lib/jvm/bin/java -version java version 1.5.0 gij (GNU libgcj) version 4.4.0 20090330 (prerelease) Using Eclipse, I linked my project to the newly installed JRE (JRE home directory on '/local/gcc-4_4-branch/install/lib/jvm' ; JRE system libraries on '/local/gcc-4_4-branch/install/share/java/libgcj-4.4.0.jar' and the sourcefile on '~/gcc-4_4-branch/libjava/classpath' ) When I try ro tun the project (from Eclipse), I ran into exactly the same compilation errors as encountered with the older gcc version: Exception in thread main java.lang.IllegalArgumentException at javax.swing.ScrollPaneLayout.addLayoutComponent(ScrollPaneLayout.java:148) at java.awt.Container.addImpl(Container.java:392) at java.awt.Container.add(Container.java:230) at nl.kbna.dioscuri.GUI.setScreen(GUI.java:512) at nl.kbna.dioscuri.GUI.init(GUI.java:256) at nl.kbna.dioscuri.GUI.init(GUI.java:295) at nl.kbna.dioscuri.GUI.main(GUI.java:213) The problem seem to lie with AWT and Swing... and by digging deeper into the code I found that: In GUI.java the following call is made: screenPane.add(screen); This works using Sun's Java, but causes a IllegalArgumentException in GCJ and the reason seems to be as follows: GCJ java.awt.Container class on line 276 contains code for the above call: add(Component comp) { addImpl(comp, null, -1) } The addImpl function calls, near the end (line 390): layoutMgr.addLayoutComponent(, comp); because it was passed null constraints. The ScrollPaneLayout class implements the addLayoutComp (line 125): addLayoutComponent(String key, Component component) but notice that the 'key' variable has been passed an empty String; this function now throws an IllegalArgumentException. As anyone had this sort of problem ? Any idea how to fix it ? Regards David Michel ---End Message---
Re: Problems building classpath on MIPS
Manuel Lauss wrote: If this works, let us know; it may be that there is a bug with using gcj for in-tree compiles. There was a similar issue for older versions of javac. Yes it does! However the following gij Test aborts with value 134; (it segfaults on a futex() call and is finally killed with SIGIOT). There is something very broken in your installation of gcj. Maybe some sort of misconfiguration. Andrew.
Re: Problems building classpath on MIPS
Manuel Lauss wrote: Did I miss any prerequisites? Any help is very much appreciated! Well, what are you trying to do? GNU Classpath usually has to be customized for whatever runtime it's going to be running on. So, what runtime will you use? Andrew.
Re: BigInteger Prime Generation
Oliver Glier wrote: On average the probability that a composite number is declared probably prime is significantly smaller than 4 ^ −k. Damgård, Landrock and Pomerance[4] compute some explicit bounds. Such bounds can, for example, be used to generate primes... Does it mean that the prime number generation is correct because the prime tester overfullfills its contract (i.e. having failure probability 4^(-k) instead of 2^(-k) )? If so, then I think it deserves a comment in the code of the generator. Otherwise, I still think the generator needs to increase the certainty (adding one is enough) before calling the tester. No, that's not exactly what I mean, but I'm not expressing myself very well. It looks like your argument is addressed in Note 4.47 of The Handbook of Applied Cryptography by Alfred Menezes al. http://www.cacr.math.uwaterloo.ca/hac/about/chap4.pdf I won't reproduce it all here, but please have a look. Please don't feel bothered. It is only a technicality with no practical relevance. Sure. It's always worth examining one's assumptions, especially when it comes to security. BTW: I see that BigInteger attributes are non-final. Since the new memory model in Java 1.5, making them final would allow to pass instances of BigInteger to other threads without synchronization, so making all attributes final might be a good idea. That's an interesting point. Curiously, they're not final in OpenJDK either. Andrew.
Re: BigInteger Prime Generation
Oliver Glier wrote: I stumbled over the following code block in the class java.math.BigInteger and it is not clear to me how it works: public BigInteger(int bitLength, int certainty, Random rnd) 237: { 238: this(bitLength, rnd); 239: 240: // Keep going until we find a probable prime. 241: BigInteger result; 242: while (true) 243: { 244: // ...but first ensure that BI has bitLength bits 245: result = setBit(bitLength - 1); 246: this.ival = result.ival; 247: this.words = result.words; 248: if (isProbablePrime(certainty)) 249: return; 250: 251: init(bitLength, rnd); 252: } 253: } I suppose the contract says that the returned number is prime with given probability 1 - 1/2^certainty, but if the routine isProbablePrime(certainty) does only test with the given certainty this might not work. The reason is that the failure probability is not independent from the number of previous trials. If we ignore the prime number theorem for a while and assume that primes are very rare, lets say there density is much lower than 1/2^certainty, then the loop is likely to run until the test returns a wrong result and we almost never generate a prime number! Of course the prime number theorem tells us that the above algorithm will work somehow, but unless further comments can clarify what the routine actually does, I suggest to increase the certainty by one before entering the loop (see Gathen/Gerhard Modern Computer Algebra). Yes, I can see this makes sense. However, as you say, we know that primes are not rare at all, and also that On average the probability that a composite number is declared probably prime is significantly smaller than 4 ^ −k. Damgård, Landrock and Pomerance[4] compute some explicit bounds. Such bounds can, for example, be used to generate primes... http://en.wikipedia.org/wiki/Miller-Rabin_primality_test See also http://theory.lcs.mit.edu/~rivest/Rivest-FindingFourMillionLargeRandomPrimes.ps Andrew.
[cp-patches] [Fwd: Classpath $(toolexeclibdir) disagrees with libjava]
Please, someone help me with this. I don't get it. Thanks, Andrew. ---BeginMessage--- The computation of $toolexeclibdir in libjava/configure.ac does not agree with the same computation in libjava/classpath/m4/acinclude.m4's CLASSPATH_TOOLEXECLIBDIR. (Note that CLASSPATH_TOOLEXECLIBDIR is marked as GCJ local.) I have a patch to fix this, attached. Note that I've also borrowed from the top-level config/acx.m4 in libjava/classpath/configure.ac. OK to apply? Should I move the host_noncanonical/target_noncanonical bits into the acinclude.m4 macro? Is there a better overall way to do this? If the patch is OK, is the wildcard in the ChangeLog OK? I saw that idiom elsewhere in ChangeLog.gcj, so copied it. -- Mark Mitchell CodeSourcery m...@codesourcery.com (650) 331-3385 x713 2009-02-10 Mark Mitchell m...@codesourcery.com * m4/acinclude.m4 (CLASSPATH_TOOLEXECLIBDIR): Match libjava definition of toolexeclibdir. * configure.ac: Define host_noncanonical and target_noncanonical. Support --enable-version-specific-runtime-libs. * Makefile.in, */Makefile.in: Regenerate. Index: libjava/classpath/m4/acinclude.m4 === --- libjava/classpath/m4/acinclude.m4 (revision 236120) +++ libjava/classpath/m4/acinclude.m4 (working copy) @@ -427,11 +427,35 @@ dnl GCJ LOCAL: Calculate toolexeclibdir dnl --- AC_DEFUN([CLASSPATH_TOOLEXECLIBDIR], [ - multi_os_directory=`$CC -print-multi-os-directory` - case $multi_os_directory in -.) toolexeclibdir=${libdir} ;; # Avoid trailing /. -*) toolexeclibdir=${libdir}/${multi_os_directory} ;; + case ${version_specific_libs} in +yes) + # Need the gcc compiler version to know where to install libraries + # and header files if --enable-version-specific-runtime-libs option + # is selected. + includedir='$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include/' + toolexecdir='$(libdir)/gcc/$(target_noncanonical)' + toolexecmainlibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' + toolexeclibdir=$toolexecmainlibdir + ;; +no) + if test -n $with_cross_host +test x$with_cross_host != xno; then + # Install a library built with a cross compiler in tooldir, not libdir. + toolexecdir='$(exec_prefix)/$(target_noncanonical)' + toolexecmainlibdir='$(toolexecdir)/lib' + else + toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)' + toolexecmainlibdir='$(libdir)' + fi + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in + .) toolexeclibdir=$toolexecmainlibdir ;; # Avoid trailing /. + *) toolexeclibdir=$toolexecmainlibdir/$multi_os_directory ;; + esac + ;; esac + AC_SUBST(toolexecdir) + AC_SUBST(toolexecmainlibdir) AC_SUBST(toolexeclibdir) ]) Index: libjava/classpath/configure.ac === --- libjava/classpath/configure.ac (revision 236120) +++ libjava/classpath/configure.ac (working copy) @@ -289,6 +289,26 @@ dnl defined to the same value for all mu dnl so that we can refer to the multilib installation directories from dnl classpath's build files. dnl --- +case ${host_alias} in + ) host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac +case ${target_alias} in + ) target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac +AC_SUBST(target_noncanonical) + +AC_ARG_ENABLE(version-specific-runtime-libs, + AS_HELP_STRING([--enable-version-specific-runtime-libs], + [specify that runtime libraries should be installed in a compiler-specific directory]), +[case $enableval in + yes) version_specific_libs=yes ;; + no) version_specific_libs=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[version_specific_libs=no] +) CLASSPATH_TOOLEXECLIBDIR dnl --- ---End Message---
Re: 0.98 Release Imminent
Andrew John Hughes wrote: I plan to release 0.98 on Thursday before FOSDEM, now that the security issue has been patched: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38417 If there are any major bugs that mean a release should not go ahead, please let me know ASAP. I have found a deadlock in gcj in AWT even processing. I don't know if it affects all of Classpath, but I think so. Andrew.