8034025: Remove JPLIS agent dependency on canonicalize_md.c

Reviewed-by: alanb
This commit is contained in:
Staffan Larsen 2014-03-07 09:18:15 +01:00
parent 67810b5cb5
commit 863c6daf9e
4 changed files with 15 additions and 13 deletions

View File

@ -203,7 +203,6 @@ BUILD_LIBRARIES += $(BUILD_LIBJSDT)
##########################################################################################
LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/share/instrument \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument
LIBINSTRUMENT_FILES := \
@ -218,9 +217,8 @@ LIBINSTRUMENT_FILES := \
JavaExceptions.c \
PathCharsValidator.c \
Reentrancy.c \
Utilities.c \
canonicalize_md.c
Utilities.c
LIBINSTRUMENT_DIR := $(JDK_OUTPUTDIR)/objs/libinstrument
LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
-I$(JDK_TOPDIR)/src/share/instrument \
@ -239,6 +237,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS))
# equivalent of strcasecmp is stricmp on Windows
LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
else
LIBINSTRUMENT_LDFLAGS_SUFFIX := -ljava
endif
$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \

View File

@ -65,9 +65,3 @@ int isAbsolute(const char * path);
* Resolve the child pathname string against the parent.
*/
char* resolve(const char* parent, const char* child);
/**
* Convert a pathname to canonical form.
* -- compiled in from src/<platform>/native/java/io/canonicalize_md.c
*/
int canonicalize(char *original, char *resolved, int len);

View File

@ -669,6 +669,13 @@ appendClassPath( JPLISAgent* agent,
jplis_assert((void*)res != (void*)NULL); \
}
/**
* Convert a pathname to canonical form.
* This method is exported from libjava.
*/
extern int
Canonicalize(JNIEnv *unused, char *orig, char *out, int len);
/*
* This function takes the value of the Boot-Class-Path attribute,
@ -790,7 +797,8 @@ appendBootClassPath( JPLISAgent* agent,
char* resolved;
if (!haveBasePath) {
if (canonicalize((char*)jarfile, canonicalPath, sizeof(canonicalPath)) != 0) {
/* Use NULL as the JNIEnv since we know that Canonicalize does not use it. */
if (Canonicalize(NULL, (char*)jarfile, canonicalPath, sizeof(canonicalPath)) != 0) {
fprintf(stderr, "WARNING: unable to canonicalize %s\n", jarfile);
free(path);
continue;

View File

@ -834,12 +834,12 @@ JNU_ReleaseStringPlatformChars(JNIEnv *env, jstring jstr, const char *str)
/*
* Export the platform dependent path canonicalization so that
* VM can find it when loading system classes.
*
* This function is also used by the instrumentation agent.
*/
extern int canonicalize(char *path, const char *out, int len);
JNIEXPORT int
Canonicalize(JNIEnv *env, char *orig, char *out, int len)
Canonicalize(JNIEnv *unused, char *orig, char *out, int len)
{
/* canonicalize an already natived path */
return canonicalize(orig, out, len);