From 9ddb1a12332cd1ac528b1e25d2414dbfe2088811 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 5 Nov 2018 21:49:59 +0200 Subject: Check explicitly for function names and link directly to them on iOS When building the iOS app with optimisation (using the Release configurtaion), the linker will not include functions even if they have been marked with __attribute__ ((visibility("default"))). To get such a function included, you need an actual reference to it. Sure, I could probably do some other trick instead. Or I could use a table and loop here instead of a sequence of if statements. Later. Change-Id: I86fa38838f242fd1ac251da6e3885f5b166963d3 --- vcl/source/window/builder.cxx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 6be921bff169..b4c38ca77d30 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1488,6 +1489,15 @@ void VclBuilder::preload() #endif // DISABLE_DYNLOADING } +#if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP + +VCL_BUILDER_FACTORY_EXTERN(CustomPropertiesControl); +VCL_BUILDER_FACTORY_EXTERN(RefButton); +VCL_BUILDER_FACTORY_EXTERN(RefEdit); +VCL_BUILDER_FACTORY_EXTERN(ScRefButtonEx); + +#endif + VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OString &name, const OString &id, stringmap &rMap) { @@ -2040,12 +2050,22 @@ VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OString & } else pFunction = reinterpret_cast(aI->second->getFunctionSymbol(sFunction)); +#elif !HAVE_FEATURE_DESKTOP + if (false) + ; // Just so that all the other condition line pairs look the same + else if (sFunction == "makeCustomPropertiesControl") + pFunction = makeCustomPropertiesControl; + else if (sFunction == "makeRefButton") + pFunction = makeRefButton; + else if (sFunction == "makeRefEdit") + pFunction = makeRefEdit; + else if (sFunction == "makeScRefButtonEx") + pFunction = makeScRefButtonEx; + + SAL_WARN_IF(!pFunction, "vcl.layout", "Missing case for " << sFunction); + assert(pFunction); #else pFunction = reinterpret_cast(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData)); -#if !HAVE_FEATURE_DESKTOP - SAL_WARN_IF(!pFunction, "vcl.layout", "Lookup of " << sFunction << " failed"); - assert(pFunction); -#endif #endif if (pFunction) { -- cgit v1.2.3