harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r440956 - in /incubator/harmony/enhanced/drlvm/trunk: build/make/components/vm/vmcore.xml build/make/deploy.xml vm/em/src/DrlEMImpl.cpp vm/vmcore/src/init/properties.cpp
Date Thu, 07 Sep 2006 03:02:21 GMT
Author: geirm
Date: Wed Sep  6 20:02:20 2006
New Revision: 440956

URL: http://svn.apache.org/viewvc?view=rev&rev=440956
Log:
First set of changes to make DRLVM work with the launcher
from the perspective of loading libraries and resolving
library dependencies.

Main problem was that all libraries were specified with full
path, and APR just passes through to dlopen(), which will not
respect LD_LIBRARY_PATH if a fully qualified path is used.

So these changes remove qualification - and we can now
depend on the Harmony launcher to establish LD_LIBRARY_PATH
with the proper directory.

It was necessary to also set the DRLVM-specific property
vm.boot.library.path to "" rather than directory of executable
not only for this purpose, but because given the DRLVM can be
instantiated in many ways, this seemed impractical.

Finally, build is slightly modified to create a libharmonyvm.so
rather than libvmcore.so as per the recent changes to the 
Harmony launcher.


Modified:
    incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
    incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml
    incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml?view=diff&rev=440956&r1=440955&r2=440956
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml Wed Sep  6
20:02:20 2006
@@ -34,7 +34,7 @@
                                               vm.encoder,
                                               vm.port, vm.hythr, vm.jthread" />
 
-        <property name="libname" value="vmcore" />
+        <property name="libname" value="harmonyvm" />
         <property name="outtype" value="shared" />
         <property name="src" location="${build.vm.home}" />
 

Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml?view=diff&rev=440956&r1=440955&r2=440956
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/deploy.xml Wed Sep  6 20:02:20 2006
@@ -37,8 +37,8 @@
         </em>
 
         <vmcore>
-            <static>bin:vmcore</static>
-            <shared>bin:vmcore</shared>
+            <static>bin:harmonyvm</static>
+            <shared>bin:harmonyvm</shared>
         </vmcore>
 
         <interpreter>

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?view=diff&rev=440956&r1=440955&r2=440956
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Wed Sep  6 20:02:20 2006
@@ -155,9 +155,23 @@
 std::string buildDefaultLibPath(const std::string& dll_name) {
     std::string library_path = vm_get_property_value("vm.boot.library.path");
 #ifdef PLATFORM_NT
-    std::string fullPath = library_path + "\\"+ dll_name+".dll";
+    std::string fullPath = dll_name + ".dll";
+    
+    if (!library_path.empty()) { 
+    	fullPath = library_path + "\\" + fullPath;
+    }
+    
 #else
-    std::string fullPath = library_path + "/lib" + dll_name + ".so";
+//  $$$ GMJ
+//
+//    std::string fullPath = library_path + "/lib" + dll_name + ".so";
+
+	std::string fullPath = "lib" + dll_name + ".so";
+	
+    if (!library_path.empty()) {
+  		fullPath = library_path + "/" + fullPath;
+    }
+    
 #endif
     return fullPath;
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp?view=diff&rev=440956&r1=440955&r2=440956
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/properties.cpp Wed Sep  6 20:02:20
2006
@@ -91,7 +91,7 @@
 
 
 
-#define API_DLL1 "vmcore"
+#define API_DLL1 "harmonyvm"
 #define API_DLL2 "hythr"
 #define API_DLL3 "hysig"
 #define API_DLL4 "hyprt"
@@ -105,8 +105,11 @@
 #define GC_DLL "gc"
 #define EM_DLL "em"
 
-// Compose a string of file names each of them beginning with path,
-// names separated by PORT_PATH_SEPARATOR
+/**
+ *  Compose a string of file names each of them beginning with path,
+ *  names separated by PORT_PATH_SEPARATOR.  If patch is NULL, no path
+ *  or separator willbe prefixed
+ */
 static char *compose_full_files_path_names_list(const char *path,
                                                 const char **dll_names,
                                                 const int names_number, 
@@ -119,7 +122,17 @@
         if (is_dll) {
             tmp = port_dso_name_decorate(tmp, prop_pool);
         }
-        tmp = port_filepath_merge(path, tmp, prop_pool);
+        
+        /*
+         *  if the path is non-null, prefix, otherwise do nothing
+         *  to avoid the problem of "/libfoo.so" when we don't want
+         *  a path attached
+         */
+         
+        if (path != NULL) { 
+	        tmp = port_filepath_merge(path, tmp, prop_pool);
+        }
+        
         full_name = apr_pstrcat(prop_pool, full_name, tmp, 
             (iii + 1 < names_number) ? PORT_PATH_SEPARATOR_STR : "", NULL);
     }
@@ -219,8 +232,14 @@
     };
     const char ** dll_files= em_dll_files;
     const int n_dll_files = sizeof(dll_files) / sizeof(char *);
+
+	/*
+	 *  pass NULL for the pathname as we don't want 
+	 *  any path pre-pended
+	 */
+
     char* path_buf = compose_full_files_path_names_list(
-            library_path, dll_files, n_dll_files, true);
+            NULL, dll_files, n_dll_files, true);
 
     assert(path_buf);
     add_pair_to_properties(*properties, "vm.em_dll", path_buf);
@@ -246,9 +265,16 @@
     if (NULL == p)
         DIE("Failed to determine executable directory");
     *p = '\0';
-    // vm.boot.library.path initialization, the value is the location of VM executable
-    add_pair_to_properties(properties, "vm.boot.library.path", base_path_buf);
+    
+    /*
+     *  vm.boot.library.path initialization, the value is the location of VM executable
+     * 
+     *  2006-09-06 gmj :  there's no reason to ever believe this is true given how the VM
can be 
+     *  launched in a mariad of ways, so just set to empty string.
+     */
+    add_pair_to_properties(properties, "vm.boot.library.path", "");
     TRACE( "vm.boot.library.path = " << base_path_buf);
+    
     // Added for compatibility with the external java JDWP agent
     add_pair_to_properties(properties, "sun.boot.library.path", base_path_buf);
     TRACE( "sun.boot.library.path = " << base_path_buf);
@@ -278,13 +304,25 @@
     };
     int n_api_dll_files = sizeof(api_dll_files) / sizeof(char *);
 
+
+	/*
+	 *  pass NULL for the pathname as we don't want 
+	 *  any path pre-pended
+	 */
     path_buf = compose_full_files_path_names_list(
-            base_path_buf, core_dll_files, n_core_dll_files, true);
+            NULL, core_dll_files, n_core_dll_files, true);
+
     add_pair_to_properties(properties, "vm.dlls", path_buf);
     TRACE( "vm.dlls = " << path_buf);
 
+	/*
+	 *  pass NULL for the pathname as we don't want 
+	 *  any path pre-pended
+	 */
+
     path_buf = compose_full_files_path_names_list(
-            base_path_buf, api_dll_files, n_api_dll_files, true);
+            NULL, api_dll_files, n_api_dll_files, true);
+
     add_pair_to_properties(properties, "vm.other_natives_dlls", path_buf);
     TRACE( "vm.other_natives_dlls = " << path_buf);
 



Mime
View raw message