diff -ur gcc-6.4.0.orig/Makefile.in gcc-6.4.0/Makefile.in --- gcc-6.4.0.orig/Makefile.in 2016-04-13 11:02:08.863264000 -0700 +++ gcc-6.4.0/Makefile.in 2017-12-23 16:03:06.772817121 -0800 @@ -44461,7 +44461,7 @@ $$s/$$module_srcdir/configure \ --srcdir=$${topdir}/$$module_srcdir \ $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \ - --target=${target_alias} \ + --target=${target_alias} --disable-shared \ || exit 1 @endif target-boehm-gc Only in gcc-6.4.0.orig: boehm-gc Only in gcc-6.4.0: boehm-gc.new diff -ur gcc-6.4.0.orig/libjava/boehm.cc gcc-6.4.0/libjava/boehm.cc --- gcc-6.4.0.orig/libjava/boehm.cc 2014-05-13 09:23:11.129836000 -0700 +++ gcc-6.4.0/libjava/boehm.cc 2017-12-23 01:52:13.639738321 -0800 @@ -40,7 +40,7 @@ extern "C" { -#include +#include // gc_config.h // Set GC_DEBUG before including gc.h! #ifdef LIBGCJ_GC_DEBUG @@ -53,7 +53,7 @@ #ifdef THREAD_LOCAL_ALLOC # define GC_REDIRECT_TO_LOCAL -# include +//# include #endif // From boehm's misc.c @@ -468,7 +468,9 @@ int _Jv_SetGCFreeSpaceDivisor (int div) { - return (int)GC_set_free_space_divisor ((GC_word)div); + int old = GC_get_free_space_divisor(); + GC_set_free_space_divisor ((GC_word)div); + return old; } void Binary files gcc-6.4.0.orig/libjava/classpath/lib/gnu/java/beans/editors/ColorEditor.class and gcc-6.4.0/libjava/classpath/lib/gnu/java/beans/editors/ColorEditor.class differ Only in gcc-6.4.0/libjava/classpath/tools/asm/org/objectweb/asm/xml: ASMContentHandler$1.class Only in gcc-6.4.0/libjava/classpath/tools/asm/org/objectweb/asm/xml: Processor$1.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$1.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$10.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$11.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$12.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$2.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$3.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$4.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$5.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$6.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$7.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$8.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/jarsigner: Main$ToolParser$9.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/keytool: Command$1.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/classpath/tools/keytool: Main$1.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/gcj/tools/gc_analyze: MemoryAnalyze$1Info.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/gcj/tools/gc_analyze: MemoryAnalyze$OptionParser$1.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/gcj/tools/gc_analyze: MemoryAnalyze$OptionParser$2.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/gcj/tools/gc_analyze: MemoryAnalyze$OptionParser$3.class Only in gcc-6.4.0/libjava/classpath/tools/classes/gnu/gcj/tools/gc_analyze: MemoryAnalyze$OptionParser$4.class diff -ur gcc-6.4.0.orig/libjava/configure gcc-6.4.0/libjava/configure --- gcc-6.4.0.orig/libjava/configure 2017-07-04 00:28:14.709353456 -0700 +++ gcc-6.4.0/libjava/configure 2017-12-23 16:12:12.768206777 -0800 @@ -20627,7 +20627,7 @@ boehm) { $as_echo "$as_me:${as_lineno-$LINENO}: result: boehm" >&5 $as_echo "boehm" >&6; } - GCLIBS=../boehm-gc/libgcjgc_convenience.la + GCLIBS=../boehm-gc/libgc.la JC1GCSPEC='-fuse-boehm-gc' GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs" GCINCS='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include' diff -ur gcc-6.4.0.orig/libjava/configure.ac gcc-6.4.0/libjava/configure.ac --- gcc-6.4.0.orig/libjava/configure.ac 2015-05-28 11:13:55.185034000 -0700 +++ gcc-6.4.0/libjava/configure.ac 2017-12-23 16:12:27.788003500 -0800 @@ -951,7 +951,7 @@ case "$GC" in boehm) AC_MSG_RESULT(boehm) - GCLIBS=../boehm-gc/libgcjgc_convenience.la + GCLIBS=../boehm-gc/libgc.la JC1GCSPEC='-fuse-boehm-gc' GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs" GCINCS='-I$(top_srcdir)/../boehm-gc/include -I../boehm-gc/include' diff -ur gcc-6.4.0.orig/libjava/gcj/javaprims.h gcc-6.4.0/libjava/gcj/javaprims.h --- gcc-6.4.0.orig/libjava/gcj/javaprims.h 2012-12-19 09:03:15.048303000 -0800 +++ gcc-6.4.0/libjava/gcj/javaprims.h 2017-12-22 23:31:05.049525158 -0800 @@ -21,10 +21,10 @@ // FIXME: this is a hack until we get a proper gcjh. // It is needed to work around system header files that define TRUE // and FALSE. -#undef TRUE -#define TRUE TRUE -#undef FALSE -#define FALSE FALSE +//#undef TRUE +//#define TRUE TRUE +//#undef FALSE +//#define FALSE FALSE // JNI calling convention also defined in jni.h */ #ifndef JNICALL diff -ur gcc-6.4.0.orig/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc gcc-6.4.0/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc --- gcc-6.4.0.orig/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc 2012-04-05 03:04:40.058561000 -0700 +++ gcc-6.4.0/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc 2017-12-22 23:31:05.057524839 -0800 @@ -70,7 +70,7 @@ // We use native_fd in place of fd here. From leaving fd null we avoid // the double close problem in FileDescriptor.finalize. - native_fd = (jint) hSocket; + native_fd = (jlong) hSocket; } void diff -ur gcc-6.4.0.orig/libjava/gnu/java/net/natPlainSocketImplWin32.cc gcc-6.4.0/libjava/gnu/java/net/natPlainSocketImplWin32.cc --- gcc-6.4.0.orig/libjava/gnu/java/net/natPlainSocketImplWin32.cc 2006-11-03 02:16:04.156340000 -0800 +++ gcc-6.4.0/libjava/gnu/java/net/natPlainSocketImplWin32.cc 2017-12-22 23:31:05.057524839 -0800 @@ -58,7 +58,7 @@ // We use native_fd in place of fd here. From leaving fd null we avoid // the double close problem in FileDescriptor.finalize. - native_fd = (jint) hSocket; + native_fd = (jlong) hSocket; } void @@ -326,7 +326,7 @@ else throw new ::java::net::SocketException (JvNewStringUTF ("invalid family")); - s->native_fd = (jint) hSocket; + s->native_fd = (jlong) hSocket; s->localport = localport; s->address = ::java::net::InetAddress::getByAddress (raddr); s->port = rport; diff -ur gcc-6.4.0.orig/libjava/gnu/java/nio/channels/natFileChannelWin32.cc gcc-6.4.0/libjava/gnu/java/nio/channels/natFileChannelWin32.cc --- gcc-6.4.0.orig/libjava/gnu/java/nio/channels/natFileChannelWin32.cc 2007-01-28 10:55:36.511864000 -0800 +++ gcc-6.4.0/libjava/gnu/java/nio/channels/natFileChannelWin32.cc 2017-12-22 23:31:05.069524361 -0800 @@ -66,11 +66,11 @@ void FileChannelImpl::init(void) { - in = new FileChannelImpl((jint)(GetStdHandle (STD_INPUT_HANDLE)), + in = new FileChannelImpl((jlong)(GetStdHandle (STD_INPUT_HANDLE)), FileChannelImpl::READ); - out = new FileChannelImpl((jint)(GetStdHandle (STD_OUTPUT_HANDLE)), + out = new FileChannelImpl((jlong)(GetStdHandle (STD_OUTPUT_HANDLE)), FileChannelImpl::WRITE); - err = new FileChannelImpl((jint)(GetStdHandle (STD_ERROR_HANDLE)), + err = new FileChannelImpl((jlong)(GetStdHandle (STD_ERROR_HANDLE)), FileChannelImpl::WRITE); } @@ -144,7 +144,7 @@ // closing this file. _Jv_platform_close_on_exec (handle); - return (jint) handle; + return (jlong) handle; } void @@ -198,7 +198,7 @@ FileChannelImpl::implCloseChannel (void) { HANDLE save = (HANDLE)fd; - fd = (jint)INVALID_HANDLE_VALUE; + fd = (jlong)INVALID_HANDLE_VALUE; if (! CloseHandle (save)) _Jv_ThrowIOException (); } diff -ur gcc-6.4.0.orig/libjava/include/boehm-gc.h gcc-6.4.0/libjava/include/boehm-gc.h --- gcc-6.4.0.orig/libjava/include/boehm-gc.h 2007-04-23 14:12:10.481514000 -0700 +++ gcc-6.4.0/libjava/include/boehm-gc.h 2017-12-23 16:15:50.783770795 -0800 @@ -27,7 +27,7 @@ #include #include -#include // for THREAD_LOCAL_ALLOC +//#include // for THREAD_LOCAL_ALLOC extern "C" void * GC_gcj_malloc(size_t, void *); extern "C" void * GC_malloc_atomic(size_t); diff -ur gcc-6.4.0.orig/libjava/include/jvm.h gcc-6.4.0/libjava/include/jvm.h --- gcc-6.4.0.orig/libjava/include/jvm.h 2016-01-03 03:38:51.544171000 -0800 +++ gcc-6.4.0/libjava/include/jvm.h 2017-12-22 23:31:05.081523884 -0800 @@ -475,13 +475,13 @@ } // This function is used to determine the hash code of an object. -inline jint +inline jlong _Jv_HashCode (jobject obj) { // This was chosen to yield relatively well distributed results on // both 32- and 64-bit architectures. Note 0x7fffffff is prime. // FIXME: we assume sizeof(long) == sizeof(void *). - return (jint) ((unsigned long) obj % 0x7fffffff); + return (jlong) ((uintptr_t) obj % 0x7fffffff); } // Return a raw pointer to the elements of an array given the array diff -ur gcc-6.4.0.orig/libjava/include/win32.h gcc-6.4.0/libjava/include/win32.h --- gcc-6.4.0.orig/libjava/include/win32.h 2007-01-09 11:58:05.773323000 -0800 +++ gcc-6.4.0/libjava/include/win32.h 2017-12-22 23:31:05.081523884 -0800 @@ -93,7 +93,8 @@ // Type of libffi ABI used by JNICALL methods. NOTE: This must agree // with the JNICALL definition in jni.h -#define _Jv_platform_ffi_abi FFI_STDCALL +#define _Jv_platform_ffi_abi FFI_DEFAULT_ABI +//FFI_STDCALL /* Useful helper classes and methods. */ diff -ur gcc-6.4.0.orig/libjava/interpret.cc gcc-6.4.0/libjava/interpret.cc --- gcc-6.4.0.orig/libjava/interpret.cc 2012-02-01 02:46:36.411058000 -0800 +++ gcc-6.4.0/libjava/interpret.cc 2017-12-22 23:31:05.085523724 -0800 @@ -11,6 +11,7 @@ /* Author: Kresten Krab Thorup */ #include +#include "ffi.h" #include #pragma implementation "java-interp.h" diff -ur gcc-6.4.0.orig/libjava/java/io/natVMConsole.cc gcc-6.4.0/libjava/java/io/natVMConsole.cc --- gcc-6.4.0.orig/libjava/java/io/natVMConsole.cc 2012-03-26 09:24:33.522834000 -0700 +++ gcc-6.4.0/libjava/java/io/natVMConsole.cc 2017-12-22 20:08:31.453396667 -0800 @@ -11,7 +11,7 @@ #include -#include +//#include #include #include @@ -29,9 +29,9 @@ jstring java::io::VMConsole::readPassword(::java::io::Console *con) { - struct termios oldt, newt; + //struct termios oldt, newt; jstring result; - +/* tcgetattr (STDIN_FILENO, &oldt); tcgetattr (STDIN_FILENO, &newt); @@ -40,10 +40,10 @@ newt.c_lflag &= ~TERMIOS_ECHO_LFLAGS; tcsetattr (STDIN_FILENO, TCSANOW, &newt); - +*/ result = con->readLine (); - tcsetattr (STDIN_FILENO, TCSANOW, &oldt); + //tcsetattr (STDIN_FILENO, TCSANOW, &oldt); return result; } diff -ur gcc-6.4.0.orig/libjava/java/lang/natClass.cc gcc-6.4.0/libjava/java/lang/natClass.cc --- gcc-6.4.0.orig/libjava/java/lang/natClass.cc 2014-05-13 09:23:11.129836000 -0700 +++ gcc-6.4.0/libjava/java/lang/natClass.cc 2017-12-22 23:31:05.093523406 -0800 @@ -743,7 +743,7 @@ // Step 2. java::lang::Thread *self = java::lang::Thread::currentThread(); - self = (java::lang::Thread *) ((long) self | 1); + self = (java::lang::Thread *) ((intptr_t) self | 1); while (state == JV_STATE_IN_PROGRESS && thread && thread != self) wait (); diff -ur gcc-6.4.0.orig/libjava/java/lang/natClassLoader.cc gcc-6.4.0/libjava/java/lang/natClassLoader.cc --- gcc-6.4.0.orig/libjava/java/lang/natClassLoader.cc 2009-03-12 09:13:19.577950000 -0700 +++ gcc-6.4.0/libjava/java/lang/natClassLoader.cc 2017-12-22 23:31:05.093523406 -0800 @@ -290,7 +290,7 @@ { jclass klass = *classes; - _Jv_CheckABIVersion ((unsigned long) klass->next_or_version); + _Jv_CheckABIVersion ((uintptr_t) klass->next_or_version); (*_Jv_RegisterClassHook) (klass); } } @@ -307,7 +307,7 @@ { jclass klass = classes[i]; - _Jv_CheckABIVersion ((unsigned long) klass->next_or_version); + _Jv_CheckABIVersion ((uintptr_t) klass->next_or_version); (*_Jv_RegisterClassHook) (klass); } } @@ -316,8 +316,8 @@ inline jclass _Jv_NewClassFromInitializer (const char *class_initializer) { - const unsigned long version - = ((unsigned long) + const uintptr_t version + = ((uintptr_t) ((::java::lang::Class *)class_initializer)->next_or_version); _Jv_CheckABIVersion (version); @@ -391,7 +391,7 @@ if (system_class_list != SYSTEM_LOADER_INITIALIZED) { - unsigned long abi = (unsigned long) klass->next_or_version; + uintptr_t abi = (uintptr_t) klass->next_or_version; if (! _Jv_ClassForBootstrapLoader (abi)) { klass->next_or_version = system_class_list; diff -ur gcc-6.4.0.orig/libjava/java/lang/natString.cc gcc-6.4.0/libjava/java/lang/natString.cc --- gcc-6.4.0.orig/libjava/java/lang/natString.cc 2008-05-20 20:49:03.183053000 -0700 +++ gcc-6.4.0/libjava/java/lang/natString.cc 2017-12-23 00:56:43.339482113 -0800 @@ -50,9 +50,9 @@ #define DELETED_STRING ((jstring)(~0)) #define SET_STRING_IS_INTERNED(STR) /* nothing */ -#define UNMASK_PTR(Ptr) (((unsigned long) (Ptr)) & ~0x01) -#define MASK_PTR(Ptr) (((unsigned long) (Ptr)) | 0x01) -#define PTR_MASKED(Ptr) (((unsigned long) (Ptr)) & 0x01) +#define UNMASK_PTR(Ptr) (((uintptr_t) (Ptr)) & ~0x01) +#define MASK_PTR(Ptr) (((uintptr_t) (Ptr)) | 0x01) +#define PTR_MASKED(Ptr) (((uintptr_t) (Ptr)) & 0x01) /* Find a slot where the string with elements DATA, length LEN, and hash HASH should go in the strhash table of interned strings. */ diff -ur gcc-6.4.0.orig/libjava/java/lang/natWin32Process.cc gcc-6.4.0/libjava/java/lang/natWin32Process.cc --- gcc-6.4.0.orig/libjava/java/lang/natWin32Process.cc 2007-03-07 10:05:39.099121000 -0800 +++ gcc-6.4.0/libjava/java/lang/natWin32Process.cc 2017-12-22 23:31:05.097523247 -0800 @@ -59,7 +59,7 @@ if (procHandle) { CloseHandle((HANDLE) procHandle); - procHandle = (jint) INVALID_HANDLE_VALUE; + procHandle = (intptr_t) INVALID_HANDLE_VALUE; } } @@ -221,7 +221,7 @@ { using namespace java::io; - procHandle = (jint) INVALID_HANDLE_VALUE; + procHandle = (intptr_t) INVALID_HANDLE_VALUE; // Reconstruct the command line. jstring *elts = elements (progarray); @@ -293,16 +293,16 @@ : ChildProcessPipe::OUTPUT); outputStream = new FileOutputStream (new FileChannelImpl ( - (jint) aChildStdIn.getParentHandle (), + (intptr_t) aChildStdIn.getParentHandle (), FileChannelImpl::WRITE)); inputStream = new FileInputStream (new FileChannelImpl ( - (jint) aChildStdOut.getParentHandle (), + (intptr_t) aChildStdOut.getParentHandle (), FileChannelImpl::READ)); if (redirect) errorStream = Win32Process$EOFInputStream::instance; else errorStream = new FileInputStream (new FileChannelImpl ( - (jint) aChildStdErr.getParentHandle (), + (intptr_t) aChildStdErr.getParentHandle (), FileChannelImpl::READ)); // Now create the child process. @@ -343,7 +343,7 @@ _Jv_WinStrError (_T("Error creating child process"), dwErrorCode)); } - procHandle = (jint ) pi.hProcess; + procHandle = (intptr_t) pi.hProcess; _Jv_Free (cmdLine); if (env != NULL) diff -ur gcc-6.4.0.orig/libjava/link.cc gcc-6.4.0/libjava/link.cc --- gcc-6.4.0.orig/libjava/link.cc 2009-03-12 09:13:19.577950000 -0700 +++ gcc-6.4.0/libjava/link.cc 2017-12-22 23:31:05.097523247 -0800 @@ -1408,7 +1408,7 @@ (const char*)signature->chars()); fprintf (stderr, " [%d] = offset %d\n", index + 1, - (int)(unsigned long)klass->itable->addresses[index * 2 + 1]); + (int)(uintptr_t)klass->itable->addresses[index * 2 + 1]); } } diff -ur gcc-6.4.0.orig/libjava/win32-threads.cc gcc-6.4.0/libjava/win32-threads.cc --- gcc-6.4.0.orig/libjava/win32-threads.cc 2007-01-09 11:58:05.773323000 -0800 +++ gcc-6.4.0/libjava/win32-threads.cc 2017-12-23 12:37:45.582531171 -0800 @@ -365,7 +365,16 @@ return 0; } - +#define GC_WIN32_SIZE_T uintptr_t +extern "C" +{ +GC_API HANDLE WINAPI GC_CreateThread( + LPSECURITY_ATTRIBUTES lpThreadAttributes, + GC_WIN32_SIZE_T dwStackSize, + LPTHREAD_START_ROUTINE lpStartAddress, + LPVOID lpParameter, DWORD dwCreationFlags, + LPDWORD lpThreadId); +} void _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data, _Jv_ThreadStartFunc *meth) {