On 24.03.2011 15:41, Alan Bateman wrote:
> Matthias Klose wrote:
>> :
>>
>>> Just wondering if the setup of the
>>> search path (in os::init_system_properties_values would be better place to 
>>> do
>>> consider this).
>>>     
>>
>> DEFAULT_LIBPATH is only used in os::init_system_properties_values.
>>
>>   
> Right, but it's where the search path is setup and the result becomes the 
> value
> of java.library.path. I might not understand multiarch yet but wouldn't this 
> be
> the place to include the x86_64 or i386 directories to be searched?

yes, if your goal is to limit the scope of this change. Here is what I'm
currently testing (note that /usr/lib/jni is unrelated, required by Debian's
Java Policy).

  Matthias

--- openjdk/hotspot/make/linux/makefiles/vm.make~       2011-03-24 
14:21:07.213057001 +0100
+++ openjdk/hotspot/make/linux/makefiles/vm.make        2011-03-24 
14:32:03.443056676 +0100
@@ -99,6 +99,11 @@
 CPPFLAGS += -DDISTRIBUTION_ID="\"$(DISTRIBUTION_ID)\""
 endif
 
+DEB_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || 
true)
+ifneq (,$(DEB_MULTIARCH))
+CPPFLAGS += -DDEB_MULTIARCH="\"$(DEB_MULTIARCH)\""
+endif
+
 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 CFLAGS += $(CFLAGS_WARN/BYFILE)
 
--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp~       2011-03-24 
14:21:07.503057001 +0100
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp        2011-03-24 
14:38:06.443059044 +0100
@@ -352,7 +352,11 @@
  *        ...
  *        7: The default directories, normally /lib and /usr/lib.
  */
+#ifdef DEB_MULTIARCH
+#define DEFAULT_LIBPATH        "/usr/lib/jni/" DEB_MULTIARCH ":/lib/" 
DEB_MULTIARCH ":/usr/lib/" DEB_MULTIARCH ":/usr/lib/jni:/lib:/usr/lib"
+#else
 #define DEFAULT_LIBPATH        "/usr/lib/jni:/lib:/usr/lib"
+#endif
 
 #define EXTENSIONS_DIR  "/lib/ext"
 #define ENDORSED_DIR    "/lib/endorsed"

Reply via email to