TOBA

Toba: Frequently Asked Questions


Remember to look at the patch page too.


Questions that apply to the latest release

  1. What about Java 2 (JDK 1.2)?
    We currently have no plans to support Java 2.

  2. When I build Toba on my Linux system, I get the following error:
      sun.tools.java.BinaryConstantPool:
      sun.tools.java.BinaryAttribute:
      toba: line -114:  1154 Aborted                 (core dumped) cc -ansi ...
    

    This has been observed on Linux systems with non-Red Hat distributions, such as Debian. It seems to be due to a limitation in the C compiler, that cannot accept as many command-line arguments as the Toba build process asks of it. The workaround is to use EGCS, or a different Linux distribution. Note: To use egcs, put its bin directory in your path before /usr/bin, AND make sure that the command cc invokes egcs (that is often only installed as gcc; you may need to add a link from the one to the other).

  3. I'm trying to use reflection to....
    There are some problems with Method.invoke(); see the 1.1b patch description for details.

  4. When I build Toba, why does the final link fail with this message:
    sun.tool.java.BinaryAttributes: /usr/local/toba-1.1/packages/RUNTIME.so:
      undefined reference to 'initializeSystemClass__ZvvXb'
    make[1]:***[xjavac] Error 1
    

    You're using version 1.1.5 of JDK somewhere: either as your build system or as the source for rebuilding the Sun classes for BISS. The Sun implementation of that version changed java.lang.System to use a different initialization method. Version 1.1.6 reverted to the scheme used by 1.1.3. Upgrade to version 1.1.6, or edit the file runtime/runtime.c around line 83 to comment out the call to the above function. (We don't guarantee that this edit will work; jdk 1.1.5 has proved unreliable in several aspects that might be traced back to these initialization changes.)

  5. I'm running Toba on a Solaris Ultra-SPARC, and get the following:
    ../bin/toba demo.java
    structs.c:101: failed assertion `sizeof(Long) == 8'
    Abort - core dumped
    

    We've seen that problem under gcc-2.8.1 on Ultras, which is broken (doesn't properly recognize a 64-bit long long). If the following program doesn't print 8, you'll need to find another C compiler to use:
    #if (0x40000000lu << 2) == 0            /* if long is just 32 bits wide */
        typedef signed long long    Long;
        typedef unsigned long long  ULong;  /* only for >>>; not Java primitive */
    #else
        typedef signed long         Long;
        typedef unsigned long       ULong;  /* only for >>>; not Java primitive */
    #endif
    #include 
    int main (void) { printf ("sizeof(Long) = %d\n", sizeof(Long));  } 
    
    We get "8" on gcc 2.7.2.1, egcs 1.0.1, and Sun cc 5.2, those being what we have available on the Ultra-1 we have here.

  6. Why am I getting all these errors when I build my AWT application?
    If you mean things like this:
    DisplayWindow:2682: structure has no member named `dispose__hMemi'
    DisplayWindow:2771: structure has no member named `setTitle_S_IojoN'
    DisplayWindow:2891: structure has no member named `setTitle_S_IojoN'
    DisplayWindow:2979: structure has no member named `getTitle__sTO00'
    DisplayWindow:3037: structure has no member named `show__wNNzS'
    DisplayWindow: In function `main_aS_mnbda':
    DisplayWindow:2233: structure has no member named `show__wNNzS'
    DisplayWindow:2262: structure has no member named `show__wNNzS'
    DisplayWindow: In function `init_S_slPV2':
    DisplayWindow:3000: structure has no member named `setTitle_S_IojoN'
    
    it's probably because the underlying AWT implementation we use isn't really meant to be compatible with Sun's. See the BISS caveat for details. Unfortunately, graphical programs are not the main use for Toba at Arizona, so we have limited resources available to address this issue.

  7. What about swing (JFC)?
    Well, Swing depends on AWT, so we don't know much about it. However, David Orme has taken some initial steps toward getting it to work. A tar file with his notes on building Swing is available.

  8. What's this warning I get from toba about TOBAPATH?
    The TOBAPATH environment variable is used to tell the Toba driver script where to find the include files, shared libraries, and class files for precompiled packages. Most users should not set it, because its value is both complex and critical to successful compilation. If you want to add your own packages, be sure to end the path with a colon, e.g.:
       TOBAPATH=/path/to/my/package:
    
    which will cause the driver to append the standard path settings.

  9. My (non-jit) Linux tobafied executables can't lookup compiled-in classes by name.
    On some versions of Red Hat linux (5.x), you need to pass the -rdynamic flag to the loader. Do this by adding -a -rdynamic to the Toba command line.

  10. When I write out strings with international characters, they get truncated to seven bits.
    First, you'll need to get the 1.1a or later patch. If you're using a non-jit version of toba, you'll also have to make sure that the appropriate conversion classes are linked in. packages/buildAPI includes the default ones (sun.io.ByteToCharISO8859_1 and sun.io.CharToByteISO8859_1), but if you use a different locale, you'll need to either change packages/buildAPI, or add the correct ones to the Toba command line when building your executable.

Problems that have been resolved in patches since the original 1.1 release.

  1. I'm building --with-biss on a RedHat 5.1 system and...
    Fixed in 1.1a One thing you might have to do is this: In $TOBAROOT/configs/biss.linux.opt, change
    BISS_LDFLAGS = -L/usr/X11/lib -lX11 -lXext -lXaw
    
    to
    BISS_LDFLAGS = -L/usr/X11R6/lib -lX11 -lXext -lXaw
    
    Thanks to David J. Orme for discovering and providing a fix for this.

  2. I'm trying to use reflection to....
    Fixed (mostly) in 1.1b Sorry, Toba doesn't support Method.invoke (), and that wasn't noted in the original documentation. There are some hooks in the sources for it, so it should't be hard to add, but we didn't get to it before the release. Anything in the java.lang.reflect hierarchy is untested.

  3. I get an error about not finding sun.security.provider.SHA when I try to use serialization.
    Fixed in 1.1b That class is invoked through Class.forName, rather than through an explicit reference. If you have compiled --with-jit, you shouldn't be seeing this problem. If you don't want to or can't enable the jit for some reason, modify packages/buildAPI following the instructions around line 52 to set up SUN_EXCLUDE to be a bit more lax--that'll put the required security classes, and another 80-plus classes, into your SUNAPI library.


Toba home page