提交 d7c3265e 编写于 作者: B bobv

Merge

...@@ -75,6 +75,11 @@ CFLAGS += -fno-rtti ...@@ -75,6 +75,11 @@ CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions CFLAGS += -fno-exceptions
CFLAGS += -D_REENTRANT CFLAGS += -D_REENTRANT
CFLAGS += -fcheck-new CFLAGS += -fcheck-new
# version 4 and above support fvisibility=hidden (matches jni_x86.h file)
# except 4.1.2 gives pointless warnings that can't be disabled (afaik)
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
CFLAGS += -fvisibility=hidden
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32 -march=i586 ARCHFLAG/i486 = -m32 -march=i586
......
...@@ -262,14 +262,6 @@ SUNWprivate_1.1 { ...@@ -262,14 +262,6 @@ SUNWprivate_1.1 {
JVM_SetField; JVM_SetField;
JVM_SetPrimitiveField; JVM_SetPrimitiveField;
# Needed for dropping VM into JDK 1.3.x, 1.4
_JVM_native_threads;
jdk_sem_init;
jdk_sem_post;
jdk_sem_wait;
jdk_pthread_sigmask;
jdk_waitpid;
# debug JVM # debug JVM
JVM_AccessVMBooleanFlag; JVM_AccessVMBooleanFlag;
JVM_AccessVMIntFlag; JVM_AccessVMIntFlag;
......
...@@ -262,14 +262,6 @@ SUNWprivate_1.1 { ...@@ -262,14 +262,6 @@ SUNWprivate_1.1 {
JVM_SetField; JVM_SetField;
JVM_SetPrimitiveField; JVM_SetPrimitiveField;
# Needed for dropping VM into JDK 1.3.x, 1.4
_JVM_native_threads;
jdk_sem_init;
jdk_sem_post;
jdk_sem_wait;
jdk_pthread_sigmask;
jdk_waitpid;
# miscellaneous functions # miscellaneous functions
jio_fprintf; jio_fprintf;
jio_printf; jio_printf;
......
...@@ -23,8 +23,13 @@ ...@@ -23,8 +23,13 @@
* questions. * questions.
*/ */
#define JNIEXPORT #if defined(__GNUC__) && (__GNUC__ >= 4)
#define JNIIMPORT #define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#else
#define JNIEXPORT
#define JNIIMPORT
#endif
#define JNICALL #define JNICALL
typedef int jint; typedef int jint;
......
...@@ -27,10 +27,16 @@ ...@@ -27,10 +27,16 @@
#define _JAVASOFT_JNI_MD_H_ #define _JAVASOFT_JNI_MD_H_
#if defined(SOLARIS) || defined(LINUX) #if defined(SOLARIS) || defined(LINUX)
#if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2)
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#else
#define JNIEXPORT #define JNIEXPORT
#define JNIIMPORT #define JNIIMPORT
#define JNICALL #endif
#define JNICALL
typedef int jint; typedef int jint;
#ifdef _LP64 #ifdef _LP64
......
...@@ -24,8 +24,14 @@ ...@@ -24,8 +24,14 @@
* questions. * questions.
*/ */
#define JNIEXPORT
#define JNIIMPORT #if defined(__GNUC__) && (__GNUC__ >= 4)
#define JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default")))
#else
#define JNIEXPORT
#define JNIIMPORT
#endif
#define JNICALL #define JNICALL
typedef int jint; typedef int jint;
......
...@@ -29,11 +29,6 @@ ...@@ -29,11 +29,6 @@
#include <signal.h> #include <signal.h>
/*
* FIXME: This is temporary hack to keep Linux Runtime.exec()
* code happy. See $JDK/src/linux/native/java/lang/UnixProcess_md.c
*/
int _JVM_native_threads = 1;
// sun.misc.Signal /////////////////////////////////////////////////////////// // sun.misc.Signal ///////////////////////////////////////////////////////////
// Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23 // Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23
......
...@@ -2517,8 +2517,10 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info ...@@ -2517,8 +2517,10 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
return end; return end;
} }
extern "C" void numa_warn(int number, char *where, ...) { } // Something to do with the numa-aware allocator needs these symbols
extern "C" void numa_error(char *where) { } extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
extern "C" JNIEXPORT int fork1() { return fork(); }
// If we are running with libnuma version > 2, then we should // If we are running with libnuma version > 2, then we should
...@@ -3491,7 +3493,7 @@ bool os::is_interrupted(Thread* thread, bool clear_interrupted) { ...@@ -3491,7 +3493,7 @@ bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
// Note that the VM will print warnings if it detects conflicting signal // Note that the VM will print warnings if it detects conflicting signal
// handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers".
// //
extern "C" int extern "C" JNIEXPORT int
JVM_handle_linux_signal(int signo, siginfo_t* siginfo, JVM_handle_linux_signal(int signo, siginfo_t* siginfo,
void* ucontext, int abort_if_unrecognized); void* ucontext, int abort_if_unrecognized);
...@@ -4686,44 +4688,6 @@ void os::pause() { ...@@ -4686,44 +4688,6 @@ void os::pause() {
} }
} }
extern "C" {
/**
* NOTE: the following code is to keep the green threads code
* in the libjava.so happy. Once the green threads is removed,
* these code will no longer be needed.
*/
int
jdk_waitpid(pid_t pid, int* status, int options) {
return waitpid(pid, status, options);
}
int
fork1() {
return fork();
}
int
jdk_sem_init(sem_t *sem, int pshared, unsigned int value) {
return sem_init(sem, pshared, value);
}
int
jdk_sem_post(sem_t *sem) {
return sem_post(sem);
}
int
jdk_sem_wait(sem_t *sem) {
return sem_wait(sem);
}
int
jdk_pthread_sigmask(int how , const sigset_t* newmask, sigset_t* oldmask) {
return pthread_sigmask(how , newmask, oldmask);
}
}
// Refer to the comments in os_solaris.cpp park-unpark. // Refer to the comments in os_solaris.cpp park-unpark.
// //
......
...@@ -4221,7 +4221,9 @@ void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* met ...@@ -4221,7 +4221,9 @@ void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* met
// Note that the VM will print warnings if it detects conflicting signal // Note that the VM will print warnings if it detects conflicting signal
// handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers".
// //
extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); extern "C" JNIEXPORT int
JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext,
int abort_if_unrecognized);
void signalHandler(int sig, siginfo_t* info, void* ucVoid) { void signalHandler(int sig, siginfo_t* info, void* ucVoid) {
......
...@@ -542,7 +542,7 @@ inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) { ...@@ -542,7 +542,7 @@ inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) {
return false; return false;
} }
extern "C" int extern "C" JNIEXPORT int
JVM_handle_linux_signal(int sig, JVM_handle_linux_signal(int sig,
siginfo_t* info, siginfo_t* info,
void* ucVoid, void* ucVoid,
......
...@@ -216,7 +216,7 @@ extern "C" void FetchNPFI () ; ...@@ -216,7 +216,7 @@ extern "C" void FetchNPFI () ;
extern "C" void FetchNResume () ; extern "C" void FetchNResume () ;
#endif // AMD64 #endif // AMD64
extern "C" int extern "C" JNIEXPORT int
JVM_handle_linux_signal(int sig, JVM_handle_linux_signal(int sig,
siginfo_t* info, siginfo_t* info,
void* ucVoid, void* ucVoid,
......
...@@ -116,7 +116,7 @@ frame os::fetch_frame_from_context(void* ucVoid) { ...@@ -116,7 +116,7 @@ frame os::fetch_frame_from_context(void* ucVoid) {
ShouldNotCallThis(); ShouldNotCallThis();
} }
extern "C" int extern "C" JNIEXPORT int
JVM_handle_linux_signal(int sig, JVM_handle_linux_signal(int sig,
siginfo_t* info, siginfo_t* info,
void* ucVoid, void* ucVoid,
......
...@@ -317,9 +317,9 @@ extern "C" void Fetch32Resume () ; ...@@ -317,9 +317,9 @@ extern "C" void Fetch32Resume () ;
extern "C" void FetchNPFI () ; extern "C" void FetchNPFI () ;
extern "C" void FetchNResume () ; extern "C" void FetchNResume () ;
extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); extern "C" JNIEXPORT int
JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { int abort_if_unrecognized) {
ucontext_t* uc = (ucontext_t*) ucVoid; ucontext_t* uc = (ucontext_t*) ucVoid;
Thread* t = ThreadLocalStorage::get_thread_slow(); Thread* t = ThreadLocalStorage::get_thread_slow();
......
...@@ -365,8 +365,6 @@ bool os::is_allocatable(size_t bytes) { ...@@ -365,8 +365,6 @@ bool os::is_allocatable(size_t bytes) {
} }
extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized);
extern "C" void Fetch32PFI () ; extern "C" void Fetch32PFI () ;
extern "C" void Fetch32Resume () ; extern "C" void Fetch32Resume () ;
#ifdef AMD64 #ifdef AMD64
...@@ -374,7 +372,9 @@ extern "C" void FetchNPFI () ; ...@@ -374,7 +372,9 @@ extern "C" void FetchNPFI () ;
extern "C" void FetchNResume () ; extern "C" void FetchNResume () ;
#endif // AMD64 #endif // AMD64
int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { extern "C" JNIEXPORT int
JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
int abort_if_unrecognized) {
ucontext_t* uc = (ucontext_t*) ucVoid; ucontext_t* uc = (ucontext_t*) ucVoid;
#ifndef AMD64 #ifndef AMD64
......
...@@ -520,6 +520,7 @@ static void forte_fill_call_trace_given_top(JavaThread* thd, ...@@ -520,6 +520,7 @@ static void forte_fill_call_trace_given_top(JavaThread* thd,
// method_id - jmethodID of the method being executed // method_id - jmethodID of the method being executed
extern "C" { extern "C" {
JNIEXPORT
void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) {
// This is if'd out because we no longer use thread suspension. // This is if'd out because we no longer use thread suspension.
......
...@@ -2585,7 +2585,7 @@ int jio_vfprintf(FILE* f, const char *fmt, va_list args) { ...@@ -2585,7 +2585,7 @@ int jio_vfprintf(FILE* f, const char *fmt, va_list args) {
} }
int jio_printf(const char *fmt, ...) { JNIEXPORT int jio_printf(const char *fmt, ...) {
int len; int len;
va_list args; va_list args;
va_start(args, fmt); va_start(args, fmt);
......
...@@ -1417,16 +1417,16 @@ JVM_GetHostName(char* name, int namelen); ...@@ -1417,16 +1417,16 @@ JVM_GetHostName(char* name, int namelen);
* BE CAREFUL! The following functions do not implement the * BE CAREFUL! The following functions do not implement the
* full feature set of standard C printf formats. * full feature set of standard C printf formats.
*/ */
int JNIEXPORT int
jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
int JNIEXPORT int
jio_snprintf(char *str, size_t count, const char *fmt, ...); jio_snprintf(char *str, size_t count, const char *fmt, ...);
int JNIEXPORT int
jio_fprintf(FILE *, const char *fmt, ...); jio_fprintf(FILE *, const char *fmt, ...);
int JNIEXPORT int
jio_vfprintf(FILE *, const char *fmt, va_list args); jio_vfprintf(FILE *, const char *fmt, va_list args);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册