Fail to cross compiling jdk12 for mips64el-linux-gnu target

Ao Qi aoqi at loongson.cn
Thu Jan 24 03:51:43 UTC 2019


Hi David,

On Thu, Jan 24, 2019 at 10:47 AM David Holmes <david.holmes at oracle.com> wrote:
>
> Hi Leslie,
>
> I'm not Erik :) however ....
>
> On 24/01/2019 12:28 pm, Leslie Zhai wrote:
> > Hi Erik,
> >
> > Because the flags' macro of MIPS is different from other targets[1], it
> > will effect the `UnixConstants` of
> > src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template, for
> > example, PREFIX_O_APPEND, so the `Flags` in `FileChannel` is different
> > from other targets.  Then failed[2] to cross compiling jdk12 for
> > mips64el-linux-gnu target by following the document[3].
>
> It's been quite a while since we built for a platform where the flags
> had different values, but it is supposed to work. I suspect that the way
> we build now with the module system may not be quite correct in this
> regard - but that is just supposition on my part. Because compile-time
> constants are stored directly into class files that use them, we have to
> generate UnixConstants.java before compiling any class that needs to use
> it, then we must compile all classes that do use it. Those classes must
> only be executed in conjunction with a tool executing on the target
> platform (javac, jmod etc). My suspicion is that we may be executing a
> tool on the build platform using the newly compiled classes for the
> target platform - and that would be wrong.
>

Yes. Some variables in UnixConstants.java is defined according to the
target (fcntl.h of mips in this case), but would be executed on host
(x86 in this case) during "make images". These variables of ppc64le,
aarch64 and s390x are the same as x86, but the ones of mips are not.
However, mips is not an official supported target and I did not find
other targets have similar issue, I am not sure if this is a bug or if
this is the right mailing list :)

 For example:

jdk/build$ find . -name UnixConstants.java | xargs grep -A2 O_APPEND
./linux-ppc64le-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-ppc64le-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-ppc64le-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     02000
--
./linux-x86_64-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-x86_64-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-x86_64-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     02000
--
./linux-s390x-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-s390x-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-s390x-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     02000
--
./linux-aarch64-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-aarch64-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-aarch64-server-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     02000
--
./linux-x86_64-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-x86_64-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-x86_64-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     02000
--
./linux-mips64el-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-mips64el-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-mips64el-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     0x0008
--
./linux-ppc64le-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java:
   static final int O_APPEND =
./linux-ppc64le-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
./linux-ppc64le-zero-release/support/gensrc/java.base/sun/nio/fs/UnixConstants.java-
                                     02000

log.mips:2of path:
/home/loongson/aoqi/jdk-mips/build/linux-mips64el-normal-server-release/support/interim-jmods/temp/.java.base.jmod.tmp
oflags: 769 O_TRUNC:512 O_APPEND:8 O_CREAT:256 O_EXCL:1024
log.ppc:2of path:
/home/loongson/aoqi/jdk-mips/build/linux-ppc64le-normal-server-release/support/interim-jmods/temp/.java.base.jmod.tmp
oflags: 577 O_TRUNC:512 O_APPEND:1024 O_CREAT:64 O_EXCL:128

Cheers,
Ao Qi



More information about the build-dev mailing list