8200609: Proper fix for mapfile removal for libjsig

Reviewed-by: erikj, dholmes
This commit is contained in:
Magnus Ihse Bursie 2018-09-10 09:58:23 +02:00
parent 26f801426d
commit 6b2d1c9834
3 changed files with 15 additions and 49 deletions
make
src/java.base/unix/native/libjsig

@ -128,14 +128,6 @@ endif
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 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
LIBS_linux := $(LIBDL), \
LIBS_solaris := $(LIBDL), \
LIBS_aix := $(LIBDL), \
MAPFILE := $(LIBJSIG_MAPFILE), \
))
TARGETS += $(BUILD_LIBJSIG)

@ -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:
*;
};

@ -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 <dlfcn.h>
#include <errno.h>
#include <pthread.h>
@ -208,7 +220,7 @@ static sa_handler_t set_signal(int sig, sa_handler_t disp, bool is_sigset) {
}
}
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 @@ sa_handler_t signal(int sig, sa_handler_t disp) {
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 @@ static int call_os_sigaction(int sig, const struct sigaction *act,
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;