Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 7d010ab

Browse files
author
Fraser J. Gordon
committed
Use appropriate symbol visibility for iOS engines
1 parent d66d62e commit 7d010ab

File tree

12 files changed

+30
-21
lines changed

12 files changed

+30
-21
lines changed

engine/engine-mobile.xcodeproj/project.pbxproj

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,6 +2173,7 @@
21732173
4DD3DD971040AA9A00CAC7EF /* Frameworks */,
21742174
F670DB65147D45A5008FEA1E /* CopyFiles */,
21752175
4DBF5B5B1802E7C1009CAB2E /* Copy revsecurity */,
2176+
729D0F9B1A6FEA3000B0CA0F /* ShellScript */,
21762177
);
21772178
buildRules = (
21782179
);
@@ -2371,7 +2372,7 @@
23712372
);
23722373
runOnlyForDeploymentPostprocessing = 0;
23732374
shellPath = /bin/sh;
2374-
shellScript = "if [ -e $PLATFORM_DEVELOPER_BIN_DIR/g++ ]; then\n BIN_DIR=$PLATFORM_DEVELOPER_BIN_DIR\nelse\n BIN_DIR=$DEVELOPER_BIN_DIR\nfi\n\nif [ $CONFIGURATION = \"Debug\" ]; then\n $BIN_DIR/g++ -ObjC -nodefaultlibs -nostartfiles -Wl,-r -arch ${ARCHS//\\ /\\ -arch\\ } -isysroot $SDKROOT -o \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext\" \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME\" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,\"$SRCROOT/standalone.ios\" -Wl,-exported_symbol -Wl,_main -Wl,-exported_symbol -Wl,_load_module -Wl,-exported_symbol -Wl,_resolve_symbol -L\"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME\" -licudata -licui18n -licuio -licule -liculx -licuuc\nelse\n $BIN_DIR/g++ -ObjC -nodefaultlibs -nostartfiles -Wl,-r -Wl,-x -arch ${ARCHS//\\ /\\ -arch\\ } -isysroot $SDKROOT -o \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext\" \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME\" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,\"$SRCROOT/standalone.ios\" -Wl,-exported_symbol -Wl,_main -Wl,-exported_symbol -Wl,_load_module -Wl,-exported_symbol -Wl,_resolve_symbol -L\"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME\" -licudata -licui18n -licuio -licule -liculx -licuuc\nfi\n";
2375+
shellScript = "if [ -e $PLATFORM_DEVELOPER_BIN_DIR/g++ ]; then\n BIN_DIR=$PLATFORM_DEVELOPER_BIN_DIR\nelse\n BIN_DIR=$DEVELOPER_BIN_DIR\nfi\n\nif [ $CONFIGURATION = \"Debug\" ]; then\n $BIN_DIR/g++ -ObjC -nodefaultlibs -nostartfiles -Wl,-r -arch ${ARCHS//\\ /\\ -arch\\ } -isysroot $SDKROOT -o \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext\" \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME\" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,\"$SRCROOT/standalone.ios\" -Wl,-exported_symbol -Wl,_main -Wl,-exported_symbol -Wl,_load_module -Wl,-exported_symbol -Wl,_resolve_symbol -L\"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME\" -licudata -licui18n -licuio -licule -liculx -licuuc\nelse\n $BIN_DIR/g++ -ObjC -nodefaultlibs -nostartfiles -Wl,-r -Wl,-x -Wl,-export_dynamic -arch ${ARCHS//\\ /\\ -arch\\ } -isysroot $SDKROOT -o \"$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.lcext\" \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME\" -Wl,-sectcreate -Wl,__MISC -Wl,__deps -Wl,\"$SRCROOT/standalone.ios\" -L\"$SOLUTION_DIR/prebuilt/lib/ios/$SDK_NAME\" -licudata -licui18n -licuio -licule -liculx -licuuc\nfi\n";
23752376
showEnvVarsInLog = 0;
23762377
};
23772378
4DBF5B5B1802E7C1009CAB2E /* Copy revsecurity */ = {
@@ -2390,6 +2391,21 @@
23902391
shellPath = /bin/sh;
23912392
shellScript = "cp \"$TARGET_BUILD_DIR/revsecurity.dylib\" \"$TARGET_BUILD_DIR/standalone-mobile-community.app/\"";
23922393
};
2394+
729D0F9B1A6FEA3000B0CA0F /* ShellScript */ = {
2395+
isa = PBXShellScriptBuildPhase;
2396+
buildActionMask = 2147483647;
2397+
files = (
2398+
);
2399+
inputPaths = (
2400+
$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME,
2401+
);
2402+
outputPaths = (
2403+
);
2404+
runOnlyForDeploymentPostprocessing = 0;
2405+
shellPath = /bin/sh;
2406+
shellScript = "strip -r -S -x \"$BUILT_PRODUCTS_DIR/$EXECUTABLE_NAME.app/$EXECUTABLE_NAME\"";
2407+
showEnvVarsInLog = 0;
2408+
};
23932409
/* End PBXShellScriptBuildPhase section */
23942410

23952411
/* Begin PBXSourcesBuildPhase section */
@@ -2866,8 +2882,6 @@
28662882
baseConfigurationReference = 4DD3DF4A1040B13E00CAC7EF /* Release Mobile.xcconfig */;
28672883
buildSettings = {
28682884
LIBRARY_SEARCH_PATHS = "$(SOLUTION_DIR)/prebuilt/lib/ios/$(SDK_NAME)";
2869-
OTHER_CFLAGS = "";
2870-
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
28712885
};
28722886
name = Release;
28732887
};
@@ -2879,9 +2893,6 @@
28792893
GCC_VERSION = "";
28802894
INFOPLIST_FILE = "rsrc/standalone-mobile-Info.plist";
28812895
OTHER_LDFLAGS = (
2882-
"-Wl,-x",
2883-
"-Wl,-exported_symbol",
2884-
"-Wl,_main",
28852896
"-ObjC",
28862897
"-force_load",
28872898
"${BUILT_PRODUCTS_DIR}/libfoundationmobile.a",
@@ -2894,7 +2905,6 @@
28942905
);
28952906
PRODUCT_NAME = "standalone-mobile-community";
28962907
PROVISIONING_PROFILE = "";
2897-
TARGETED_DEVICE_FAMILY = "1,2";
28982908
};
28992909
name = Release;
29002910
};
@@ -2917,8 +2927,6 @@
29172927
baseConfigurationReference = 4DD3DF461040B04D00CAC7EF /* Debug Mobile.xcconfig */;
29182928
buildSettings = {
29192929
LIBRARY_SEARCH_PATHS = "$(SOLUTION_DIR)/prebuilt/lib/ios/$(SDK_NAME)";
2920-
OTHER_CFLAGS = "";
2921-
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
29222930
};
29232931
name = Debug;
29242932
};
@@ -2941,7 +2949,6 @@
29412949
);
29422950
PRODUCT_NAME = "standalone-mobile-community";
29432951
PROVISIONING_PROFILE = "";
2944-
TARGETED_DEVICE_FAMILY = "1,2";
29452952
};
29462953
name = Debug;
29472954
};

engine/src/mbliphone.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ - (const char *)nativeCString
9494

9595
////////////////////////////////////////////////////////////////////////
9696

97-
extern "C" void *load_module(const char *);
98-
extern "C" void *resolve_symbol(void *, const char *);
97+
MC_DLLEXPORT extern "C" void *load_module(const char *);
98+
MC_DLLEXPORT extern "C" void *resolve_symbol(void *, const char *);
9999

100100
struct LibExport
101101
{

engine/src/mbliphoneapp.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ Exec_stat MCIPhoneHandleMessage(MCNameRef p_message, MCParameter *p_parameters)
20032003

20042004
extern bool MCModulesInitialize();
20052005

2006-
int main(int argc, char *argv[], char *envp[])
2006+
MC_DLLEXPORT int main(int argc, char *argv[], char *envp[])
20072007
{
20082008
#if defined(_DEBUG) && defined(_VALGRIND)
20092009
if (argc < 2 || (argc >= 2 && strcmp(argv[1], "-valgrind") != 0))

ide-support/revsaveasiosstandalone.livecodescript

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,9 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget
347347

348348
-- MW-2013-06-26: [[ CloneAndRun ]] Only strip global symbols if an installed env.
349349
if revEnvironmentIsInstalled() then
350+
-- FG-2015-01-21: [[ Widgets ]] We need to keep all exported symbols
350351
-- Make sure the only exported symbol is "main"
351-
put "-Wl,-x -Wl,-exported_symbol -Wl,_main" & return after tLinkCommand
352+
--put "-Wl,-x -Wl,-exported_symbol -Wl,_main" & return after tLinkCommand
352353
end if
353354

354355
-- MW-2013-06-25: [[ PIE ]] Make sure we make the minversion 4.3 so we can make

revdb/src/dbmysqlapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extern "C" {
8080
__libexports
8181
};
8282

83-
__attribute((section("__DATA,__libs"))) volatile struct LibInfo *__libinfoptr_dbmysql = &__libinfo;
83+
__attribute((section("__DATA,__libs"))) __attribute__((visibility("default"))) volatile struct LibInfo *__libinfoptr_dbmysql = &__libinfo;
8484
}
8585
#endif
8686

revdb/src/dbsqliteapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ extern "C" {
8080
__libexports
8181
};
8282

83-
__attribute((section("__DATA,__libs"))) volatile struct LibInfo *__libinfoptr_dbsqlite = &__libinfo;
83+
__attribute((section("__DATA,__libs"))) __attribute__((visibility("default"))) volatile struct LibInfo *__libinfoptr_dbsqlite = &__libinfo;
8484
}
8585
#endif
8686

revdb/src/revdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2298,6 +2298,6 @@ EXTERNAL_END_DECLARATIONS
22982298
extern "C"
22992299
{
23002300
extern struct LibInfo __libinfo;
2301-
__attribute((section("__DATA,__libs"))) volatile struct LibInfo *__libinfoptr_revdb = &__libinfo;
2301+
__attribute((section("__DATA,__libs"))) __attribute__((visibility("default"))) volatile struct LibInfo *__libinfoptr_revdb = &__libinfo;
23022302
}
23032303
#endif

revpdfprinter/src/revpdfprinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ struct LibInfo __libinfo =
14131413
__libexports
14141414
};
14151415

1416-
__attribute((section("__DATA,__libs"))) volatile struct LibInfo *__libinfoptr_revpdfprinter = &__libinfo;
1416+
__attribute((section("__DATA,__libs"))) __attribute__((visibility("default"))) volatile struct LibInfo *__libinfoptr_revpdfprinter = &__libinfo;
14171417
}
14181418
#endif
14191419

revxml/src/revxml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3121,6 +3121,6 @@ BOOL WINAPI DllMain(HINSTANCE tInstance, DWORD dwReason, LPVOID lpReserved)
31213121
extern "C"
31223122
{
31233123
extern struct LibInfo __libinfo;
3124-
__attribute((section("__DATA,__libs"))) volatile struct LibInfo *__libinfoptr_revxml = &__libinfo;
3124+
__attribute((section("__DATA,__libs"))) __attribute__((visibility("default"))) volatile struct LibInfo *__libinfoptr_revxml = &__libinfo;
31253125
}
31263126
#endif

revzip/src/revzip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,6 @@ BOOL APIENTRY DllMain( HMODULE hModule,
15021502
extern "C"
15031503
{
15041504
extern struct LibInfo __libinfo;
1505-
__attribute((section("__DATA,__libs"))) volatile struct LibInfo *__libinfoptr_revzip = &__libinfo;
1505+
__attribute((section("__DATA,__libs"))) __attribute__((visibility("default"))) volatile struct LibInfo *__libinfoptr_revzip = &__libinfo;
15061506
}
15071507
#endif

0 commit comments

Comments
 (0)