A new user interface for you! Read more...

File gcc-4.8.0-libjava.patch of Package mingw32-cross-gcc-bootstrap

--- libjava/configure	2012-12-12 14:40:15.000000000 +0100
+++ libjava/configure	2013-03-28 10:31:00.862641285 +0100
@@ -19765,6 +19765,7 @@
 test -d java/io || mkdir java/io
 test -d gnu || mkdir gnu
 ac_config_links="$ac_config_links java/io/natFile.cc:java/io/natFile${FILE-${PLATFORM}}.cc"
+ac_config_links="$ac_config_links java/io/natVMConsole.cc:java/io/natVMConsole${FILE-${PLATFORM}}.cc"
 
 
 # Likewise for natConcreteProcess.cc.
@@ -20575,6 +20576,9 @@
     LIBSTDCXXSPEC=-lstdc++
     LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -L`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -rpath `${PWDCMD-pwd}`/.libs:`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -lstdc++"
     ;;
+*-*-mingw*)
+    extra_ldflags_libjava=-lws2_32
+    ;;
 *-*-cygwin)
     extra_ldflags_libjava=-liconv
     ;;
@@ -26273,6 +26277,7 @@
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "include/platform.h") CONFIG_LINKS="$CONFIG_LINKS include/platform.h:include/$PLATFORMH" ;;
     "java/io/natFile.cc") CONFIG_LINKS="$CONFIG_LINKS java/io/natFile.cc:java/io/natFile${FILE-${PLATFORM}}.cc" ;;
+    "java/io/natVMConsole.cc") CONFIG_LINKS="$CONFIG_LINKS java/io/natFile.cc:java/io/natVMConsole${FILE-${PLATFORM}}.cc" ;;
     "java/lang/natConcreteProcess.cc") CONFIG_LINKS="$CONFIG_LINKS java/lang/natConcreteProcess.cc:java/lang/nat${PLATFORM}Process.cc" ;;
     "java/net/natVMInetAddress.cc") CONFIG_LINKS="$CONFIG_LINKS java/net/natVMInetAddress.cc:java/net/natVMInetAddress${PLATFORMNET}.cc" ;;
     "java/net/natVMNetworkInterface.cc") CONFIG_LINKS="$CONFIG_LINKS java/net/natVMNetworkInterface.cc:java/net/natVMNetworkInterface${PLATFORMNET}.cc" ;;
--- libjava/configure.ac	2012-12-12 14:40:15.000000000 +0100
+++ libjava/configure.ac	2013-03-28 10:29:25.506938939 +0100
@@ -862,6 +862,7 @@
 test -d java/io || mkdir java/io
 test -d gnu || mkdir gnu
 AC_CONFIG_LINKS(java/io/natFile.cc:java/io/natFile${FILE-${PLATFORM}}.cc)
+AC_CONFIG_LINKS(java/io/natVMConsole.cc:java/io/natVMConsole${FILE-${PLATFORM}}.cc)
 
 # Likewise for natConcreteProcess.cc.
 test -d java/lang || mkdir java/lang
@@ -941,6 +942,9 @@
     LIBSTDCXXSPEC=-lstdc++
     LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -L`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -rpath `${PWDCMD-pwd}`/.libs:`${PWDCMD-pwd}`/../libstdc++-v3/src/.libs -lstdc++"
     ;;
+*-*-mingw*)
+    extra_ldflags_libjava=-lws2_32
+    ;;
 *-*-cygwin)
     extra_ldflags_libjava=-liconv
     ;;
--- libjava/gcj/javaprims.h	2012-12-19 18:03:15.000000000 +0100
+++ libjava/gcj/javaprims.h	2013-03-28 09:25:57.397778007 +0100
@@ -35,6 +35,18 @@
  #endif
 #endif
 
+// JNI calling convention.  Also defined in jni.h.
+// This is needed here because some classes have JNI friends. 
+
+#ifndef JNICALL
+ #if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32)) && !defined (_WIN64)
+  #define JNICALL __stdcall
+ #else
+  #define JNICALL
+ #endif
+#endif
+
+
 // To force selection of correct types that will mangle consistently
 // across platforms.
 extern "Java"
--- libjava/include/jni_md.h	2013-01-04 13:49:55.000000000 +0100
+++ libjava/include/jni_md.h	2013-03-28 09:25:57.397778007 +0100
@@ -124,6 +124,15 @@
 
 #endif /* __GCJ_JNI_IMPL__ */
 
+/*  JNI calling convention.  Also defined in javaprims.h. */
+#ifndef JNICALL
+ #if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32)) && !defined (_WIN64)
+  #define JNICALL __stdcall
+ #else
+  #define JNICALL
+ #endif
+#endif
+
 
 /* Linkage and calling conventions. */
 #if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32)) \
--- libjava/java/io/natVMConsole.cc	2012-03-26 18:24:33.000000000 +0200
+++ libjava/java/io/natVMConsole.cc	1970-01-01 01:00:00.000000000 +0100
@@ -1,49 +0,0 @@
-// natVMConsole.cc - Native part of VMConsole class.
-
-/* Copyright (C) 2012
-   Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the ObjectInputStream "LIBGCJ_LICENSE" for
-details.  */
-
-#include <config.h>
-
-#include <termios.h>
-#include <unistd.h>
-
-#include <gcj/cni.h>
-
-#include <java/io/Console.h>
-#include <java/io/VMConsole.h>
-
-#ifndef IUCLC
-#define IUCLC 0
-#endif
-
-#define TERMIOS_ECHO_IFLAGS (IUCLC|IXON|IXOFF|IXANY)
-#define TERMIOS_ECHO_LFLAGS (ECHO|ECHOE|ECHOK|ECHONL|TOSTOP)
-
-jstring
-java::io::VMConsole::readPassword(::java::io::Console *con)
-{
-  struct termios oldt, newt;
-  jstring result;
-
-  tcgetattr (STDIN_FILENO, &oldt);
-
-  tcgetattr (STDIN_FILENO, &newt);
-
-  newt.c_iflag &= ~TERMIOS_ECHO_IFLAGS;
-  newt.c_lflag &= ~TERMIOS_ECHO_LFLAGS;
-
-  tcsetattr (STDIN_FILENO, TCSANOW, &newt);
-
-  result = con->readLine ();
-
-  tcsetattr (STDIN_FILENO, TCSANOW, &oldt);
-
-  return result;
-}
--- libjava/java/io/natVMConsolePosix.cc	1970-01-01 01:00:00.000000000 +0100
+++ libjava/java/io/natVMConsolePosix.cc	2013-03-28 10:14:00.035185354 +0100
@@ -0,0 +1,49 @@
+// natVMConsolePosix.cc - Native Posix part of VMConsole class.
+
+/* Copyright (C) 2012
+   Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the ObjectInputStream "LIBGCJ_LICENSE" for
+details.  */
+
+#include <config.h>
+
+#include <termios.h>
+#include <unistd.h>
+
+#include <gcj/cni.h>
+
+#include <java/io/Console.h>
+#include <java/io/VMConsole.h>
+
+#ifndef IUCLC
+#define IUCLC 0
+#endif
+
+#define TERMIOS_ECHO_IFLAGS (IUCLC|IXON|IXOFF|IXANY)
+#define TERMIOS_ECHO_LFLAGS (ECHO|ECHOE|ECHOK|ECHONL|TOSTOP)
+
+jstring
+java::io::VMConsole::readPassword(::java::io::Console *con)
+{
+  struct termios oldt, newt;
+  jstring result;
+
+  tcgetattr (STDIN_FILENO, &oldt);
+
+  tcgetattr (STDIN_FILENO, &newt);
+
+  newt.c_iflag &= ~TERMIOS_ECHO_IFLAGS;
+  newt.c_lflag &= ~TERMIOS_ECHO_LFLAGS;
+
+  tcsetattr (STDIN_FILENO, TCSANOW, &newt);
+
+  result = con->readLine ();
+
+  tcsetattr (STDIN_FILENO, TCSANOW, &oldt);
+
+  return result;
+}
--- libjava/java/io/natVMConsoleWin32.cc	1970-01-01 01:00:00.000000000 +0100
+++ libjava/java/io/natVMConsoleWin32.cc	2013-03-28 10:40:24.535043157 +0100
@@ -0,0 +1,38 @@
+// natVMConsoleWin32.cc - Native Win32 part of VMConsole class.
+
+/* Copyright (C) 2012
+   Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the ObjectInputStream "LIBGCJ_LICENSE" for
+details.  */
+
+#include <config.h>
+
+#include <windows.h>
+#ifdef STRICT
+#undef STRICT
+#endif
+
+#include <gcj/cni.h>
+
+#include <java/io/Console.h>
+#include <java/io/VMConsole.h>
+
+jstring
+java::io::VMConsole::readPassword(::java::io::Console *con)
+{
+  jstring result;
+  HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE); 
+  DWORD mode = 0;
+  GetConsoleMode(hStdin, &mode);
+  SetConsoleMode(hStdin, mode & (~ENABLE_ECHO_INPUT));
+
+  result = con->readLine ();
+
+  SetConsoleMode(hStdin, mode);
+
+  return result;
+}
--- libjava/libgcj-noncore-dummy.def	2010-03-21 20:41:37.000000000 +0100
+++ libjava/libgcj-noncore-dummy.def	2013-03-28 09:57:59.734166861 +0100
@@ -1,5 +1,5 @@
 
-LIBRARY cyggcj-noncore-11.dll
+LIBRARY libgcj-noncore-14.dll
 
 EXPORTS
 
--- libjava/Makefile.am	2013-01-07 19:23:42.000000000 +0100
+++ libjava/Makefile.am	2013-03-28 09:29:43.338270664 +0100
@@ -524,7 +524,7 @@
 ## either always loads both at runtime.
 DLL_VERSION=`expr \`grep -v '^\#' $(srcdir)/libtool-version | sed -e 's/\(.*\):\(.*\):.*/\1 + \2/'\``
 libgcj-noncore-dummy.dll.a : $(srcdir)/libgcj-noncore-dummy.def
-	$(DLLTOOL) -d $^ -l $@ --dllname cyggcj-noncore-$(DLL_VERSION).dll 
+	$(DLLTOOL) -d $^ -l $@ --dllname libgcj-noncore-$(DLL_VERSION).dll 
 
 ## These are the libtool definitions for the noncore library.
 libgcj_noncore_la_SOURCES =
--- libjava/Makefile.in	2013-01-07 19:23:42.000000000 +0100
+++ libjava/Makefile.in	2013-03-28 09:25:57.401777908 +0100
@@ -10559,7 +10559,7 @@
 interpret.lo:  AM_CXXFLAGS += -fwrapv
 prims.lo: AM_CXXFLAGS += -fno-omit-frame-pointer
 @BUILD_SUBLIBS_TRUE@libgcj-noncore-dummy.dll.a : $(srcdir)/libgcj-noncore-dummy.def
-@BUILD_SUBLIBS_TRUE@	$(DLLTOOL) -d $^ -l $@ --dllname cyggcj-noncore-$(DLL_VERSION).dll 
+@BUILD_SUBLIBS_TRUE@	$(DLLTOOL) -d $^ -l $@ --dllname libgcj-noncore-$(DLL_VERSION).dll 
 
 $(db_name): gcj-dbtool$(EXEEXT)
 	@rm -f $(db_name)
--- ltmain.sh	2011-01-13 19:51:10.000000000 +0100
+++ ltmain.sh	2013-03-28 09:25:57.402777884 +0100
@@ -5438,7 +5438,7 @@
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=yes
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift