Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono][ios] Introduce non-global symbol stripping in MonoAOTCompiler msbuild task #81361

Merged
merged 6 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/mono/sample/iOS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AOT?=false
TARGET?=iossimulator
DEPLOY_AND_RUN?=true
APP_SANDBOX?=false
STRIP_DEBUG_SYMBOLS?=true // only used when measuring SOD via build-appbundle make target
ivanpovazan marked this conversation as resolved.
Show resolved Hide resolved

#If DIAGNOSTIC_PORTS is enabled, RUNTIME_COMPONENTS must also be enabled.
#If RUNTIME_COMPONENTS is enabled, DIAGNOSTIC_PORTS is optional.
Expand Down Expand Up @@ -51,6 +52,7 @@ run-sim: clean appbuilder
build-appbundle: clean appbuilder
$(DOTNET) publish -c $(MONO_CONFIG) /p:TargetOS=$(TARGET) /p:TargetArchitecture=$(MONO_ARCH) \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
/p:UseLLVM=$(USE_LLVM) /p:ForceAOT=$(AOT) /bl \

run-catalyst:
Expand Down
5 changes: 5 additions & 0 deletions src/mono/sample/iOS/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<RuntimeIdentifier>$(TargetOS)-$(TargetArchitecture)</RuntimeIdentifier>
<DefineConstants Condition="'$(ArchiveTests)' == 'true'">$(DefineConstants);CI_TEST</DefineConstants>
<AppName>HelloiOS</AppName>
<StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''">false</StripDebugSymbols>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -97,6 +98,10 @@
<Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" />
</AppleAppBuilderTask>

<Exec Condition="'$(StripDebugSymbols)' == 'true'"
Command="dsymutil $(AppBundlePath)/$(AppName)
ivanpovazan marked this conversation as resolved.
Show resolved Hide resolved
strip -no_code_signature_warning -i -s $(MSBuildThisFileDirectory)/symbols_to_keep.list $(AppBundlePath)/$(AppName)" />

<Message Importance="High" Text="Xcode: $(XcodeProjectPath)"/>
<Message Importance="High" Text="App: $(AppBundlePath)"/>
</Target>
Expand Down
111 changes: 111 additions & 0 deletions src/mono/sample/iOS/symbols_to_keep.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
_SystemNative_Abort
_SystemNative_Exit
_SystemNative_SchedGetCpu
_SystemNative_ConvertErrorPlatformToPal
_SystemNative_ConvertErrorPalToPlatform
_SystemNative_StrErrorR
_SystemNative_GetLoadLibraryError
_SystemNative_GetProcAddress
_SystemNative_FreeLibrary
_SystemNative_GetErrNo
_SystemNative_SetErrNo
_SystemNative_GetEnviron
_SystemNative_FreeEnviron
_SystemNative_GetOSArchitecture
_SystemNative_GetNonCryptographicallySecureRandomBytes
_SystemNative_GetCryptographicallySecureRandomBytes
_SystemNative_GetSystemTimeAsTicks
_SystemNative_GetTimestamp
_SystemNative_LChflagsCanSetHiddenFlag
_SystemNative_CanGetHiddenFlag
_SystemNative_Log
_SystemNative_LogError
_SystemNative_LowLevelMonitor_Create
_SystemNative_LowLevelMonitor_Destroy
_SystemNative_LowLevelMonitor_Acquire
_SystemNative_LowLevelMonitor_Release
_SystemNative_LowLevelMonitor_Wait
_SystemNative_LowLevelMonitor_Signal_Release
_SystemNative_AlignedAlloc
_SystemNative_AlignedFree
_SystemNative_AlignedRealloc
_SystemNative_Calloc
_SystemNative_Free
_SystemNative_Malloc
_SystemNative_Realloc
_SystemNative_GetAllMountPoints
_SystemNative_GetReadDirRBufferSize
_SystemNative_ReadDirR
_SystemNative_GetEUid
_SystemNative_GetEGid
_SystemNative_GetPid
_SystemNative_CreateAutoreleasePool
_SystemNative_DrainAutoreleasePool
_SystemNative_CreateThread
_SystemNative_Access
_SystemNative_ChDir
_SystemNative_ChMod
_SystemNative_FChMod
_SystemNative_Close
_SystemNative_CopyFile
_SystemNative_LoadLibrary
_SystemNative_GetDefaultSearchOrderPseudoHandle
_SystemNative_GetFileSystemType
_SystemNative_FLock
_SystemNative_FSync
_SystemNative_FTruncate
_SystemNative_GetCpuUtilization
_SystemNative_GetCwd
_SystemNative_GetDefaultTimeZone
_SystemNative_GetEnv
_SystemNative_GetHostName
_SystemNative_GetProcessPath
_SystemNative_GetUnixVersion
_SystemNative_GetUnixRelease
_SystemNative_LChflags
_SystemNative_FChflags
_SystemNative_Link
_SystemNative_LockFileRegion
_SystemNative_LowLevelMonitor_TimedWait
_SystemNative_LSeek
_SystemNative_MkDir
_SystemNative_MkdTemp
_SystemNative_MksTemps
_SystemNative_Open
_SystemNative_PathConf
_SystemNative_PosixFAdvise
_SystemNative_FAllocate
_SystemNative_PRead
_SystemNative_PReadV
_SystemNative_PWrite
_SystemNative_PWriteV
_SystemNative_Read
_SystemNative_OpenDir
_SystemNative_CloseDir
_SystemNative_ReadLink
_SystemNative_Rename
_SystemNative_RmDir
_SystemNative_FStat
_SystemNative_Stat
_SystemNative_LStat
_SystemNative_SymLink
_SystemNative_SysConf
_SystemNative_SysLog
_SystemNative_Unlink
_SystemNative_UTimensat
_SystemNative_FUTimens
_SystemNative_Write
_SystemNative_GetGroups
_SystemNative_GetPwUidR
_SystemNative_GetPwNamR
_SystemNative_SearchPath
_SystemNative_SearchPath_TempDirectory
_SystemNative_FcntlSetFD
_SystemNative_MMap
_SystemNative_MUnmap
_SystemNative_MSync
_SystemNative_MAdvise
_SystemNative_ShmOpen
_SystemNative_ShmUnlink
ivanpovazan marked this conversation as resolved.
Show resolved Hide resolved
_ios_register_button_click
_ios_set_text