Improving underscore detection

Alexandre Oliva oliva at
Sat Aug 15 18:00:09 PDT 1998


Petter Reinholdtsen <pere at> has just called my attention to
the underscore detection mechanism of Kaffe.  There's much room for

First of all, the C code that detects whether the C compiler inserts
underscores needs not be executed; linking is enough, so the attached
patch does exactly that, which allows the test to be performed even
when cross-compiling.  I've tested it on several platforms, and the
existing functionality was retained.

The second issue has to do with the code that tests whether dlopen
needs leading underscores in symbol names.  On SunOS 4.1.3, leading
underscores are optional (but it's better to use them).  However, the
test fails to run because dlopen() cannot be used to link libc in.
This problem may explain why Kaffe can't run on SunOS 4.1.3; I'll

The correct approach, that is taken by Japhar, is to created a shared
library that defines a known symbol, create a test program that
dlopen()s the just-created library and tries to find the symbol in it.
If we used libtool in Kaffe, the test used in Japhar could be simply
copied into Kaffe.  I can do that for sure, because I contributed
myself the test code to Japhar.

Alexandre Oliva
mailto:oliva at mailto:aoliva at
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: underscore.diff
Type: application/octet-stream
Size: 1117 bytes
Desc: not available
Url : 

More information about the kaffe mailing list