Browse Source

classpath: move to new repo, update to classpath-0.99; add patch for double memory-leak

Signed-off-by: Dana H. Myers <k6jq@comcast.net>
Dana Myers 10 years ago
parent
commit
0d307e7003
2 changed files with 180 additions and 0 deletions
  1. 89
    0
      libs/classpath/Makefile
  2. 91
    0
      libs/classpath/patches/010-double-memleak.patch

+ 89
- 0
libs/classpath/Makefile View File

1
+#
2
+# Copyright (C) 2006-2015 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=classpath
11
+PKG_VERSION:=0.99
12
+PKG_RELEASE:=1
13
+PKG_LICENSE:=GPL-2.0
14
+PKG_MAINTAINER:=Dana H. Myers <k6jq@comcast.net>
15
+
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17
+PKG_SOURCE_URL:=@GNU/classpath
18
+PKG_MD5SUM:=0ae1571249172acd82488724a3b8acb4
19
+
20
+PKG_FIXUP:=autoreconf
21
+PKG_INSTALL:=1
22
+
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+define Package/classpath
26
+  SECTION:=libs
27
+  CATEGORY:=Libraries
28
+  TITLE:=GNU Classpath
29
+  URL:=http://www.gnu.org/software/classpath/
30
+  DEPENDS:=+alsa-lib +libgmp +libmagic
31
+endef
32
+
33
+define Package/classpath/Description
34
+	GNU Classpath, Essential Libraries for Java, is a GNU project
35
+	to create free core class libraries for use with virtual
36
+	machines and compilers for the java programming language.
37
+endef
38
+
39
+define Package/classpath-tools
40
+  SECTION:=libs
41
+  CATEGORY:=Libraries
42
+  TITLE:=GNU Classpath tools
43
+  URL:=http://www.gnu.org/software/classpath/
44
+endef
45
+
46
+define Download/antlr
47
+  URL:=http://www.antlr.org/download
48
+  FILE:=antlr-3.4-complete.jar
49
+  MD5SUM:=1b91dea1c7d480b3223f7c8a9aa0e172
50
+endef
51
+$(eval $(call Download,antlr))
52
+
53
+CONFIGURE_ARGS += \
54
+	--without-x \
55
+	--disable-gtk-peer \
56
+	--disable-qt-peer \
57
+	--disable-dssi \
58
+	--disable-plugin \
59
+	--disable-gconf-peer \
60
+	--disable-gjdoc \
61
+	--disable-examples \
62
+	--with-antlr-jar=$(DL_DIR)/antlr-3.4-complete.jar
63
+
64
+define Package/classpath/install
65
+	$(INSTALL_DIR) \
66
+		$(1)/usr/lib/classpath \
67
+		$(1)/usr/share/classpath
68
+	$(CP) \
69
+		$(PKG_INSTALL_DIR)/usr/lib/security \
70
+		$(PKG_INSTALL_DIR)/usr/lib/logging.properties \
71
+		$(1)/usr/lib/
72
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/classpath/*.so* $(1)/usr/lib/classpath/
73
+	$(CP) $(PKG_INSTALL_DIR)/usr/share/classpath/glibj.zip $(1)/usr/share/classpath/
74
+endef
75
+
76
+define Package/classpath-tools/install
77
+	$(INSTALL_DIR) \
78
+		$(1)/usr/bin \
79
+		$(1)/usr/share/classpath
80
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
81
+	$(CP) $(PKG_INSTALL_DIR)/usr/share/classpath/tools.zip $(1)/usr/share/classpath/
82
+endef
83
+
84
+define Build/InstallDev
85
+	$(CP) $(PKG_INSTALL_DIR)/* $(1)/
86
+endef
87
+
88
+$(eval $(call BuildPackage,classpath))
89
+$(eval $(call BuildPackage,classpath-tools))

+ 91
- 0
libs/classpath/patches/010-double-memleak.patch View File

1
+--- classpath-0.99.orig/native/fdlibm/dtoa.c	2007-09-27 05:33:38.000000000 -0700
2
++++ classpath-0.99/native/fdlibm/dtoa.c	2014-12-21 14:22:42.451713851 -0800
3
+@@ -883,6 +883,16 @@ ret1:
4
+   return s0;
5
+ }
6
+ 
7
++void free_Bigints(struct _Jv_Bigint *p)
8
++{
9
++    struct _Jv_Bigint *l = p;
10
++    while (l)
11
++	{
12
++	  struct _Jv_Bigint *next = l->_next;
13
++	  free (l);
14
++	  l = next;
15
++	}
16
++}
17
+ 
18
+ _VOID
19
+ _DEFUN (_dtoa,
20
+@@ -905,16 +915,15 @@ _DEFUN (_dtoa,
21
+   p = _dtoa_r (&reent, _d, mode, ndigits, decpt, sign, rve, float_type);
22
+   strcpy (buf, p);
23
+ 
24
+-  for (i = 0; i < reent._result_k; ++i)
25
++  for (i = 0; i < reent._max_k; ++i)
26
+     {
27
+-      struct _Jv_Bigint *l = reent._freelist[i];
28
+-      while (l)
29
+-	{
30
+-	  struct _Jv_Bigint *next = l->_next;
31
+-	  free (l);
32
+-	  l = next;
33
+-	}
34
++        free_Bigints(reent._freelist[i]);
35
+     }
36
+   if (reent._freelist)
37
+     free (reent._freelist);
38
++
39
++  if (reent._result)
40
++    free(reent._result);
41
++
42
++  free_Bigints(reent._p5s);
43
+ }
44
+--- classpath-0.99.orig/native/jni/java-lang/java_lang_VMDouble.c	2008-02-08 09:42:57.000000000 -0800
45
++++ classpath-0.99/native/jni/java-lang/java_lang_VMDouble.c	2014-12-21 14:35:50.733800626 -0800
46
+@@ -158,6 +158,17 @@ Java_java_lang_VMDouble_longBitsToDouble
47
+   return val.d;
48
+ }
49
+ 
50
++static void free_Bigints(struct _Jv_Bigint *p)
51
++{
52
++     struct _Jv_Bigint *l = p;
53
++     while (l)
54
++     {
55
++         struct _Jv_Bigint *next = l->_next;
56
++         free (l);
57
++         l = next;
58
++     }
59
++}
60
++ 
61
+ /**
62
+  * Parse a double from a char array.
63
+  */
64
+@@ -167,7 +178,7 @@ parseDoubleFromChars(JNIEnv * env, const
65
+   char *endptr;
66
+   jdouble val = 0.0;
67
+   const char *p = buf, *end, *last_non_ws, *temp;
68
+-  int ok = 1;
69
++  int i, ok = 1;
70
+ 
71
+ #ifdef DEBUG
72
+   fprintf (stderr, "java.lang.VMDouble.parseDouble (%s)\n", buf);
73
+@@ -224,6 +235,18 @@ parseDoubleFromChars(JNIEnv * env, const
74
+ 
75
+       val = _strtod_r (&reent, p, &endptr);
76
+ 
77
++      for (i = 0; i < reent._max_k; ++i)
78
++      {
79
++          free_Bigints(reent._freelist[i]);
80
++      }
81
++      if (reent._freelist)
82
++          free (reent._freelist);
83
++
84
++      if (reent._result)
85
++          free (reent._result);
86
++
87
++      free_Bigints(reent._p5s);
88
++
89
+ #ifdef DEBUG
90
+       fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
91
+       fprintf (stderr, "java.lang.VMDouble.parseDouble %p != %p ???\n",