[PATCH 1/4] dlopen: switch to new pathfinder class

2016-08-31 Thread Michael Haubenwallner
Instead of find_exec, without changing behaviour use new pathfinder class with new allocator_interface around tmp_pathbuf and new vstrlist class. * pathfinder.h (pathfinder): New file. * vstrlist.h (allocator_interface, allocated_type, vstrlist): New file. * dlfcn.cc (dlopen): Avoid redundant GetMo

[PATCH 3/4] dlopen: on x/lib search x/bin if exe is in x/bin

2016-08-31 Thread Michael Haubenwallner
citing https://cygwin.com/ml/cygwin-developers/2016-08/msg00020.html > Consider the file /usr/bin/cygz.dll: > - dlopen (libz.so)success > - dlopen (/usr/bin/libz.so) success > - dlopen (/usr/lib/libz.so) fails * dlfcn.c (dlopen): For dlopen("x/lib/N"), when the application executab

[PATCH 0/4] dlopen: improving the search algorithm

2016-08-31 Thread Michael Haubenwallner
Hi Corinna, based on the discussion on -developers list [1][2], here's a reworked set of patches for dlopen, split along these features and fixes. [1] https://cygwin.com/ml/cygwin-developers/2016-06/msg0.html [2] https://cygwin.com/ml/cygwin-developers/2016-08/msg0.html *) Switch to path

[PATCH 4/4] dlopen: on unspecified lib dir search exe dir

2016-08-31 Thread Michael Haubenwallner
Applications installed to some prefix like /opt/application do expect dlopen("libAPP.so") to load "/opt/application/bin/cygAPP.dll", which is similar to "/opt/application/lib/libAPP.so" on Linux. See also https://cygwin.com/ml/cygwin-developers/2016-08/msg00020.html * dlfcn.cc (dlopen): For dlope

[PATCH 2/4] dlopen (pathfinder): try each basename per dir

2016-08-31 Thread Michael Haubenwallner
Rather than searching all search dirs per one basename, search for all basenames within per one search dir. pathfinder.h (check_path_access): Interchange dir- and basename-loops. --- winsup/cygwin/pathfinder.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/winsup

Re: [PATCH 1/4] dlopen: switch to new pathfinder class

2016-08-31 Thread Corinna Vinschen
Hi Michael, On Aug 31 20:07, Michael Haubenwallner wrote: > Instead of find_exec, without changing behaviour use new pathfinder > class with new allocator_interface around tmp_pathbuf and new vstrlist > class. > * pathfinder.h (pathfinder): New file. > * vstrlist.h (allocator_interface, allocated_