public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: Per Bothner <per@bothner.com>
Cc: kawa@sourceware.org
Subject: Re: Building for Android
Date: Tue, 18 Oct 2022 20:25:43 +0200	[thread overview]
Message-ID: <CAMFYt2bzaVLJi8JNJGJ2aOv6FbhvS7YoFBo5zdUCccEJKJRSVw@mail.gmail.com> (raw)
In-Reply-To: <bcba87fb-3815-ac46-d7ee-8a5b9299de72@bothner.com>

[-- Attachment #1: Type: text/plain, Size: 3055 bytes --]

wt., 18 paź 2022, 17:25 użytkownik Per Bothner <per@bothner.com> napisał:

>
>
> On 10/18/22 07:57, Panicz Maciej Godek via Kawa wrote:
> > PARSE ERROR:
> >   unsupported class file version 61.0
> > ...while parsing gnu/bytecode/Access.class
> >
> > So, what I suppose happens, is that the javac which builds Kawa emits
> byte
> > code that is unsupported by dx.
>
> Try specifying the --release to javac. This may be helpful:
>
> https://stackoverflow.com/questions/43102787/what-is-the-release-flag-in-the-java-9-compiler
>
> > I tried building Kawa having passed --with-java-source=7 to the
> 'configure'
> > script, but that didn't help.
>
> Yes, IIRC (if I recall correctly) that doesn't change teh options passed
> to javac.
>
> You can pass the --target option to the kawa command when compiling Scheme
> to class files,
> but that currently defaults to 52 (Java 8), which hopefuly dexer will
> handle.
>
> > I also tried aliasing javac as javac -release 7, but it still seens to
> > produce the class file version 61.0.
>
> Hm. That is weird.  You can try an exlicit 'javac --target 8' (say).
>

It seems that aliasing doesn't work with make. So I did the same thing as I
did with ecj -- wrote a shell script under prioritized $PATH which invoked
javac with --release N flag.

For N=7, I got a compilation error:


RuntimeParameterAnnotationsAttr.java:81: error: incompatible types:
ArrayList<Object> cannot be converted to List<AnnotationEntry>
                  attr.parameterEntries.add(new ArrayList<>());
                                            ^
      RuntimeParameterAnnotationsAttr.java:85: error: incompatible types:
ArrayList<Object> cannot be converted to List<AnnotationEntry>
                  attr.parameterEntries.add(new ArrayList<>());
                                            ^
      RuntimeParameterAnnotationsAttr.java:110: error: incompatible types:
ArrayList<Object> cannot be converted to List<AnnotationEntry>
                 parameterEntries.add(new ArrayList<>());
                                      ^

Fortunately, for N=8 the process completes successfully, and dexer no
longer complains on the class file version.

However, the dexing process now seems to be taking forever (ie. over 5
minutes), and the only way it managed to terminate so far was either by
throwing out-of-memory exception, or by complaining that it is unable to
allocate sufficiently large memory block due to fragmentation.

I've been doing it on my phone, which has 6GB of RAM -- I'd thought that's
sufficient -- but I'll also try it on a larger machine (still, I find that
behavior surprising: the jar for kawa 1.13 has 2.2MB, whereas the latest
one - 2.9MB, so it doesn't seem that much larger - yet dexing the old
version takes about 30 seconds and doesn't blow anything up)


According to https://en.wikipedia.org/wiki/Java_version_history
> class file version 61.0 is Java 17.
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/
>

  reply	other threads:[~2022-10-18 18:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 14:57 Panicz Maciej Godek
2022-10-18 15:25 ` Per Bothner
2022-10-18 18:25   ` Panicz Maciej Godek [this message]
2022-10-19  9:15     ` Panicz Maciej Godek
2022-10-19 16:05       ` Per Bothner
2022-10-19 17:09         ` Panicz Maciej Godek
2022-10-20  5:35           ` Panicz Maciej Godek
2022-10-20 20:48             ` Panicz Maciej Godek
2022-10-21  5:14               ` Panicz Maciej Godek
2022-10-21 13:59                 ` Panicz Maciej Godek
2022-10-21 18:11                   ` Per Bothner
2022-10-21 19:19                     ` Panicz Maciej Godek
2022-10-21 19:31                       ` Per Bothner
2022-10-21 19:45                         ` Panicz Maciej Godek
2022-10-21 20:13                           ` Panicz Maciej Godek
2022-10-22  6:26                           ` Per Bothner
2022-10-22  9:31                             ` Panicz Maciej Godek
2022-10-22 12:08                               ` Panicz Maciej Godek
2022-10-24  7:22                                 ` Panicz Maciej Godek
2022-10-24 10:48                                   ` Per Bothner
2022-10-24 12:01                                     ` Panicz Maciej Godek
2022-10-21 18:00           ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMFYt2bzaVLJi8JNJGJ2aOv6FbhvS7YoFBo5zdUCccEJKJRSVw@mail.gmail.com \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.org \
    --cc=per@bothner.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).