This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Trouble building gcj 4.8.1
- From: Mike Hearn <mike at plan99 dot net>
- To: Bryce McKinlay <bmckinlay at gmail dot com>
- Cc: Andrew Haley <aph at redhat dot com>, GCC Java <java at gcc dot gnu dot org>
- Date: Wed, 3 Jul 2013 15:43:42 +0200
- Subject: Re: Trouble building gcj 4.8.1
- References: <CANEZrP3wxTPvx5Ky2O1qds427t9LxtSt0Bm3GntjcN63_0+3rw at mail dot gmail dot com> <CANEZrP0vTN_MAe4jOamUqKnkyXgNYJ-bsUnovANV36evGdJWPA at mail dot gmail dot com> <51C87C22 dot 9030201 at redhat dot com> <CANEZrP2woCNh4P+a-xTWqqz+PKEi01C0PU+D_TVu1jn2CeDaNw at mail dot gmail dot com> <51C88147 dot 8060508 at redhat dot com> <CANEZrP0WwGL40Vguonwb2CLvpvYmCaRTkO+wZqZ6uTGvtGxu0w at mail dot gmail dot com> <51C9A389 dot 6030000 at redhat dot com> <CANEZrP1_ChOzW9jLw=Qtx0T43GytbFZpWc7KaxGh_wFP7nD38g at mail dot gmail dot com> <51C9A53C dot 20409 at redhat dot com> <CANEZrP2VC0oc+KeQANBDu_3S32kvOyqFuQydbW8AuYN36MVgKg at mail dot gmail dot com> <51C9A783 dot 40008 at redhat dot com> <CALUNu-qbpH8omT=1uq9f0QaGUr-jO4f=bOkZ3PKbErUA9yDHKw at mail dot gmail dot com> <CANEZrP1tLxpu818cFGdgma+RVL32yRJJUOyb5m8QF=mhTZVueg at mail dot gmail dot com>
Well, the issue is I'm not sure how to implement them correctly. I did
a quick hack which involves using the existing methods that take
charset names and just calling them with Charset.forName() but I
seriously doubt this is really fully compatible or would pass the Java
test suite. Perhaps it doesn't matter all that much, but if String is
not special it'd be nice to move to the classpath version which seems
to be much more thorough.
On Wed, Jul 3, 2013 at 3:43 PM, Mike Hearn <mike@plan99.net> wrote:
> Well, the issue is I'm not sure how to implement them correctly. I did a
> quick hack which involves using the existing methods that take charset names
> and just calling them with Charset.forName() but I seriously doubt this is
> really fully compatible or would pass the Java test suite. Perhaps it
> doesn't matter all that much, but if String is not special it'd be nice to
> move to the classpath version which seems to be much more thorough.
>
>
> On Tue, Jul 2, 2013 at 4:53 PM, Bryce McKinlay <bmckinlay@gmail.com> wrote:
>>
>> On Tue, Jun 25, 2013 at 3:21 PM, Andrew Haley <aph@redhat.com> wrote:
>> > On 06/25/2013 03:15 PM, Mike Hearn wrote:
>> >>> I'm trying to find out what you want to do to java.lang.String. Tell
>> >>> me
>> >>> that, and we'll take it from there.
>> >>
>> >> At the moment, supporting the methods that take java.nio.Charset. I'm
>> >> going to try and just hack it up with something like this:
>> >>
>> >> public String(byte[] data, int offset, int count, Charset encoding)
>> >> throws UnsupportedEncodingException
>> >> {
>> >> init (data, offset, count, encoding.name());
>> >> }
>> >>
>> >> and then the same for getBytes().
>> >
>> > OK. I think you can just add those methods.
>> >
>> >> But in general I anticipate that I'll continue to hit stubs or quirks
>> >> in classpath so I'm trying to figure out how best to reach my goal,
>> >> which will likely involve fixing up various things along the way. For
>> >> instance, my first yak-shaving goal is to run the test suite for the
>> >> core library of this app and then hack/fix until all the tests pass.
>> >
>> > In general, we follow Classpath except for a few core classes -- and
>> > String is one of those. Major hacking on core classes requires compiler
>> > changes, so I strongly recommend you don't do that. For example, better
>> > not add any fields. But in general for almost the whole class library
>> > you won't have so much trouble.
>>
>> I think it's only java.lang.Object and java.lang.Class that are
>> "special" - i.e. could conceivably require compiler changes if you
>> changed the field layout. As far as I can recall, String isn't really
>> treated specially in any way.
>>
>> There should be no problem at all adding those methods and I would
>> encourage you to go ahead and submit a patch.
>>
>> Bryce
>
>