Skip to content

Commit

Permalink
Add build option to strip out debug symbols when building MonoAOT iOS…
Browse files Browse the repository at this point in the history
… sample app
  • Loading branch information
kotlarmilos committed Jan 25, 2023
1 parent 6e773f2 commit 840ee5b
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
3 changes: 3 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?=false

#If DIAGNOSTIC_PORTS is enabled, RUNTIME_COMPONENTS must also be enabled.
#If RUNTIME_COMPONENTS is enabled, DIAGNOSTIC_PORTS is optional.
Expand Down Expand Up @@ -33,6 +34,7 @@ run: clean appbuilder
/p:TargetArchitecture=$(MONO_ARCH) \
/p:UseLLVM=$(USE_LLVM) \
/p:ForceAOT=$(AOT) \
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
Expand All @@ -44,6 +46,7 @@ run-sim: clean appbuilder
/p:TargetArchitecture=$(MONO_ARCH) \
/p:UseLLVM=$(USE_LLVM) \
/p:ForceAOT=$(AOT) \
/p:StripDebugSymbols=$(STRIP_DEBUG_SYMBOLS) \
'/p:RuntimeComponents="$(RUNTIME_COMPONENTS)"' \
'/p:DeployAndRun="$(DEPLOY_AND_RUN)"' \
'/p:DiagnosticPorts="$(DIAGNOSTIC_PORTS)"'
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)
strip -no_code_signature_warning -i -s $(MSBuildThisFileDirectory)/symbols.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.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
_ios_register_button_click
_ios_set_text

0 comments on commit 840ee5b

Please sign in to comment.