summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/os/NativeLibrary.java
Commit message (Collapse)AuthorAgeFilesLines
* NativeLibrary.enumerateLibraryPaths(): Reduce relative/absolute path mapping ↵Sven Gothel2023-01-231-9/+12
| | | | to 'java.library.path', others are absolute
* NativeLibrary.enumerateLibraryPaths(): Using addPaths() ensures given 'path' ↵Sven Gothel2023-01-231-14/+51
| | | | | | is being resolved as absolute-canonical as required for System.load*() Further, detailed DEBUG messages are added on -Djogamp.debug.NativeLibrary
* NativeLibrary: Add getSystemEnvLibraryPaths(), i.e. LD_LIBRARY_PATH, PATH, ↵Sven Gothel2023-01-231-0/+35
| | | | .. content
* Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-141-5/+5
|
* Bug 1363: Java 11: Complete renaming JEP 178 compatible native lib basename ↵Sven Gothel2019-08-181-1/+1
| | | | | | | | | | gluegen-rt -> gluegen_rt - Fix finding native library for Elf parsing - Fix one unit test - Fix comments Completes commit 330dad069dee5a0cc0480cf5cd9052000004223a
* MacOS shall only scan for .dylib, dropping .jnilib search in NativeLibrarySven Gothel2019-08-181-5/+0
|
* iOS: NativeLibrary: Refine iOS, use proper alt system path for iOS+OSX, ↵Sven Gothel2019-06-211-27/+37
| | | | relax closeLibrary(..)
* Bug 1363: Java 11: Recognize Java9+ ..; Support JEP 178 static linkage ↵Sven Gothel2019-06-171-0/+3
| | | | | | | | | | | | | | | | | | | | | libgluegen-rt[.so] -> libgluegen_rt[.so|.a] Recognize Java9+ .. - Recognize new Java9+ version string as of JEP 223 - Avoid Classpath's private findLibrary call +++ Support JEP 178 static linkage (OpenJDK 1.8) - Need to change native library basename: libgluegen-rt[.so] -> libgluegen_rt[.so|.a] since the dash '-' is not supported in a ANSI-c function name. - Added 'JNI_OnLoad_gluegen_rt' to recognize statical linked JNI code - Added JNI_VERSION_1_8 to jni/jni.h
* iOS: Initial iOS support commit: build.xml targets, java code-path etcSven Gothel2019-06-171-1/+4
| | | | | | | | | | | | Current build system for JogAmp iOS Build is: - Build Machine: OSX Mojave 10.14 - Using own (still proprietary) OpenJDK 9 iOS Build - OpenJDK 1.8 (This will be replaced by OpenJDK 11 soon) - Xcode 10.2
* Bug 1367: Make TempFileCache & TempJarCache even if temp folder can't handle ↵Sven Gothel2019-04-031-1/+1
| | | | executables
* Bug 1268 - DynamicLibraryBundleInfo: Add NativeLibrary's 'searchSystemPath' ↵Sven Gothel2015-11-151-30/+41
| | | | | | | | | | | and 'searchSystemPathFirst' attributes NativeLibrary can be instantiate by defining 'searchSystemPath' and 'searchSystemPathFirst' arguments, allowing to specify the system path role while looking up the library. Since NativeLibrary is utilized via DynamicLibraryBundleInfo upstream, the latter interface shall allow users to specify those attributes.
* Bug 1194: Reinstate system-lib search for NativeLibrary.open(..) and ↵Sven Gothel2015-08-181-5/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PlatformPropsImpl.findSysLib(..). This patch partially reverts of commit d12e4d4ea279998b27457691038e709879dcaca6. NativeLibrary.open(..) requires search of system libraries, since it loads the actual 'tool library' for which we generate the JNI binding. The 'tool library' is preferably the system wide installed version, e.g. libGL.so etc. PlatformPropsImpl.findSysLib(..) also requires finding system libraries as needed for PlatformPropsImpl.queryElfFile(..), i.e. using libjava.so etc. Only the JNI 'glue library', glueing java calls to the 'tool library', shall not use the system wide library search since we shall only use JogAmp provided instances here. This patch also reinstates binary compatibility w/ prev. GlueGen JARs since NativeLibrary.enumerateLibraryPath(..) is public. +++ Further more 'NativeLibrary.enumerateLibraryPath(..)' now adds OSX system framework search _before_ the user path in case 'searchSystemPath && searchSystemPathFirst'. Original code always added this search to the end, which does not match the intended behavior (-> bug).
* Merge branch 'bug1194' of https://github.com/xranby/gluegenSven Gothel2015-08-181-46/+4
|\ | | | | | | | | | | | | Conflicts: src/java/com/jogamp/common/os/NativeLibrary.java Due to commit for Bug 1145, bf4d8786cb732d86db333b43020ecf0af27f60bf
| * Bug 1194: NativeLibrary: Remove dangerous search paths using the JRE ↵Xerxes Rånby2015-08-121-46/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extension mechanism NativeLibrary: API change: Removed searchSystemPathFirst argument to the open and enumerateLibraryPaths methods. Removed the generic sun.boot.library.path system path and the MacOS specific Frameworks paths from enumerateLibraryPaths. JNILibLoaderBase, PlatformPropsImpl & TestElfReader01: Updated to handle the NativeLibrary API change. This change will prevent JogAmp modules to pickup and load unsupported and old SUN JOGL 1 natives that may have been deployed with the JRE.
* | Bug 1145: Fix cc1 NativeLibrary: Add current working directory + ↵Xerxes Rånby2015-08-121-0/+4
|/ | | | | | natives/os-arch/ + library names Fixes Bug 1145 cc1 when using an unpacked fat-jar
* Minor Cleanup: Buffers: Remove !JAVA_6 branch; NativeLibrary: Reuse isOSX ↵Sven Gothel2015-02-011-16/+8
| | | | detection
* Refine Native Library Code: Bulk Permissions, Cleanup DynamicLinker impl. - ↵Sven Gothel2015-01-301-27/+68
| | | | | | | | | | | | | | | and fix Android AArch64 BionicDynamicLinker (Bug 1122) - Bulk Permissions ProcAddressTable.reset(..) performs address lookup in one block. Now claiming all permissions upfront once, and releasing them afterwards. - Cleanup DynamicLinker impl. Proper top-down impl. of DynamicLinkerImpl, handling all security code and validations. - Fix Android AArch64 BionicDynamicLinker (Bug 1122) Dalvik uses diff RTLD_* defines for AArch64!
* Refine ExceptionUtils: Shorten method name, dumpThrowable uses dumpStackSven Gothel2014-10-261-1/+2
|
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-40/+40
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Fix 'typo' in messages: 'Catched' -> 'Caught'Sven Gothel2014-06-281-1/+1
|
* gluegen: add all missing @Override annotationsHarvey Harrison2013-10-171-0/+5
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-171-29/+29
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Security: Tighten DynamicLinker*, NativeLibrary and DynamicLibraryBundle ↵Sven Gothel2013-06-211-26/+1
| | | | | | | | | | | | | | | | | | | | | | access (2) - Completes 23341a2df2d2ea36784a16fa1db8bc7385351a12 - Replace 'DynamicLinker' interface w/ well documented one - All DynamicLinker methods are now considered secure, i.e.: - open/lookup and close utilize reference counting on handle via a hash map. - lookupSymbol(..) and close(..) impl. validate the passed library handle whether it's retrieved via open*. This is the fast path, not that expensive. - lookupSymbolGlobal(..) performs Check acccess of 'new RuntimePermission("loadLibrary.*")' if SecurityManager is installed. This is the slow path. - DynamicLibraryBundleInfo now reflects the security requirements, i.e. whether priviledged access is needed.
* DynamicLookupHelper: Add secure isFunctionAvailable(..); NativeLibrary: Add ↵Sven Gothel2013-06-201-10/+53
| | | | TODO comments, re protected lookup functions.
* Security: Tighten DynamicLinker*, NativeLibrary and DynamicLibraryBundle access.Sven Gothel2013-06-201-33/+33
|
* Refine 4feb65517ae4a4e2b9b04cdfc4b85582cb8b9784: Handle verbose error cases ↵Sven Gothel2013-06-181-26/+31
| | | | post catch block, i.e. exception (if occured) and dlerror value.
* Robostness: Catch Throwables on NativeLibrary.open(..) and be verbose in ↵Sven Gothel2013-06-181-6/+19
| | | | DEBUG mode ; DynamicLinker: Add 'String getLastError()'.
* Fix DynamicLinker Impl: Add Bionic specialization using Bionic's non POSIX ↵Sven Gothel2013-06-161-1/+7
| | | | | | | | | | | | | | | values; Using same pattern for Mac OS X. Add Bionic specialization using Bionic's non POSIX values - derive from UnixDynamicLinkerImpl - specify own flag and mode values - use UnixDynamicLinkerImpl native code Using same pattern for Mac OS X - derive from UnixDynamicLinkerImpl - specify own flag and mode values - use UnixDynamicLinkerImpl native code - drop MacOSXDynamicLinkerImpl native code
* Fix Bug 683 part1: IOUtil, JarUtil, TempJarCache, .. uses URI instead of URL ↵Sven Gothel2013-06-091-2/+13
| | | | to remove DNS Lookups etc ..
* gluegen: remove executable bit from java and c source filesHarvey Harrison2013-04-091-0/+0
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Bug 681: Add Elf Parsing for other OS than Linux, if ARM and !ANDROID using ↵Sven Gothel2013-02-091-14/+40
| | | | | | | | /proc/self/exe (Linux) or a found java/jvm native lib. - PlatformPropsImpl.queryABITypeImpl: Check Elf Header for ARM + !ANDROID (i.e. add other OS than Linux, use native java/jmv lib) - NativeLibrary.enumerateLibraryPaths: Add 'sun.boot.library.path' to enumeration! - TestElfReader01: Add test for finding java/jvm native lib and parse it
* GlueGen: NativeLibrary Fix, JNILibLoaderBase EnhancementSven Gothel2013-01-301-48/+64
| | | | | | | | | | | | | | | | | | | - NativeLibrary Fix - enumerateLibraryPaths(..): - Properly iterate through all prefix _and_ suffix. - Make public for JNILibLoaderBase.loadLibraryInternal(..) - isValidNativeLibraryName(..): - Stop iterating through prefix, if previously found but suffix doesn't match. - JNILibLoaderBase.loadLibraryInternal(..) Enhancement - Mark customLibLoader FIXME: remove (we will get rid of jnlp.launcher.class) - If System.load(TempJarCache) and System.loadLibrary(plainLibName) fails, use NativeLibrary.enumerateLibraryPaths() w/ System.load(..) as last resort. Tested on Linux x86_64 Java6 and OSX Java7 manually, no regressions expected.
* Fix Bug 608: Push down TempJarCache.findLibrary(..) from ↵Sven Gothel2012-10-251-3/+14
| | | | | | | JNILibLoaderBase.loadLibraryInternal() to NativeLibrary.findLibrary(..) This allows using TempJarCache (if used/initialized) for native 'tool' libraries as well. This is the case of JOAL's attempt to load the provided 'libopenal.so'
* Fix Platform static initialization interdependencies w/ GlueGen native ↵Sven Gothel2012-06-181-5/+6
| | | | | | | | | | | | library loading Some Platform field declarations and it's static initialization has been delegated to it's new abstract super class PlatformPropsImpl to solve static initialization interdependencies w/ the GlueGen native library loading and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..<br> This mechanism is preferred in this case to avoid synchronization and locking and allow better performance accessing the mentioned fields/methods.
* Use ClassLoader to find JNI native libraries. ClassLoader was only used for ↵Sven Gothel2012-05-041-6/+11
| | | | | | | | | | | tool native libraries. NativeLibrary: Expose 'String findLibrary(String libName, ClassLoader loader)', allowing utilization of System.load(loader.findLibrary(libName)). JNILibLoaderBase.loadLibrary(): Add optional ClassLoader argument, used to locate the library DynamicLibraryBundle: Use DynamicLibraryInfo's ClassLoader to find native libraries (tool + jni)
* DynamicLibraryBundle (enhancement)Sven Gothel2012-02-121-4/+1
| | | | | | | - Hold DEBUG, DEBUG_LOOKUP in DynamicLookupHelper - Tool complete only if named tool's GetProcAddressFunc is avail - Allow no tool/glue lib's - Use DEBUG_LOCKUP for lockup symbol trace
* Fix regression of commit b669435d277a10e6163034aba286ecccce013f69, which ↵Sven Gothel2011-12-181-7/+14
| | | | removed the lib-base-name search for OSX
* NativeLibrary DEBUG: stack trace @ close()Sven Gothel2011-12-011-0/+1
|
* DynamicLibraryBundle/NativeLibrary: Add destroy() to bundle, causing ↵Sven Gothel2011-12-011-10/+20
| | | | unloading of native library.
* NativeLib: Fix OSX lib name detection; JarUtil extract: at copy entry, mkdir ↵Sven Gothel2011-09-241-2/+2
| | | | of parent if !exist
* gluegen-rt lib loading: Moved to Platform static init incl. ↵Sven Gothel2011-09-221-2/+1
| | | | | | | | | | | | | | | | TempJarCache.bootstrapNativeLib(..) usage - Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform - TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file. Interesting here is that when using Oracle's JRE w/ Applets/JNLP the current dbg output is: gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/ gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/ gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e IE the JRE implementation already deduces the online link to the Applet/JNLP cache. This makes the implementation much simpler, ie. same for application and Applets/JNLP. Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
* Unify JNI Library Loading into JNILibLoaderBase and use it for the ↵Sven Gothel2011-09-211-2/+2
| | | | | | | | gluegen-rt native lib as well - removed redundance - move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase - prepares for new JAR temp cache ..
* Remove redundant: NativeLibrary.ensureNativeLibLoaded()Sven Gothel2011-09-201-14/+3
|
* Enhancement/GenericStyle:Sven Gothel2011-09-191-22/+49
| | | | | | | | | | | | | | | | | | - NativeLibrary: - add isValidNativeLibraryName(..) - generic style - Platform - add getOSAndArch(), getOSAndArch(..) - IOUtil - add getClassFileName(..) - add getBasename(..) - add getDirname(..) - added doc - ReflectionUtil - generic style
* Hide DynamicLinker impl.; Remove public AndroidPackageUtil ; ↵Sven Gothel2011-08-031-0/+4
| | | | | | | GluegenVersionActivity uses ApplicationContext Hide DynamicLinker impl.: - com.jogamp.common.os.*DynamicLinkerImpl -> jogamp.common.os
* Fix regression (commit f733203dfbd034a6b1aa3eb2cd616437c982c435): Init of ↵Sven Gothel2011-07-221-2/+3
| | | | DEBUG and DEBUG_LOOKUP was removed, re-added.
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-171-36/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, ..
* DoubleCheckLocking: Added 'ok' comment - volatile varSven Gothel2011-02-261-1/+1
|
* RecursiveLock: static field -> final; NativeLibrary: cleanupSven Gothel2011-02-261-6/+5
|
* Debug: out -> err streamSven Gothel2010-12-131-4/+4
|