--- old/make/lib/Lib-java.base.gmk 2018-09-05 14:09:38.298829021 +0200 +++ new/make/lib/Lib-java.base.gmk 2018-09-05 14:09:38.002829023 +0200 @@ -128,14 +128,6 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) ifeq ($(STATIC_BUILD), false) - - LIBJSIG_MAPFILE := $(wildcard $(TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS)) - - ifeq ($(OPENJDK_TARGET_OS), linux) - # FIXME: This is probably not what we want to do, but keep it now for compatibility. - LIBJSIG_CFLAGS := $(EXPORT_ALL_SYMBOLS) - endif - $(eval $(call SetupJdkLibrary, BUILD_LIBJSIG, \ NAME := jsig, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBJSIG_CFLAGS), \ @@ -144,7 +136,6 @@ LIBS_linux := $(LIBDL), \ LIBS_solaris := $(LIBDL), \ LIBS_aix := $(LIBDL), \ - MAPFILE := $(LIBJSIG_MAPFILE), \ )) TARGETS += $(BUILD_LIBJSIG) --- old/src/java.base/unix/native/libjsig/jsig.c 2018-09-05 14:09:38.982829016 +0200 +++ new/src/java.base/unix/native/libjsig/jsig.c 2018-09-05 14:09:38.670829018 +0200 @@ -29,6 +29,18 @@ * Used for signal-chaining. See RFE 4381843. */ +#include "jni.h" + +#ifdef SOLARIS +/* Our redeclarations of the system functions must not have a less + * restrictive linker scoping, so we have to declare them as JNIEXPORT + * before including signal.h */ +#include "sys/signal.h" +JNIEXPORT void (*signal(int sig, void (*disp)(int)))(int); +JNIEXPORT void (*sigset(int sig, void (*disp)(int)))(int); +JNIEXPORT int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); +#endif + #include #include #include @@ -208,7 +220,7 @@ } } -sa_handler_t signal(int sig, sa_handler_t disp) { +JNIEXPORT sa_handler_t signal(int sig, sa_handler_t disp) { if (sig < 0 || sig >= MAX_SIGNALS) { errno = EINVAL; return SIG_ERR; @@ -217,7 +229,7 @@ return set_signal(sig, disp, false); } -sa_handler_t sigset(int sig, sa_handler_t disp) { +JNIEXPORT sa_handler_t sigset(int sig, sa_handler_t disp) { #ifdef _ALLBSD_SOURCE printf("sigset() is not supported by BSD"); exit(0); @@ -243,7 +255,7 @@ return (*os_sigaction)(sig, act, oact); } -int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { +JNIEXPORT int sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { int res; bool sigused; struct sigaction oldAct; --- old/make/mapfiles/libjsig/mapfile-vers-solaris 2018-09-05 14:09:39.690829010 +0200 +++ /dev/null 2018-06-13 13:14:25.719029190 +0200 @@ -1,37 +0,0 @@ -# -# Copyright (c) 2005, 2018, 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. -# -# 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. -# -# - -# Define library interface. - -SUNWprivate_1.1 { - global: - JVM_begin_signal_setting; - JVM_end_signal_setting; - JVM_get_signal_action; - sigaction; - signal; - sigset; - local: - *; -};