changeset 1239:98f6e678b3ce

2008-12-03 Matthias Klose <doko@ubuntu.com> * patches/icedtea-format-warnings.patch: New. * patches/icedtea-format-warnings.patch: Likewise. * HACKING: Document patches. * Makefile.am: Apply patches.
author doko@ubuntu.com
date Wed, 03 Dec 2008 00:59:32 +0100
parents d742b7a1cb5e
children 985d267a3390
files ChangeLog HACKING Makefile.am patches/icedtea-format-warnings.patch patches/icedtea-fortify-source.patch
diffstat 5 files changed, 105 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Dec 03 00:48:36 2008 +0100
+++ b/ChangeLog	Wed Dec 03 00:59:32 2008 +0100
@@ -1,3 +1,10 @@
+2008-12-03  Matthias Klose  <doko@ubuntu.com>
+
+	* patches/icedtea-format-warnings.patch: New.
+	* patches/icedtea-format-warnings.patch: Likewise.
+	* HACKING: Document patches.
+	* Makefile.am: Apply patches.
+
 2008-12-02  Mark Wielaard  <mark@klomp.org>
 
 	* patches/icedtea-version.patch: Remove accidentially added debug
--- a/HACKING	Wed Dec 03 00:48:36 2008 +0100
+++ b/HACKING	Wed Dec 03 00:59:32 2008 +0100
@@ -75,6 +75,8 @@
 * icedtea-testenv.patch: Provide public reachable machines for net/nio tests.
 * icedtea-samejvm-safe.patch: Add samejvmsafe dirs to TEST.ROOT.
 * icedtea-6728542-epoll.patch: Make EPoll work on non-x86 platforms. (PR265)
+* icedtea-fortify-source.patch: Fix build failures with -D_FORTIFY_SOURCE=2.
+* icedtea-format-warnings.patch: Fix build failures with -Wformat=1.
 
 The following patches are only applied to OpenJDK6 in IcedTea6:
 
--- a/Makefile.am	Wed Dec 03 00:48:36 2008 +0100
+++ b/Makefile.am	Wed Dec 03 00:59:32 2008 +0100
@@ -588,6 +588,12 @@
         patches/icedtea-6755943.patch \
         patches/icedtea-6766136.patch
 
+if WITH_ALT_HSBUILD
+ICEDTEA_PATCHES += \
+	patches/icedtea-format-warnings.patch \
+	patches/icedtea-fortify-source.patch
+endif
+
 if !WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
 	patches/icedtea-hotspot7-tests.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-format-warnings.patch	Wed Dec 03 00:59:32 2008 +0100
@@ -0,0 +1,30 @@
+--- openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp~	2008-11-20 09:41:03.000000000 +0100
++++ openjdk/hotspot/src/share/vm/classfile/javaClasses.cpp	2008-12-02 16:47:01.000000000 +0100
+@@ -866,7 +866,7 @@
+     }
+     nmethod* nm = method->code();
+     if (WizardMode && nm != NULL) {
+-      sprintf(buf + (int)strlen(buf), "(nmethod %#x)", nm);
++      sprintf(buf + (int)strlen(buf), "(nmethod %p)", nm);
+     }
+   }
+ 
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp~	2008-12-02 16:38:27.000000000 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2008-12-02 17:05:17.000000000 +0100
+@@ -4133,6 +4133,7 @@
+   int count;
+   long sys_time, user_time;
+   char string[64];
++  char cdummy;
+   int idummy;
+   long ldummy;
+   FILE *fp;
+@@ -4194,7 +4195,7 @@
+   do s++; while (isspace(*s));
+ 
+   count = sscanf(s,"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
+-                 &idummy, &idummy, &idummy, &idummy, &idummy, &idummy,
++                 &cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,
+                  &ldummy, &ldummy, &ldummy, &ldummy, &ldummy,
+                  &user_time, &sys_time);
+   if ( count != 13 ) return -1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-fortify-source.patch	Wed Dec 03 00:59:32 2008 +0100
@@ -0,0 +1,60 @@
+--- openjdk/hotspot/src/share/vm/prims/jvm.cpp~	2008-11-20 09:41:05.000000000 +0100
++++ openjdk/hotspot/src/share/vm/prims/jvm.cpp	2008-12-02 16:55:32.000000000 +0100
+@@ -2474,7 +2474,7 @@
+   if (Arguments::vfprintf_hook() != NULL) {
+     jio_fprintf(defaultStream::output_stream(), "%s", s);
+   } else {
+-    ::write(defaultStream::output_fd(), s, (int)strlen(s));
++    ssize_t neverused_rv = ::write(defaultStream::output_fd(), s, (int)strlen(s));
+   }
+ }
+ 
+--- openjdk/hotspot/src/share/vm/utilities/ostream.cpp~	2008-12-02 16:38:32.000000000 +0100
++++ openjdk/hotspot/src/share/vm/utilities/ostream.cpp	2008-12-02 16:58:26.000000000 +0100
+@@ -300,7 +300,7 @@
+ }
+ 
+ void fileStream::write(const char* s, size_t len) {
+-  if (_file != NULL)  fwrite(s, 1, len, _file);
++  if (_file != NULL)  size_t neverused_rv = fwrite(s, 1, len, _file);
+   update_position(s, len);
+ }
+ 
+@@ -328,7 +328,7 @@
+ }
+ 
+ void fdStream::write(const char* s, size_t len) {
+-  if (_fd != -1) ::write(_fd, s, (int)len);
++  if (_fd != -1)  ssize_t neverused_rv = ::write(_fd, s, (int)len);
+   update_position(s, len);
+ }
+ 
+--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp~	2008-12-02 16:38:27.000000000 +0100
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2008-12-02 17:05:17.000000000 +0100
+@@ -2066,7 +2066,7 @@
+                 CAST_FROM_FN_PTR(address, os::jvm_path),
+                 dli_fname, sizeof(dli_fname), NULL);
+   assert(ret != 0, "cannot locate libjvm");
+-  realpath(dli_fname, buf);
++  char *neverused_rv = realpath(dli_fname, buf);
+ 
+   if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
+     // Support for the gamma launcher.  Typical value for buf is
+@@ -2090,7 +2090,7 @@
+         assert(strstr(p, "/libjvm") == p, "invalid library name");
+         p = strstr(p, "_g") ? "_g" : "";
+ 
+-        realpath(java_home_var, buf);
++        char *neverused_rv = realpath(java_home_var, buf);
+         sprintf(buf + strlen(buf), "/jre/lib/%s", cpu_arch);
+         if (0 == access(buf, F_OK)) {
+           // Use current module name "libjvm[_g].so" instead of
+@@ -2101,7 +2101,7 @@
+           sprintf(buf + strlen(buf), "/hotspot/libjvm%s.so", p);
+         } else {
+           // Go back to path of .so
+-          realpath(dli_fname, buf);
++          neverused_rv = realpath(dli_fname, buf);
+         }
+       }
+     }