Browse Source

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>
pull/7/head
aneejit1 3 months ago
parent
commit
b9448655a2
  1. 6
      sipgen/gencode.c

6
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\" "));

Loading…
Cancel
Save