This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for building Java compiler for version 4.3.0+


Andy,
All,

Please keep the ML in copy, that may help others...

On Monday 05 January 2009 23:54:09 Andy Johnson wrote:
> I'm using Outlook (not my choice), so I'm not too surprised that
> the patch didn't come through in ideal shape.  My only option is
> to set plain text instead of HTML.

Or attach the patch :-)

> > Why is that? Isn't gcc able to build java by itself?
> The best I can gather from the GCC website is that it is a requirement
> starting with GCC 4.3.  The Eclipse compiler is used to gain Java 1.5
> support, which is what I need for what I'm trying to compile.  GCJ
> by itself will not compile Java source code.

OK, see below...

> > > I added "gcj" to
> > > the list of utilities to make the initial link:
> > OK. But know that if gcj is not present on the build system, you're
> > in trouble.
> As for gcj in crosstool.sh, the way I read the script then if
> gcj isn't available then it isn't a big deal (get a not required
> message if log level is DEBUG).  If this isn't correct then it
> isn't obvious to me how to do it right.

You are right. I was just saying that in this case, you won't be able to
build your toolchain corectly, even if you use ecj. But you would sooner
or later find about it, when you see the log file.

> > I'd rather have that protected by a config option. Something like:
[--SNIP--]
> > as I don't see how ecj *is* necessary.
> If it isn't built, then when you run gcj you will get something like
> this:
> arm-unknown-linux-gnu-gcj: error trying to exec 'ecj1': execvp: No such
> file or directory

Woops. :-( I never actually _tried_ to build a java program, as I don't
grok Java. Thanks for clarification!

> I don't see how ecj is not necessary.  Yes, crosstool-ng will build
> without errors without it, but that alone isn't enough to guarantee
> a working Java compiler.

OK. Then we'll need a silent option:

---8<--- BEGIN ---8<---
config CC_LANG_JAVA_USE_ECJ
    bool
    default y
    depends on CC_LANG_JAVA
    depends on CC_GCC_4_3_or_later
---8<---  END  ---8<---

and then downloading and copying if CC_LANG_JAVA_USE_ECJ is set

> > Would you mind reworking your patch against current SVN trunk, with
> > ecj usage protected behind a config option, please? And attach your
> > patch so your mailer does not bork it again. ;-)
> The SVN version is significantly different than the 1.3.1 version, so

Yep, there heavy changes going on, and I think I'll make a 1.4.0 release
no long in the future (most probably before end January).
Having your fix in would be great! :-)

> I'll need to download the latest snapshot

Can't you run: svn co http://ymorin.is-a-geek.org/svn/crosstool-ng/trunk

> and apply my two two-line 
> fixes before I can send in a patch.

Yes, please...

> Looking at gcc.sh, this isn't the only change with version 4.3.  I still
> think the ecj "option" doesn't make sense. For pre 4.3 leave code to
> behave
> as it does now, and for 4.3 and on require ecj.

It will be easier from the config file, I think. Less code bloat, I hope.

> No, replacing the existing /lib/ld-linux.so.2 isn't an option right
> now since it is in a read-only file system.  Chroot is an option,
> as long as I can recreate all the /dev files in the jail.

If you can chroot, then you can mknod. Both need root priviledge (or some
CAP_SYS_ADMIN (or the like) capability). I'd do a quick-n-dirty copy
of the original /dev, a-la:

---8<--- BEGIN ---8<---
mkdir /chroot
( cd / ; tar cf - dev ) | ( cd /chroot ; tar xf - )
---8<---  END  ---8<---

Regards,
Yann E. MORIN.

PS. Please forgive me if I'm a bit dumb, it's quite late here in France...
YEM.
-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'


--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]