Gentoo Archives: gentoo-java

From: Joshua Nichols <nichoj@g.o>
To: Gentoo Java <gentoo-java@l.g.o>
Cc: Hanno Meyer-Thurow <h.mth@×××.de>
Subject: Re: [gentoo-java] work on gcj for gentoo
Date: Tue, 21 Feb 2006 15:47:58
Message-Id: 43FB35B6.10105@gentoo.org
In Reply to: [gentoo-java] work on gcj for gentoo by Hanno Meyer-Thurow
1 Hanno Meyer-Thurow wrote:
2 > Hi list!
3 > I would like to work on gcj for Gentoo.
4 > I spoke with Andrew Cowie. He suggested me to send my ideas and
5 > questions to this list to discuss.
6 >
7 > I know gcj is tricky. It has various issues. Still, it is quite interesting
8 > to work on gcj. But as gcj is in portage right now it is hard to use for
9 > an ebuild writer like myself. Just two main issues:
10 >
11 > * dependency tracking
12 > * JDK-like environment
13 >
14 >
15 For JDK-like environment, redhat has done much work on this already. It
16 is, surprisingly enough, called java-gcj-compat. Take a look at the
17 jpackage rpm for it [1]. You can find other sites for java-gcj-compat,
18 but the jpackage rpm seems to have the highest version I was able to find.
19
20 > However, I may write my ideas and questions:
21 >
22 > I thought in a gcj-4.1 / ecj combination. Use ecj to bytecompile Java
23 > source to jar with gcj as backend. Then use gcj to create native
24 > executables or libraries out of that jar files. Creating a database
25 > via gcj-dbtool for jar / native code resolution. If possible Java to
26 > native.
27 >
28 >
29 java-gcj-compat actually uses ecj internally, along with some other magic.
30 > The steps to take to get there
31 >
32 > * get gcj-jdk in portage
33 > * use ecj as gcjs bytecompiler
34 > * handle it via Gentoos java config
35 > (gcj bytecompile is broken,
36 > see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18131)
37 >
38 > (later)
39 >
40 > * Java to native compilation
41 > * utilize gcj-dbtool for jar / native code resolution
42 > (Whatever way it is wanted.)
43 >
44 > To stay sane we want to hack the ant-core dependency out of
45 > eclipse-ecj package. Just try to compile ant-core with gcj. I have
46 > ugly hacks (gcc PR19870) for ant-core-1.6.2 to bytecompile with gcj.
47 >
48 >
49 This shouldn't be much of a problem. The build.xml is pretty trivial, so
50 you should be able to replicate it using javac and jar.
51 > No way.
52 >
53 > Then I have to get ant-core-1.6.5 to bytecompile with gcj / ecj which
54 > fails right now - did not yet investigate any further. After these steps
55 > are done we have the base (for interested ones to test gcj).
56 >
57 > I am no Java programmer.
58 > I do packaging stuff and ugly hacking. ;)
59 >
60 > I will try to integrate gcj into Gentoos next Java config utility.
61 > Just not to do the work of integration twice.
62 >
63 >
64 There really isn't much 'integration' involved per se. You mostly just
65 have to create an env file that contains information about JAVA_HOME,
66 PATH, etc. Take a look at existing jdk/jre packages.
67 > What I did already:
68 >
69 > * tweaked Andrew's gcj-jdk ebuild
70 > -> ebuild / eclass split
71 > * gcj-ecj ebuild
72 > -> Java to native: ecj binary
73 >
74 > The very next steps should be:
75 >
76 > * better gcj-jdk ebuild
77 > * fix ant-core issue with ecj
78 >
79 > Then, get back to plan.
80 >
81 > Reference - my overlay for these two ebuilds:
82 > http://geki.ath.cx/hacks/gcj-overlay-2.tar.bz2
83 >
84 >
85 > Thanks in advance for help!
86 >
87 >
88 > Regards,
89 > Hanno
90 >
91
92 A few other things...
93
94 I'm not fond of the name gcj-jdk. The ebuild Andrew made was just for
95 gcj itself, without the Java compatibility stuff, iirc. -jdk suggests
96 that it provides a usable JDK, which it doesn't as it was.
97
98 Speaking of which, I think the added compatibility layer (for javac,
99 java, etc) should be a separate package. I'm not sure if this was your
100 intention or not. Either way, it would make sense, since you would most
101 likely be able to use the same layer for different versions of gcj.
102
103 Hope this helps,
104
105 - Josh
106 --
107 gentoo-java@g.o mailing list

Replies

Subject Author
Re: [gentoo-java] work on gcj for gentoo Joshua Nichols <nichoj@g.o>
Re: [gentoo-java] work on gcj for gentoo Hanno Meyer-Thurow <h.mth@×××.de>
Re: [gentoo-java] work on gcj for gentoo Andrew Cowie <andrew@×××××××××××××××××××.com>