From 94f5888f971f544759b52fb6d02a2d6727f91087 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 7 Dec 2013 18:49:23 -0700 Subject: [PATCH] prevent openjdk-src build from trying to load the installed 'JavaRuntimeSupport' (fixes #128) --- makefile | 9 ++++++--- openjdk-patches/java_props_macosx.c.patch | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 openjdk-patches/java_props_macosx.c.patch diff --git a/makefile b/makefile index 803a56a797..f128d3e1f5 100755 --- a/makefile +++ b/makefile @@ -220,9 +220,9 @@ ifneq ($(android),) $(platform-lflags) \ -lstdc++ -ifeq ($(platform),linux) - classpath-lflags += -lrt -endif + ifeq ($(platform),linux) + classpath-lflags += -lrt + endif classpath-objects = \ $(call cpp-objects,$(luni-cpps),$(luni-native),$(build)) \ @@ -1970,6 +1970,9 @@ ifeq ($(ios),true) < "$(openjdk-src)/solaris/native/java/lang/UNIXProcess_md.c" \ > $(build)/openjdk/UNIXProcess_md.c endif + if [ -f openjdk-patches/$(notdir $(<)).patch ]; then \ + ( cd $(build) && patch -p0 ) < openjdk-patches/$(notdir $(<)).patch; \ + fi $(cc) -fPIC $(openjdk-extra-cflags) $(openjdk-cflags) \ $(optimization-cflags) -w -c $(build)/openjdk/$(notdir $(<)) \ $(call output,$(@)) -Wno-return-type diff --git a/openjdk-patches/java_props_macosx.c.patch b/openjdk-patches/java_props_macosx.c.patch new file mode 100644 index 0000000000..42622f6fda --- /dev/null +++ b/openjdk-patches/java_props_macosx.c.patch @@ -0,0 +1,15 @@ +--- openjdk/java_props_macosx.c ++++ openjdk/java_props_macosx.c +@@ -37,11 +37,7 @@ + + // need dlopen/dlsym trick to avoid pulling in JavaRuntimeSupport before libjava.dylib is loaded + static void *getJRSFramework() { +- static void *jrsFwk = NULL; +- if (jrsFwk == NULL) { +- jrsFwk = dlopen("/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/JavaRuntimeSupport", RTLD_LAZY | RTLD_LOCAL); +- } +- return jrsFwk; ++ return NULL; + } + + static char *getPosixLocale(int cat) {