Subject: Fix build error with gcc >= 10.0 Upstream: Yes Upstream-Url: https://bugs.openjdk.java.net/browse/JDK-8235903 Author: Simon Frankenberger This is a backport of the fixes to make it compile with gcc10 again. --- openjdk.orig/jdk/src/solaris/native/java/lang/childproc.c +++ openjdk/jdk/src/solaris/native/java/lang/childproc.c @@ -33,6 +33,7 @@ #include "childproc.h" +const char * const *parentPathv; ssize_t restartableWrite(int fd, const void *buf, size_t count) --- openjdk.orig/jdk/src/solaris/native/java/lang/childproc.h +++ openjdk/jdk/src/solaris/native/java/lang/childproc.h @@ -118,7 +118,7 @@ * The cached and split version of the JDK's effective PATH. * (We don't support putenv("PATH=...") in native code) */ -const char * const *parentPathv; +extern const char * const *parentPathv; ssize_t restartableWrite(int fd, const void *buf, size_t count); int restartableDup2(int fd_from, int fd_to); --- openjdk.orig/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c +++ openjdk/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.c @@ -28,6 +28,9 @@ #include #include "NativeFunc.h" +/* global GSS function table */ +GSS_FUNCTION_TABLE_PTR ftab; + /* standard GSS method names (ordering is from mapfile) */ static const char RELEASE_NAME[] = "gss_release_name"; static const char IMPORT_NAME[] = "gss_import_name"; --- openjdk.orig/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.h +++ openjdk/jdk/src/solaris/native/sun/security/jgss/wrapper/NativeFunc.h @@ -265,6 +265,6 @@ typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR; /* global GSS function table */ -GSS_FUNCTION_TABLE_PTR ftab; +extern GSS_FUNCTION_TABLE_PTR ftab; #endif --- /dev/null +++ openjdk/jdk/src/solaris/native/sun/nio/ch/Sctp.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "Sctp.h" + +sctp_getladdrs_func* nio_sctp_getladdrs; +sctp_freeladdrs_func* nio_sctp_freeladdrs; +sctp_getpaddrs_func* nio_sctp_getpaddrs; +sctp_freepaddrs_func* nio_sctp_freepaddrs; +sctp_bindx_func* nio_sctp_bindx; +sctp_peeloff_func* nio_sctp_peeloff; + --- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/Sctp.h +++ openjdk/jdk/src/solaris/native/sun/nio/ch/Sctp.h @@ -332,12 +332,12 @@ #define nio_sctp_bindx sctp_bindx #define nio_sctp_peeloff sctp_peeloff #else -sctp_getladdrs_func* nio_sctp_getladdrs; -sctp_freeladdrs_func* nio_sctp_freeladdrs; -sctp_getpaddrs_func* nio_sctp_getpaddrs; -sctp_freepaddrs_func* nio_sctp_freepaddrs; -sctp_bindx_func* nio_sctp_bindx; -sctp_peeloff_func* nio_sctp_peeloff; +extern sctp_getladdrs_func* nio_sctp_getladdrs; +extern sctp_freeladdrs_func* nio_sctp_freeladdrs; +extern sctp_getpaddrs_func* nio_sctp_getpaddrs; +extern sctp_freepaddrs_func* nio_sctp_freepaddrs; +extern sctp_bindx_func* nio_sctp_bindx; +extern sctp_peeloff_func* nio_sctp_peeloff; #endif jboolean loadSocketExtensionFuncs(JNIEnv* env); --- openjdk.orig/jdk/src/solaris/native/common/deps/cups_fp.c +++ openjdk/jdk/src/solaris/native/common/deps/cups_fp.c @@ -32,6 +32,16 @@ #include +fn_cupsServer j2d_cupsServer; +fn_ippPort j2d_ippPort; +fn_httpConnect j2d_httpConnect; +fn_httpClose j2d_httpClose; +fn_cupsGetPPD j2d_cupsGetPPD; +fn_ppdOpenFile j2d_ppdOpenFile; +fn_ppdClose j2d_ppdClose; +fn_ppdFindOption j2d_ppdFindOption; +fn_ppdPageSize j2d_ppdPageSize; + jboolean cups_init() { void *handle = dlopen(VERSIONED_JNI_LIB_NAME("cups", "2"), --- openjdk.orig/jdk/src/solaris/native/common/deps/cups_fp.h +++ openjdk/jdk/src/solaris/native/common/deps/cups_fp.h @@ -36,15 +36,15 @@ typedef ppd_option_t* (*fn_ppdFindOption)(ppd_file_t *, const char *); typedef ppd_size_t* (*fn_ppdPageSize)(ppd_file_t *, char *); -fn_cupsServer j2d_cupsServer; -fn_ippPort j2d_ippPort; -fn_httpConnect j2d_httpConnect; -fn_httpClose j2d_httpClose; -fn_cupsGetPPD j2d_cupsGetPPD; -fn_ppdOpenFile j2d_ppdOpenFile; -fn_ppdClose j2d_ppdClose; -fn_ppdFindOption j2d_ppdFindOption; -fn_ppdPageSize j2d_ppdPageSize; +extern fn_cupsServer j2d_cupsServer; +extern fn_ippPort j2d_ippPort; +extern fn_httpConnect j2d_httpConnect; +extern fn_httpClose j2d_httpClose; +extern fn_cupsGetPPD j2d_cupsGetPPD; +extern fn_ppdOpenFile j2d_ppdOpenFile; +extern fn_ppdClose j2d_ppdClose; +extern fn_ppdFindOption j2d_ppdFindOption; +extern fn_ppdPageSize j2d_ppdPageSize; #define cupsServer (*j2d_cupsServer) #define ippPort (*j2d_ippPort)