Closed Bug 37025 Opened 24 years ago Closed 24 years ago

nsPluginsDirUNIX.cpp does not build due to dlopen() flags.

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86
OSF/1
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jim_nance, Assigned: hoa.nguyen)

References

()

Details

Attachments

(2 files)

nsPluginsDirUNIX.cpp does not build under Tru64 Unix because the
RTLD_GLOBAL flag that it passes do dlopen() is not defined on
that platform.  We really should be using PL_LoadLibrary() instead
of dlopen() if that is possible.

I have a temp fix for the alpha that defines RTLD_GLOBAL as 0 if
its not defined.  I am going to check that in, but we really should
fix this properly.  I did not want to remove the dlopen() calls
myself since there may be a reason they need to be there and I
do not know how to test it.
I added explicit dlopens for libXt.so and libXext.so since the main Mozilla
source doesn't normally link to these librarys, and the dlopen on a legacy
plug-in will fail if these symbols are not present.

I found that just linking to the librarys didn't do the trick if none of the
Mozilla code every attempts to use any of the Xt calls, but explicitly 
dlopen'ing the library (and specifying that the library symbols should be made
global) work fine.

Calling dlopen instead of the NSPR wrapped dlopen was just an oversite.
The above patch uses the NSPR functions to open a shared library and globaly
share it's symbols.  I'm sure it's safe, but I would like someone with a Tru64
Unix system to try it out.  
I tried it on a Tru64 system, and it does not compile.  Its looks like a const
problem:

nsPluginsDirUNIX.cpp
cxx: Error: /scratch/jlnance/mozilla/modules/plugin/nglsrc/nsPluginsDirUNIX.cpp,
line 153:
          argument of type "const char *" is incompatible with parameter of
          type "void *"
    PR_FREEIF(tempSpec.value.pathname);
----^
cxx: Error: /scratch/jlnance/mozilla/modules/plugin/nglsrc/nsPluginsDirUNIX.cpp,
line 158:
          argument of type "const char *" is incompatible with parameter of
          type "void *"
    PR_FREEIF(tempSpec.value.pathname);
----^
cxx: Info: 2 errors detected in the compilation of "/scratch/jlnance/mozilla/mod
Jim, can you fix up a patch that does work?  I think that you have access to at
least digital unix and linux systems to test on.
Sure, I will be glad to put something together based on rusty's patch
Attached patch The patch!Splinter Review
Bet yall thought I would never get this done :-)  Here it is.  Its basically
rusty's patch, but I realized that we dont really need to allocate memory
for the strings, which is what was leading to the compile problem in in
the first place.  Can someone review this for me?
the patch works for me.  What do you think, Chris? Can I check it in?
Yep, looks good to me.
I will let rusty check this in then unless he wants me to do it.

I went ahead and checked it in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
*** Bug 41112 has been marked as a duplicate of this bug. ***
verif that the fix is in.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: