Make File Changes For CR4239752

Erik Joelsson erik.joelsson at oracle.com
Tue Oct 23 08:16:23 UTC 2012


Just to make sure I understand the change correctly. The only native 
method in java.io.FileSystem, getFileSystem() has been moved to a new 
class java.io.DefaultFileSystem.

In the new build system, we avoid listing classes needing native headers 
and instead use a new feature in javac that automatically emits header 
files for classes with native methods or that have the annotation 
javax.tools.annotation.GenerateNativeHeader. The reason for generating 
headers for classes without native methods is to expose constants 
defined in the class to the native code.

The first question then is whether a native header is still needed for 
java_io_FileSystem? Are the constants used in native code? Do they still 
belong in this class given that the method moved? I have no idea, so I'm 
asking you.

If headers are still needed, there are two ways of getting the new build 
to generate them. The most obvious being adding the annotation mentioned 
above. However, there is one complication. I suspect this class is part 
of the base module in jigsaw and for those classes we have special 
treatment because of not wanting dependencies on the compile module. If 
this is the case, there is a special list of files in 
jdk/makefiles/CompileJavaClasses.gmk where this class should be added 
(currently looking like this):

JDK_BASE_HEADER_CLASSES:=java.lang.Integer \
                          java.lang.Long \
                          java.net.SocketOptions \
                          sun.nio.ch.IOStatus

Hope that helps!
/erik

On 2012-10-23 00:12, Dan Xu wrote:
> Hi,
>
> I have a bug fix which needs make file changes, which can be reviewed 
> at http://cr.openjdk.java.net/~dxu/4239752/webrev/.
>
> With the above make file changes, I am able to build jdk successfully 
> in old build system. But if I built it using new build system, the 
> build process failed and complained about missing generated header 
> file, java_io_FileSystem.h.
>
> I wonder how I can make the equivalent make file changes in the new 
> build-infra Makefiles. Thanks!
>
> -Dan



More information about the build-dev mailing list