Recent blog entries for Anthony

27 May 2004 (updated 27 May 2004 at 03:25 UTC) »
ecj: Your New Favorite Tool

A few days ago I 'finished' the proper rhug integration of Ant and the java bytecode compiler hidden within Eclipse. When built with gcj, I believe we end up with the absolute fastest java bytecode compiler in the world (yes, faster than jikes). gary was speechless.

Unfortunately, it requires a little tweak to GCC. If you're tenacious, or jh-build enabled, then you should be able to enjoy ecj yourself.

geeking out

I finally set up a wireless network at home. I was mainly interested in not having to run a long cable to the hacked TiVo anymore. But when I realized that my stereo system would have a wireless ethernet bridge behind it, I caved and picked up an AudioTron on the way home today. A friend of mine recommended the squeezebox, but I like the internet radio feature of the AudioTron. Both work with Linux servers. The squeezebox uses a server app written in Perl and the AudioTron just scans Windows shares (provided by Samba in my case). Highly recommended!

sbb

Strangers are asking me for updates on this, so.. here goes. I got a little distracted this past week with travelling (Chicago & Dallas), FC2 upgrades, and rhug hacking to do much. fitzsim pointed me at sqlite, which I'm now linking to my hacked distcc server in order to map file open requests to local filenames. Seems OK so far. Still lots to do.

random compiler thought

It seems that it should be possible to write a __builtin_memoize() function for GCC. It would take function pointer and return one that would act as a memoizing version of that function. Kind of cool, but useful? Dunno.

javascript and gnome

fitzsim recently got jhbuild working with gcj and java-gnome. I tried it out today, and created jhbuild support for rhug packages. Then I wrote my first gnome app in javascript:

#!/home/green/install/jhbuild-inst/bin/js
 
/* The java-gnome libraries need to be linked differently.
   Let's force lib-org-gnu-glib into memory first until this is fixed. */
java.lang.Class.forName ("org.gnu.glib.GObject");
 
/* Initialize the UI.  */
args = java.lang.reflect.Array.newInstance (java.lang.String, 0);
Packages.org.gnu.gnome.Program.initGnomeUI("First", "0.1", args);
 
/* Create our application, and enter the main loop.  */
app = new Packages.org.gnu.gnome.App("First", "First App");
app.show ();
Packages.org.gnu.gtk.Gtk.main();

Lots of neat things are happening here. I'm running the mozilla rhino JavaScript implementation, which supports LiveConnect for easy access to the gcj runtime. When my program refers to java-gnome classes, the system class loader knows to dynamically load java-gnome code in shared libraries with magic names (lib-org-gnu-gnome.so, etc).

This brings me to my first of several annoyances with java-gnome. They currently use .so names like libgnomejar2.7.so. This works fine if you're building executables and don't mind linking directly to those libraries. However, if you want to support dynamic discovery and loading of these classes you'll want to use the special naming conventions described in the gcj manual. I worked around this problem with a few symlinks.

There were a few more annoyances with java-gnome, but they are all minor and easily fixable. I'll follow up with those guys soon.

All this software was built with my tweaked jhbuild. I sent my changes to fitzsim, who is also trying to push his changes upstream.

tree-ssa merge day

Today is the day that Diego is merging the tree-ssa branch of GCC into mainline.

Here's a brief description of Static Single Assignment. My introduction to SSA form came in the early '90s when I developed a programming environment for a 3D information animation system using SSA based optimizations. The decision to use SSA form was a no-brainer since virtually all optimization algorithms being published back then (and since) assumed you were starting from SSA form. So why wasn't GCC using it?

GCC had grown up using its own low-level internal representation called RTL. And while SSA form saw a sudden explosion in popularity, migrating GCC over to use SSA was going to be a massive effort - more than anyone was willing to invest in themselves. Eventually Red Hat found themselves in a position to put the requisite resources to bear and, once the ball was rolling, support from the rest of the GCC community grew strong.

So this has really been a long time coming for GCC. Just getting this far has taken several man years of effort, and there's still a lot of work to do. Now that GCC has the basic SSA infrastructure in place, the focus will be on replacing (or supplementing) the old, low level RTL based optimizations with SSA versions.

For gcj, this means that we're finally getting some decent infrastructure to build important java-specific optimizations around (escape analysis, array bounds checking removal, etc).

Congratulations to all the hackers and backers who made this possible.

robilad's recent entry points to an old article by Marc Fleury that includes the following:
"Several people have suggested that JBoss is infringing Sun's copyrights by incorporating some of Sun's code into JBoss. We have carefully reviewed the JBoss code base and are confident that, with the exception of seven jars, all code distributed with JBoss was independently written by JBoss project contributors. As for those seven jars, that code was licensed from Sun under Sun's Binary Code License Agreement, which provides that JBoss can distribute that software in binary code format only. JBoss is fully complying with the terms of that license. "

JBoss version 3.0.4 (released much later than that article) included three source files in jboss-3.0.4-src/security/src/main/javax/security/auth containing Sun copyright notices. The build instructions read:

| Unjar the jaas.jar into the build.classes dir so that we can replace
| the javax.security.auth.login.LoginConfig class with one that uses
| the thread context classloader for LoginModules -->

It looks like they were patching Sun source code for whatever reason. IANAL, but my reading of the JAAS binary code license tells me that they shouldn't be doing this.

Well, this is what my notes tell me at least. Verifying this might be difficult, since the sources for the 3.0.4 release appear to be absent from the download page. I suppose I could be wrong.

During a recent visit to my parents, I upgraded their win95 box to use Mozilla Thunderbird and Firefox by default. This is a real milestone for me since it's the first time I've felt comfortable promoting free software solutions to this particular pair of senior citizens. Real problems are being solved: Thunderbird's spam filtering handles the unbelievable quantities of spam they receive, and Firefox can render modern web sites that the win95 compatible IE can't. Upgrading to XP wasn't even an option, since it won't install on their IBM Aptiva. Hurray for Free Software!

java benchmarks

I really need to update my java benchmarks page now that GCC 3.4 and mono beta 1 are available. Today I found a benchmark that tests thread creation/destruction and I/O that runs almost 4 times faster with gij than IBM's JVM. Definitely one for my fair and balanced benchmark list...

30 Apr 2004 (updated 30 Apr 2004 at 14:03 UTC) »

I saw Tim O'Reilly speak the other day. He pointed out some features of amazon.com that I never really took notice of before. And without further ado, I present Music to hack GCJ to.

Last week I started hacking distcc into my remote compilation monster. Rather than try to create clean patches, I'm just hacking like a madman. The build server now requests files from the client during the build process, as in my previous experiment. Still plenty to do, but it's looking neat.

BTW,

28 Apr 2004 (updated 28 Apr 2004 at 20:48 UTC) »
Banner day

Yesterday Frank Eigler flew me from Raleigh to Toronto in his twin engine plane, a Piper Aztec. It was my first trip in a small plane, and wow - what an experience. This is what you see out the window. A little in-flight incident gave Frank an opportunity to show off what a cool cat he can be under pressure. Three cheers for twin engine planes and quick thinking!

Earlier in the day I attended a face-to-face meeting of Red Hat gcj users and hackers (including tromey, aph, bryce, gbenson, fitzsim and more), so it was a real banner day.

Here's a screenshot of a functional prototype of a distributed compilation tool that supports gcj. The server is running in the bottom window. The client in the top window establishes a connection to the server, and shuttles over files from the local filesystem on demand (driven by the LD_PRELOAD hack). The newly released OpenTNL project made this possible.

Raleigh

Red Hat is having another world-wide company meeting in Raleigh, NC starting this weekend. Among other things, this means that all the Red Hat gcj hackers/users will get to meet face-to-face for the first time in a while. I'm looking forward to seeing everyone.

BuildBorg

This is the nickname for my LiveCD experiment. Everything is working well enough now that it's basically useful as a distcc server. Just pop it in a cdrom and it goes. Now I've been thinking of how to support remote native compilation of java code with gcj. The distcc approach doesn't work because it depends on sending preprocessed source with no external dependencies to the build machine. This won't work with gcj, so my current thinking is to just hook into the build machine's C library by LD_PRELOADing a library like this in order to generate queries back to the user's machine for other sources (jar, class, etc). Will this work?

I like this approach, even for C/C++, since it may enable speculative compilation on the build machines during idle times (different debug or optimization levels).

4 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!