[vmkit-commits] [PATCH] Use version script to make OpenJDK's symbol versioning req's happy

Will Dietz wdietz2 at illinois.edu
Tue Oct 25 17:29:55 PDT 2011


Inlined below.

OpenJDK's libjava.so refuses to load without the symbols it wants
having the proper versions, and this patch addresses that.

This is kinda lame, but a)other VM's such as CACAO do this ("all the
cool kids are doing it"), and b)I'm not sure what other options we
have.

As for b), I've chatted with OpenJDK guys on the topic and matching
their versioning seemed the best/only way to go.

Only other method I've found (besides asking users to build a special
OpenJDK build without the versioning) is in JamVM--which does
something different that I don't understand.  It seems to rely on
loading *both* libjvm's--and using one to resolve the symbols and the
other to satisfy the versioning requirement but not actually use those
symbols.  As I said, I'm not sure how that works, so for now this
seems the best bet.

~Will

>From 39d08a0d277d6e170446af46b41f5c7fac8bb257 Mon Sep 17 00:00:00 2001
From: Will Dietz <w at wdtz.org>
Date: Fri, 14 Oct 2011 11:38:38 -0500
Subject: [PATCH 2/3] Use version script to make OpenJDK's symbol versioning
 req's happy.

---
 tools/jvm/Makefile |    1 +
 tools/jvm/mapfile  |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 tools/jvm/mapfile

diff --git a/tools/jvm/Makefile b/tools/jvm/Makefile
index 88b7303..9a62a11 100644
--- a/tools/jvm/Makefile
+++ b/tools/jvm/Makefile
@@ -20,3 +20,4 @@ include $(LEVEL)/Makefile.common

 USEDLIBS_FULL = $(addprefix $(LibDir)/lib,$(USEDLIBS))
 LDFLAGS += -Wl,-whole-archive $(USEDLIBS_FULL) -Wl,-no-whole-archive
+LDFLAGS += -Wl,--version-script=$(PROJ_SRC_DIR)/mapfile
diff --git a/tools/jvm/mapfile b/tools/jvm/mapfile
new file mode 100644
index 0000000..fd02db7
--- /dev/null
+++ b/tools/jvm/mapfile
@@ -0,0 +1,5 @@
+SUNWprivate_1.1 {
+global:
+  JVM_*;
+  jio_*;
+};
-- 
1.7.5.1



More information about the vmkit-commits mailing list