阿林 | 27 Dec 2012 07:32
Favicon

ask help about cross complier of supportting java

 
 hi friends,

I want to build cross compiler of gcc of 4.4.4. I can built success for c,c++. But when I try  to add language of java. I failed. I also read the document , the cross section is too short and non detailed. In the document, only "If the cross compiler is to be built with support for the Java programming language and the ability to compile .java source files is desired, the installed native compiler used to build the cross compiler needs to be the same GCC version as the cross compiler. In addition the cross compiler needs to be configured with --with-ecj-jar=... ". 
Since I use ppc64 and try to build ppc. I don't know how to use this option. I use the ecj of 64-bit package,  I am not sure if it is ok. I can not built success. I have no idea how to process next. Maybe I am wrong at first  for use incorrect parameter.  So I write the email to you and try to get help from gcc group.  I hope get your suggestions and how I can built out gcj by cross complier.  Thank you very much!

Best regards,

Lei Wang








Andreas Schwab | 27 Mar 2013 12:57
Picon

[PATCH] Add support for aarch64

Signed-off-by: Andreas Schwab <schwab <at> suse.de>
---
 ChangeLog              | 4 ++++
 native/fdlibm/ieeefp.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e26f627..d547c7a 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,7  <at>  <at> 
+2013-03-27  Andreas Schwab  <schwab <at> suse.de>
+
+	* native/fdlibm/ieeefp.h: Add support for aarch64.
+
 2013-03-12  Pekka Enberg <penberg <at> kernel.org>

 	* autogen.sh:
diff --git a/native/fdlibm/ieeefp.h b/native/fdlibm/ieeefp.h
index c230bbb..7ef2ae7 100644
--- a/native/fdlibm/ieeefp.h
+++ b/native/fdlibm/ieeefp.h
 <at>  <at>  -4,6 +4,14  <at>  <at> 
 #ifndef __IEEE_BIG_ENDIAN
 #ifndef __IEEE_LITTLE_ENDIAN

+#ifdef __aarch64__
+#ifdef __AARCH64EB__
+#define __IEEE_BIG_ENDIAN
+#else
+#define __IEEE_LITTLE_ENDIAN
+#endif
+#endif
+
 #ifdef __alpha__
 #define __IEEE_LITTLE_ENDIAN
 #endif
-- 
1.8.2

--

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Pekka Enberg | 12 Mar 2013 19:47
Gravatar

[RFC/PATCH] Check for gettext m4 macros in autogen.sh

If gettext-devel package is not installed on Fedora, autogen.sh fails as
follows:

  [penberg <at> tux classpath]$ sh autogen.sh
  configure.ac:505: warning: AC_LIB_PREPARE_PREFIX is m4_require'd but not m4_defun'd
  m4/iconv.m4:11: AM_ICONV_LINKFLAGS_BODY is expanded from...
  m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
  m4/iconv.m4:77: AM_ICONV is expanded from...

Make the script more user fiendly by explicitly checking for the
presence of gettext.m4 in the system.

Cc: Andrew John Hughes  <gnu_andrew <at> member.fsf.org>
Cc: Brian Jones <cbjones1 <at> gmail.com>
Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 ChangeLog  |    5 +++++
 autogen.sh |    7 +++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 289a979..e26f627 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,8  <at>  <at> 
+2013-03-12  Pekka Enberg <penberg <at> kernel.org>
+
+	* autogen.sh:
+	Check that gettext.m4 is installed.
+
 2013-03-09  Pekka Enberg <penberg <at> kernel.org>

 	* .gitignore: Exclude autogen-generated files.
diff --git a/autogen.sh b/autogen.sh
index adb8f0c..df0095f 100755
--- a/autogen.sh
+++ b/autogen.sh
 <at>  <at>  -34,6 +34,13  <at>  <at>  if $have_libtool ; then : ; else
 	DIE=1
 fi

+if [ ! -e $(aclocal --print-ac-dir)/gettext.m4 ] ; then
+	echo
+	echo "You must have gettext package and, if applicable to your"
+	echo "system, gettext-devel package installed to compile $PROJECT."
+	DIE=1
+fi
+
 if test "$DIE" -eq 1; then
 	exit 1
 fi
--

-- 
1.7.7.6

Pekka Enberg | 9 Mar 2013 10:36
Gravatar

[RFC/PATCH] AnnotationInvocationHandler type parametrization

Type parametrize uses of generic types in AnnotationInvocationHandler.

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 ChangeLog                                          |   10 +++++++
 .../annotation/AnnotationInvocationHandler.java    |   28 ++++++++++----------
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 289a979..08f2d6e 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,5 +1,15  <at>  <at> 
 2013-03-09  Pekka Enberg <penberg <at> kernel.org>

+	* sun/reflect/annotation/AnnotationInvocationHandler.java:
+	(AnnotationInvocationHandler(Class, Map)): Add type parameters.
+	(create(Class, Map)): Add type parameters.
+	(equals(Class, Map)): Add type parameters.
+	(hashCode(Class, Map)): Add type parameters.
+	(toString(Class, Map)): Add type parameters.
+	(getBoxedReturnType(Method)): Add type parameters.
+
+2013-03-09  Pekka Enberg <penberg <at> kernel.org>
+
 	* .gitignore: Exclude autogen-generated files.

 2013-03-04  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>
diff --git a/sun/reflect/annotation/AnnotationInvocationHandler.java b/sun/reflect/annotation/AnnotationInvocationHandler.java
index 909e7ae..7494967 100644
--- a/sun/reflect/annotation/AnnotationInvocationHandler.java
+++ b/sun/reflect/annotation/AnnotationInvocationHandler.java
 <at>  <at>  -62,21 +62,21  <at>  <at>  public final class AnnotationInvocationHandler
   implements InvocationHandler, Serializable
 {
     private static final long serialVersionUID = 6182022883658399397L;
-    private final Class type;
-    private final Map memberValues;
+    private final Class<? extends Annotation> type;
+    private final Map<String, Object> memberValues;

     /**
      * Construct a new invocation handler for an annotation proxy.
      * Note that the VM is responsible for filling the memberValues map
      * with the default values of all the annotation members.
      */
-    public AnnotationInvocationHandler(Class type, Map memberValues)
+    public AnnotationInvocationHandler(Class<? extends Annotation> type, Map<String, Object> memberValues)
     {
         this.type = type;
         this.memberValues = memberValues;
     }

-    public static Annotation create(Class type, Map memberValues)
+    public static Annotation create(Class<? extends Annotation> type, Map<String, Object> memberValues)
     {
       for (Method m : type.getDeclaredMethods())
         {
 <at>  <at>  -90,7 +90,7  <at>  <at>  public final class AnnotationInvocationHandler
       AnnotationInvocationHandler handler
         = new AnnotationInvocationHandler(type, memberValues);
       return (Annotation) Proxy.newProxyInstance(type.getClassLoader(),
-                                                 new Class[] { type },
+                                                 new Class<?>[] { type },
                                                  handler);
     }

 <at>  <at>  -106,7 +106,7  <at>  <at>  public final class AnnotationInvocationHandler
      * (can) use different representations of annotations that reuse this
      * method.
      */
-    public static boolean equals(Class type, Map memberValues, Object other)
+    public static boolean equals(Class<? extends Annotation> type, Map<String, Object> memberValues,
Object other)
     {
         if (type.isInstance(other))
         {
 <at>  <at>  -217,13 +217,13  <at>  <at>  public final class AnnotationInvocationHandler
      * (can) use different representations of annotations that reuse this
      * method.
      */
-    public static int hashCode(Class type, Map memberValues)
+    public static int hashCode(Class<? extends Annotation> type, Map<String, Object> memberValues)
     {
         int h = 0;
-        Iterator iter = memberValues.keySet().iterator();
+        Iterator<String> iter = memberValues.keySet().iterator();
         while (iter.hasNext())
         {
-            Object key = iter.next();
+            String key = iter.next();
             Object val = memberValues.get(key);
             h += deepHashCode(val) ^ 127 * key.hashCode();
         }
 <at>  <at>  -267,15 +267,15  <at>  <at>  public final class AnnotationInvocationHandler
      * (can) use different representations of annotations that reuse this
      * method.
      */
-    public static String toString(Class type, Map memberValues)
+    public static String toString(Class<? extends Annotation> type, Map<String, Object> memberValues)
     {
         StringBuffer sb = new StringBuffer();
         sb.append(' <at> ').append(type.getName()).append('(');
         String sep = "";
-        Iterator iter = memberValues.keySet().iterator();
+        Iterator<String> iter = memberValues.keySet().iterator();
         while (iter.hasNext())
         {
-            Object key = iter.next();
+            String key = iter.next();
             Object val = memberValues.get(key);
             sb.append(sep).append(key).append('=').append(deepToString(val));
             sep = ", ";
 <at>  <at>  -284,9 +284,9  <at>  <at>  public final class AnnotationInvocationHandler
         return sb.toString();
     }

-    private static Class getBoxedReturnType(Method method)
+    private static Class<?> getBoxedReturnType(Method method)
     {
-        Class returnType = method.getReturnType();
+        Class<?> returnType = method.getReturnType();

         if (returnType == boolean.class)
             return Boolean.class;
--

-- 
1.7.7.6

Pekka Enberg | 9 Mar 2013 10:03
Gravatar

[RFC/PATCH] Add autogen-generated files to gitignore

Make sure "git status" does not show up files after autogen.sh has been
run.

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 .gitignore |    5 +++++
 ChangeLog  |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index 817e215..1b3d546 100644
--- a/.gitignore
+++ b/.gitignore
 <at>  <at>  -21,3 +21,8  <at>  <at>  install-sh
 missing
 mkinstalldirs
 INSTALL
+m4/libtool.m4
+m4/ltoptions.m4
+m4/ltsugar.m4
+m4/ltversion.m4
+m4/lt~obsolete.m4
diff --git a/ChangeLog b/ChangeLog
index b08c5af..289a979 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,7  <at>  <at> 
+2013-03-09  Pekka Enberg <penberg <at> kernel.org>
+
+	* .gitignore: Exclude autogen-generated files.
+
 2013-03-04  Andrew John Hughes  <gnu_andrew <at> member.fsf.org>

 	* gnu/classpath/Pair.java:
--

-- 
1.7.7.6

Mark Wielaard | 2 Dec 2012 22:20
Favicon
Gravatar

tagging classpath for GCC import

Hi,

Matthias wanted to import the latest classpath from git into libgcj
so I have pushed a tag (libgcj-import-20121202) for current HEAD.
(Note for future reference, to push a tag one uses git push --tags,
with just git push the tag stays local.)

It seems the git import from CVS lost the old tags. Does anybody
know of a way to get them from the original CVS history into the
git repository?

Thanks,

Mark

Ivan Maidanski | 7 Nov 2012 14:43
Picon

Re: Patch fixing bugs in several StrictMath methods

Hi Pekka,

No problem. Thanks anyway.

The proposed test fails in Classpath but succeeds in OpenJDK. The original Classpath StrictMath code has been ported from fdlibm and a dozen of bugs emerged at that phase. The proposed code should fix discovered bugs. Of course, the code contains math expressions and, thus, no easy to read and review.

Regards,
Ivan

Wed, 7 Nov 2012 15:04:48 +0200 Pekka Enberg <penberg <at> kernel.org>:
Hi Ivan,

On Sat, Oct 27, 2012 at 6:10 PM, Ivan Maidanski <ivmai <at> mail.ru> wrote:
> To continue pushing the patches, I've cherry-picked 2 patches (to
> https://github.com/ivmai/classpath/tree/ivmai4review-v3) containing
> StrictMath fixes and the corresponding tests:
> https://github.com/ivmai/classpath/commit/b0103d175bb012fcec411cc9e76257f3f257c39d
> (StrictMath changes)
> https://github.com/ivmai/classpath/commit/214c8bab72dc4689edf7ae1cd49e3a109c0746d7
> (StrictMath test)
>
> Some notes:
> - In the 1st patch I've removed several trailing spaces at EOLn in ChangeLog
> - I think it is ok not to post this as a separate patch
> - In the 2nd patch I've also fixed java.lang.reflect/ArrayTest (a one-line
> fix - I've commented out loadLibrary call but it might be better to remove
> this line at all)

I'm afraid I'll have to leave StrictMath reviewing for Andrew. I
really have no clue what that code is supposed to be doing. ;-)

                        Pekka

Ivan Maidanski | 19 Oct 2012 23:10
Picon

Re: GNU Classpath

Hi Andrew,

Wed, 17 Oct 2012 09:45:40 +0300 от Pekka Enberg <penberg <at> kernel.org>:
On Wed, Oct 17, 2012 at 5:59 AM, Andrew Hughes <gnu.andrew <at> redhat.com> wrote:
> No. Updating the ChangeLog is a requirement.

GNU Coding Standards
6.8.1 Change Log Concepts
...
Another alternative is to record change log information with a version control system such as RCS or CVS.
...



Ivan, I highly recommend setting up git-merge-changelog as per Mark's
instructions which makes git merge and git cherry-pick work properly
again.
Ok. Thanks.

Regards,
Ivan

Pekka Enberg | 15 Oct 2012 12:23
Gravatar

[RFC PATCH v2] Fix NPE in java/util/Formatter.format() method

This patch fixes NPE for the following Malva test cases:

  assertEquals("false", String.format("%b", (Object[])null));
  assertEquals("null", String.format("%h", (Object[])null));
  assertEquals("null", String.format("%s", (Object[])null));
  assertEquals("null", String.format("%c", (Object[])null));
  assertEquals("null", String.format("%d", (Object[])null));
  assertEquals("null", String.format("%o", (Object[])null));
  assertEquals("null", String.format("%x", (Object[])null));

Signed-off-by: Pekka Enberg <penberg <at> kernel.org>
---
 ChangeLog                |   10 ++++++++++
 java/util/Formatter.java |   21 ++++++++++++++++++---
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 384918b..746a1f7 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,5 +1,15  <at>  <at> 
 2012-03-15  Pekka Enberg  <penberg <at> kernel.org>

+	* java/util/Formatter.java:
+	(icharacterFormat(Object,int,int,int,char):
+	Fix NullPointerException for null characters.
+	(basicIntegralConversion(Object, int, int, int, int, char):
+	Fix NullPointerException for null integers.
+	(format(Locale, String, Object...)):
+	Fix NullPointerException for null object.
+
+2012-03-15  Pekka Enberg  <penberg <at> kernel.org>
+
 	* java/lang/String.java:
 	(codePointAt(int))): Fix exception type.
 	(codePointBefore(int)): Fix exception type.
diff --git a/java/util/Formatter.java b/java/util/Formatter.java
index 62f6845..466fab5 100644
--- a/java/util/Formatter.java
+++ b/java/util/Formatter.java
 <at>  <at>  -678,6 +678,12  <at>  <at>  public final class Formatter
                conversion);
     noPrecision(precision);

+    if (arg == null)
+      {
+        genericFormat("null", flags, width, precision);
+        return;
+      }
+
     int theChar;
     if (arg instanceof Character)
       theChar = ((Character) arg).charValue();
 <at>  <at>  -748,6 +754,12  <at>  <at>  public final class Formatter
                                                   int radix, char conversion)
   {
     assert radix == 8 || radix == 10 || radix == 16;
+
+    if (arg == null)
+      {
+        return new CPStringBuilder("null");
+      }
+
     noPrecision(precision);

     // Some error checking.
 <at>  <at>  -1353,9 +1365,12  <at>  <at>  public final class Formatter
                   argumentIndex = previousArgumentIndex;
                 // Argument indices start at 1 but array indices at 0.
                 --argumentIndex;
-                if (argumentIndex < 0 || argumentIndex >= args.length)
-                  throw new MissingFormatArgumentException(format.substring(start, index));
-                argument = args[argumentIndex];
+                if (args != null)
+                  {
+                    if (argumentIndex < 0 || argumentIndex >= args.length)
+                      throw new MissingFormatArgumentException(format.substring(start, index));
+                    argument = args[argumentIndex];
+                  }
               }

             switch (conversion)
--

-- 
1.7.7.6

Pekka Enberg | 15 Oct 2012 09:59
Gravatar

[RFC PATCH 1/4] Handle malloc() failure in java_util_VMTimeZone.c file.

From: Ivan Maidanski <ivmai <at> mail.ru>

2011-07-20  Ivan Maidanski  <ivmai <at> mail.ru>

	* native/jni/java-util/java_util_VMTimeZone.c:
	Include jcl.h file.
	(Java_java_util_VMTimeZone_getSystemTimeZoneId): Throw
	OutOfMemoryException in case of malloc() failure.
---
 ChangeLog                                   |    7 +++++++
 native/jni/java-util/java_util_VMTimeZone.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 18b6c03..c0d84cd 100644
--- a/ChangeLog
+++ b/ChangeLog
 <at>  <at>  -1,3 +1,10  <at>  <at> 
+2011-07-20  Ivan Maidanski  <ivmai <at> mail.ru>
+
+	* native/jni/java-util/java_util_VMTimeZone.c:
+	Include jcl.h file.
+	(Java_java_util_VMTimeZone_getSystemTimeZoneId): Throw
+	OutOfMemoryException in case of malloc() failure.
+
 2012-06-10  Ivan Maidanski  <ivmai <at> mail.ru>

 	* compat/.gitignore,
diff --git a/native/jni/java-util/java_util_VMTimeZone.c b/native/jni/java-util/java_util_VMTimeZone.c
index a3a986d..1c4c0cf 100644
--- a/native/jni/java-util/java_util_VMTimeZone.c
+++ b/native/jni/java-util/java_util_VMTimeZone.c
 <at>  <at>  -53,6 +53,7  <at>  <at>  exception statement from your version. */
 #include <stdlib.h>

 #include <jni.h>
+#include <jcl.h>

 #include "java_util_VMTimeZone.h"

 <at>  <at>  -170,6 +171,12  <at>  <at>  Java_java_util_VMTimeZone_getSystemTimeZoneId (JNIEnv * env,
   tz2_len = strlen (tz2);
   tzoff_len = jint_to_charbuf (tzoff + 11, tzoffset);
   tzid = (char *) malloc (tz1_len + tz2_len + tzoff_len + 1);	/* FIXME alloc */
+  if (tzid == NULL) {
+    JCL_ThrowException (env, "java/lang/OutOfMemoryError",
+                        "malloc() failed");
+    return 0;
+  }
+
   memcpy (tzid, tz1, tz1_len);
   memcpy (tzid + tz1_len, tzoff + 11 - tzoff_len, tzoff_len);
   memcpy (tzid + tz1_len + tzoff_len, tz2, tz2_len);
--

-- 
1.7.7.6

Ivan Maidanski | 13 Oct 2012 11:50
Picon

Re: GNU Classpath

Hi Pekka,

Sat, 13 Oct 2012 10:22:52 +0300 от Pekka Enberg <penberg <at> kernel.org>:
Hi Ivan,

(I'm also CC'ing Andrew.)

Have you filled the FSF copyright assignment paperwork? I was looking
at your tree:

Of course I signed it (in May 2010).

My mistake was to develop these fixes for 4 year with out contribution and then (in 2010) upgrade to the recent Classpath and push all at once (a big amount of code as you could see in that branch). The problem that at that time there remained only 1 (or 2) patch reviewers at Classpath. Andrew reviewed and accepted a couple of patches. The discussion stopped at processing fixes to StrictMath (Andrew requested StrictMath test, I wrote it and nothing more). Since pushing of these patches to github, I'm fine to have multiple Classpath "master" branches at different servers.

I noticed some activity recently (e.g., moving from cvs to git) but again I see the narrow place - code reviewing.

May be it's time to change the policy of patch acceptance from "please find a person who reviews (among 1 or 2 guys) your code" to "if signed FSF paper, and you have patches, post them to ML, commit to some feature development branch and, if no objections within 2-3 weeks, merge the branch to master, in case of further objections revert the patches".



https://github.com/ivmai/classpath/commits/ivmai4review-v2

and was wondering if it's OK to try to push forward some of your bug fixes?
yes, good luck, ask me if something is unclear. You could start with StrictMath fix.

Regards,
Ivan


                        Pekka


Gmane