If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Nullplugin doesn't work when symbols are hidden by default

RESOLVED DUPLICATE of bug 380984

Status

()

Core
Plug-ins
RESOLVED DUPLICATE of bug 380984
12 years ago
10 years ago

People

(Reporter: Biesinger, Unassigned)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

When gcc supports hiding all symbols by default, the null plugin and probably
all other in-tree plugins are broken, because they don't explicitly mark any
symbols as exported. Consequently, the plugin loading code does not find the
symbols it needs (NP_GetMimeDescription et al).
Created attachment 206731 [details] [diff] [review]
Patch to make the missing NP_* symbols visible

I've encountered this problem as well, and the attached patch fixes it for me on Fedora Core 4

Comment 2

12 years ago
Comment on attachment 206731 [details] [diff] [review]
Patch to make the missing NP_* symbols visible

It's not a good idea to mix the NSPR macros in with mozilla code: I suggest using NS_EXPORT_(type) here.
Attachment #206731 - Flags: review-
bsmedberg: this file is part of the plugin SDK, is it not?

Comment 4

12 years ago
Does the plugin SDK depend on NSPR but not mozilla?
does it depend on NSPR?

Comment 6

12 years ago
PR_VISIBILITY_DEFAULT sure does...
yeah, I think this patch is not good because of that

Comment 8

12 years ago
What about using NS_VISIBILITY_DEFAULT and then including "nscore.h" inside npupp.h? Would that work?
The question is, is the plugin SDK allowed to depend on NSPR and/or XPCOM?
ok, so, npapi.h already includes prtypes.h, so clearly the NSPR dependency is ok. please ignore my comments.

Comment 11

12 years ago
Created attachment 218752 [details] [diff] [review]
Updated patch for exporting plugin NP_* symbols

Compiled this on Unix / Windows / Mac (ppc/x86).
the comment is wrong... it's not the compiler that has the default visibility, it's mozilla's build system which uses a default visibility of hidden on certain compilers.

Updated

12 years ago
Attachment #218752 - Attachment is obsolete: true

Comment 13

12 years ago
Created attachment 220548 [details] [diff] [review]
Patch for exposing the plugin symbols, i.e. make symbols visibile

The previous patch did not really work well, so I've changed from using:

#undef  IMETHOD_VISIBILITY
#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT
...
#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN


to use:

NS_VISIBILITY_DEFAULT for each function that needs to be exposed.
this got fixed in bug 380984
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 380984
You need to log in before you can comment on or make changes to this bug.