This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Compiling Scala-generated bytecode
- From: Andrew Hughes <gnu dot andrew at redhat dot com>
- To: Marko DimjaÅeviÄ <marko at dimjasevic dot net>
- Cc: Andrew Haley <aph at redhat dot com>, java-patches at gcc dot gnu dot org
- Date: Mon, 20 Oct 2014 17:46:13 -0400 (EDT)
- Subject: Re: Compiling Scala-generated bytecode
- Authentication-results: sourceware.org; auth=none
- References: <1413785951 dot 4798 dot 12 dot camel at neelix> <5444C1F9 dot 7060306 at redhat dot com> <1413813034 dot 4798 dot 20 dot camel at neelix>
----- Original Message -----
> On Mon, 2014-10-20 at 09:04 +0100, Andrew Haley wrote:
>
> > You have to link with the Scala library, either directly or indirectly.
> > You will want to compile the library to a shared object.
>
> That's what I thought.
>
>
> > Before explaining any more, do you have experience with shared
> > libraries in C and C++?
>
> Just a tiny bit.
>
> As far as my understanding goes, I'd first create a shared library with
> something like this:
>
> gcj -fPIC /usr/share/java/scala-library.jar -shared -o scala-library.so
>
> and then when compiling a Scala program, I'd say:
>
> gcj --classpath=.:/usr/share/java/scala-library.jar HelloWorld*.class
> scala-library.so
>
> But I haven't managed to create the shared library. When I attempt to
> run the first command, I get something like:
>
> scala/collection/immutable/StringLike.scala: In class
> 'scala.collection.immutable.StringLike$class':
> scala/collection/immutable/StringLike.scala: In method
> 'scala.collection.immutable.StringLike
> $class.replaceAllLiterally(scala.collection.immutable.StringLike,java.lang.String,java.lang.String)':
> In file included from scala/collection/immutable/StringLike.scala:28:0,
> from scala/collection/immutable/StringLike.scala:190,
> from scala/collection/immutable/StringLike.scala:142,
> ...
> from scala/AnyVal.scala:7,
> from <built-in>:3:
> scala/collection/immutable/StringLike.scala:174:0: error: class
> 'java.util.regex.Pattern' has no method named 'quote' matching signature
> '(Ljava/lang/String;)Ljava/lang/String;'
> In file included from scala/collection/immutable/StringLike.scala:28:0,
> from scala/collection/immutable/StringLike.scala:190,
> from scala/collection/immutable/StringLike.scala:142,
> ...
>
>
> Can you please tell me how to get the shared library?
>
Which version of gcj are you using? This one looks to be too old to include
the Pattern.quote(String) method needed by Scala.
>
> --
> Regards,
> Marko
> http://dimjasevic.net/marko
>
>
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07