From b9448655a28d8357dbed7d2a4f3171440703c0bf Mon Sep 17 00:00:00 2001 From: aneejit1 Date: Sat, 7 May 2022 16:15:00 +0000 Subject: 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 --- sipgen/gencode.c | 6 ++++++ 1 file changed, 6 insertions(+) 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\" ")); -- cgit v1.2.1