Issue 9442 - OOO_STABLE_1_PORTS/X11+Aqua: remove all dependencies on dlcompat
Summary: OOO_STABLE_1_PORTS/X11+Aqua: remove all dependencies on dlcompat
Status: CLOSED FIXED
Alias: None
Product: porting
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: Mac Mac OS X, all
: P3 Trivial (vote)
Target Milestone: OOo 1.0.4
Assignee: fa
QA Contact: issues@porting
URL:
Keywords: merge_pending
Depends on:
Blocks:
 
Reported: 2002-11-22 08:45 UTC by fa
Modified: 2004-02-19 23:33 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
cd to SRCROOT/extensions, patch -p0 < /path/to/patchfile (12.46 KB, patch)
2002-11-22 08:58 UTC, fa
no flags Details | Diff
cd to SRC_ROOT/sysui, patch -p0 < /path/to/patchfile (9.51 KB, patch)
2002-11-22 08:59 UTC, fa
no flags Details | Diff
cd to SRC_ROOT/vcl, patch -p0 < /path/to/patchfile (8.23 KB, patch)
2002-11-22 08:59 UTC, fa
no flags Details | Diff
cd SRC_ROOT/setup2, patch -p0 < /path/to/patchfile (860 bytes, patch)
2002-11-25 23:17 UTC, fa
no flags Details | Diff
cd SRC_ROOT/setup2, patch -p0 < /path/to/patchfile. REPLACES 112202 PATCH. Removes dlopen()/dlsym() calls from the setup loader (5.01 KB, patch)
2003-02-26 07:53 UTC, fa
no flags Details | Diff
cd vcl; patch -p0 < vcl.OOO_STABLE_1_PORTS.050703.patch (495 bytes, patch)
2003-05-08 07:14 UTC, ed
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description fa 2002-11-22 08:45:05 UTC
There are relatively few dependencies on dlcompat in the source.  Therefore, I
have undertaken to remove them all and convert them to either osl_loadModule()
or to straight NSImage APIs where appropriate.  This means we will not have to
deal with dlopen() any more.
Comment 1 fa 2002-11-22 08:46:12 UTC
Modules requiring conversion:

bridges
extensions
setup2
sysui
vcl

Comment 2 fa 2002-11-22 08:58:38 UTC
Created attachment 3703 [details]
cd to SRCROOT/extensions, patch -p0 < /path/to/patchfile
Comment 3 fa 2002-11-22 08:59:02 UTC
Created attachment 3704 [details]
cd to SRC_ROOT/sysui, patch -p0 < /path/to/patchfile
Comment 4 fa 2002-11-22 08:59:27 UTC
Created attachment 3705 [details]
cd to SRC_ROOT/vcl, patch -p0 < /path/to/patchfile
Comment 5 fa 2002-11-22 09:01:19 UTC
Kevin & Ed,

Can you approve:
1)  extensions 112202
2)  sysui 112202 (____check xplat____)
3)  vcl 112202

Thanks,
Dan
Comment 6 khendricks 2002-11-22 14:26:24 UTC
Hi Dan, 
 
I looked at these and I don't see any problems: 
 
1. why not simply patch things so that everyone uses the osl sal lib 
functions instead of dlXXXX?  That would make the code the most 
portable? 
 
2.  Is there any difference between dlclose and oslunloadmodule we 
need to worry about here? 
 
I approve the changes but this is something that we really should 
think about fixing for everyone isn't it? 
 
Thanks, 
 
Kevin 
 
Comment 7 fa 2002-11-22 15:28:38 UTC
At least in the Mac version of dlcompat the dlclose() function calls "_fini()" and the dlopen() function calls "_init()".  I'm still not sure how I am going to handle this in this code, either to patch sal to do it and add the necessary symbol lookups and calls where osl_loadModule() isn't used, or to just add the necessary lookup/call everywhere that I have killed dlcompat for OS X.

In the end a separate call that does something like dlopen() and another for dlsym and dlclose() might have to be done for OS X if this proves an issue, just to keep the mess down and the code cleaner.

Dan
Comment 8 fa 2002-11-25 23:17:31 UTC
Created attachment 3753 [details]
cd SRC_ROOT/setup2, patch -p0 < /path/to/patchfile
Comment 9 fa 2002-11-25 23:18:01 UTC
setup2 patch stops building loader (which depends on dlopen() api) for
OS X entirely.  We don't use it anyway.

dAn
Comment 10 fa 2002-11-25 23:23:14 UTC
Patches committed to _PORTS.

Dan
Comment 11 khendricks 2002-11-26 12:49:34 UTC
Hi, 
 
According to Daniel's response (from the udk project) we can not 
simply replace the dlopen with the osl module load in the gcc3 
bridge code since it is used to get the current process handle to 
search for symbols for properly throwing exceptions. 
 
Specifically  
 
RTTI::RTTI() SAL_THROW( () ) 
    : m_hApp( dlopen( 0, RTLD_LAZY ) ) 
{ 
} 
 
invoking dlopen(0,RTLD_LAZY) seems to return the handle for the 
current process (library?). 
 
Here is what the Solaris man page says about this specific use: 
 
     If the value of pathname is 0, dlopen() provides a handle on 
     a  global  symbol object. This object provides access to the 
     symbols from an ordered set of  objects  consisting  of  the 
     original  program image file, together with any dependencies 
     loaded at program startup, and any objects that were  loaded 
     using  dlopen()  together  with the RTLD_GLOBAL flag. As the 
     latter set of objects can change during  process  execution, 
     the set identified by handle can also change dynamically. 
 
So we either need to keep dlcompat or extend the MacOSX version of 
oslloadModule to handle the special case of passing in a 0 for the 
name of the library. 
 
Hope this helps, 
 
Kevin 
 
Comment 12 fa 2002-11-26 14:37:21 UTC
Kevin,

I believe we can implement this using NSImage API or the dyld calls on
OS X.  I will investigate more.

Dan
Comment 13 fa 2003-02-26 07:53:10 UTC
Created attachment 4908 [details]
cd SRC_ROOT/setup2, patch -p0 < /path/to/patchfile.  REPLACES 112202 PATCH.  Removes dlopen()/dlsym() calls from the setup loader
Comment 14 fa 2003-02-26 07:54:48 UTC
setup2.nodlcompat 022603 patch REPLACES the previous 112202 patch.  The 022603 patch converts dlopen()/dlsym()/dlclose()/dlerr() calls mow/source/loader to NS Image calls for Mac OS X.

Please approve setup2.nodlcompat.OOO_STABLE_1_PORTS.022603.patch for commit to PORTS.

Dan
Comment 15 sander_traveling 2003-02-26 14:26:54 UTC
setup2.nodlcompat.OOO_STABLE_1_PORTS.022603.patch approved
Comment 16 fa 2003-03-27 00:42:44 UTC
See also Issue 12433 for the setup patches.

http://www.openoffice.org/issues/show_bug.cgi?id=12433

Dan
Comment 17 ed 2003-05-08 07:14:29 UTC
Created attachment 6077 [details]
cd vcl; patch -p0 < vcl.OOO_STABLE_1_PORTS.050703.patch
Comment 18 ed 2003-05-08 07:15:45 UTC
Added in new patch to vcl library to remove libdl dependency when linking libvcl for 
X11.  Linking is successful;  libdl should no longer be necessary for vcl after the 
xrender changes to use osl_* routines on OS X.
Comment 19 khendricks 2003-05-08 12:29:38 UTC
Hi, 
 
Completely MacOSX specific so approved. 
 
Kevin 
 
Comment 20 pavel 2003-11-23 13:42:53 UTC
Kevin already approved. What is the status?
Comment 21 fa 2004-02-19 23:33:03 UTC
Since Panther/OS X 10.3 has dlopen() functionality included, closing this issue.
Comment 22 fa 2004-02-19 23:33:24 UTC
closing