diff options
author | aneejit1 <aneejit1@gmail.com> | 2022-05-07 16:15:00 +0000 |
---|---|---|
committer | aneejit1 <aneejit1@gmail.com> | 2022-05-09 21:20:54 +0000 |
commit | b9448655a28d8357dbed7d2a4f3171440703c0bf (patch) | |
tree | 704ada28f94e47adfd1a6f2228bb501fee3809d4 /sipgen | |
parent | c9762bd162d2c0c33fec1dc1bce2c5a70357d6c8 (diff) | |
download | sip4-tqt-b9448655a28d8357dbed7d2a4f3171440703c0bf.tar.gz sip4-tqt-b9448655a28d8357dbed7d2a4f3171440703c0bf.zip |
Ensure module initialisation is exported globally
The generated module initialisation function fails to export because of
the "-fvisibility-hidden" resulting in an import failure on missing
symbol. Alter the visibility of the initialisation function to "default"
to ensure that it winds up as "global" in the module binary.
Signed-off-by: aneejit1 <aneejit1@gmail.com>
Diffstat (limited to 'sipgen')
-rw-r--r-- | sipgen/gencode.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sipgen/gencode.c b/sipgen/gencode.c index 6c848a4..0a9bc41 100644 --- a/sipgen/gencode.c +++ b/sipgen/gencode.c @@ -2324,12 +2324,18 @@ static void generateModInitStart(moduleDef *mod, int gen_c, FILE *fp) "#define SIP_MODULE_RETURN(r) return\n" "#endif\n" "\n" +"#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)\n" +"#pragma GCC visibility push(default)\n" +"#endif\n" "#if defined(SIP_STATIC_MODULE)\n" "%sSIP_MODULE_TYPE SIP_MODULE_ENTRY()\n" "#else\n" "PyMODINIT_FUNC SIP_MODULE_ENTRY()\n" "#endif\n" "{\n" +"#if (defined(__GNUC__) && __GNUC__ >= 4) || defined(__clang__)\n" +"#pragma GCC visibility pop\n" +"#endif\n" , mod->name , mod->name , (gen_c ? "" : "extern \"C\" ")); |