diff --git a/eng/toolAot.targets b/eng/toolAot.targets
index e378f44ddbc128..ee0470957be1f3 100644
--- a/eng/toolAot.targets
+++ b/eng/toolAot.targets
@@ -3,9 +3,14 @@
true
+
+ <_IsApplePlatformToolAot Condition="'$(PortableOS)' == 'osx' or '$(PortableOS)' == 'ios' or '$(PortableOS)' == 'iossimulator' or '$(PortableOS)' == 'tvos' or '$(PortableOS)' == 'tvossimulator' or '$(PortableOS)' == 'maccatalyst'">true
- .dwarf
- --flat
+ .dwarf
+ --flat 2>/dev/null
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
index e758f681c3c0ee..a72bddff0929d1 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
@@ -413,6 +413,7 @@ The .NET Foundation licenses this file to you under the MIT license.
Command=""$(ObjCopyName)" --add-gnu-debuglink="$(NativeBinary)$(NativeSymbolExt)" "$(NativeBinary)"" />
diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj
index d07363514d8914..239e3f83618a1b 100644
--- a/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj
+++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj
@@ -10,9 +10,6 @@
false
true
true
-
-
- false
diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
index ef721045174a58..f5f2fe11f65886 100644
--- a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
+++ b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
@@ -10,9 +10,6 @@
false
true
true
-
-
- false
diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt
index 10b9174e9f6da3..818dc5bbe27ae1 100644
--- a/src/native/libs/CMakeLists.txt
+++ b/src/native/libs/CMakeLists.txt
@@ -104,6 +104,7 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
if (CLR_CMAKE_TARGET_APPLE)
add_definitions(-D__APPLE_USE_RFC_3542)
+ add_compile_options(-gline-tables-only)
endif ()
if (CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_HAIKU)
diff --git a/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt b/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt
index 99f7b1b2d207f6..cbb8c439b7b517 100644
--- a/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt
+++ b/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt
@@ -89,7 +89,7 @@ endif()
add_custom_command(
OUTPUT pal_swiftbindings.o
- COMMAND xcrun swiftc -emit-object -static -parse-as-library -enable-library-evolution ${SWIFT_COMPILER_ERRORS_FLAG} -gline-tables-only ${SWIFT_OPTIMIZATION_FLAG} -runtime-compatibility-version none ${SWIFT_SDK_FLAG} -target ${SWIFT_COMPILER_TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/pal_swiftbindings.swift -o pal_swiftbindings.o
+ COMMAND xcrun swiftc -emit-object -static -parse-as-library -enable-library-evolution ${SWIFT_COMPILER_ERRORS_FLAG} -gnone ${SWIFT_OPTIMIZATION_FLAG} -runtime-compatibility-version none ${SWIFT_SDK_FLAG} -target ${SWIFT_COMPILER_TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/pal_swiftbindings.swift -o pal_swiftbindings.o
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/pal_swiftbindings.swift
COMMENT "Compiling Swift file pal_swiftbindings.swift"
)
diff --git a/src/native/managed/native-library.targets b/src/native/managed/native-library.targets
index 298da3c50ce786..692de5315276ba 100644
--- a/src/native/managed/native-library.targets
+++ b/src/native/managed/native-library.targets
@@ -70,7 +70,7 @@
<_StripLike Condition="'$(_StripLike)' == ''">gnu
-
+
diff --git a/src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets b/src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets
index e20b05ee033e52..a7a3ce1b726f33 100644
--- a/src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets
+++ b/src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets
@@ -665,6 +665,7 @@ Copyright (c) .NET Foundation. All rights reserved.
diff --git a/src/tests/Common/CLRTest.CrossGen.targets b/src/tests/Common/CLRTest.CrossGen.targets
index 8b45eb30ddec36..51bccb036fa981 100644
--- a/src/tests/Common/CLRTest.CrossGen.targets
+++ b/src/tests/Common/CLRTest.CrossGen.targets
@@ -156,6 +156,12 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then
echo clang -dynamiclib -o "$__OutputFileFinal" "$__OutputFile" -install_name "@rpath/`basename "$__OutputFileFinal"`" -Wl,-dead_strip
clang -dynamiclib -o "$__OutputFileFinal" "$__OutputFile" -install_name "@rpath/`basename "$__OutputFileFinal"`" -Wl,-dead_strip
__linkExitCode=$?
+
+ if [ $__linkExitCode -eq 0 ] && [ "$(StripSymbols)" == "true" ]; then
+ echo "Stripping symbols from: $(basename "$__OutputFileFinal")"
+ dsymutil "$__OutputFileFinal" && strip -no_code_signature_warning -x "$__OutputFileFinal"
+ __linkExitCode=$?
+ fi
fi
echo "Running R2RDump: $__R2RDumpCommand"
diff --git a/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj b/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj
index 900df8cea49d76..5b06ca87506641 100644
--- a/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj
+++ b/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj
@@ -9,9 +9,6 @@
true
true
false
-
-
- false
diff --git a/src/tools/ilasm/src/ilasm/ilasm.csproj b/src/tools/ilasm/src/ilasm/ilasm.csproj
index 1ed88edd74622d..8a1e3d9fe0a6b4 100644
--- a/src/tools/ilasm/src/ilasm/ilasm.csproj
+++ b/src/tools/ilasm/src/ilasm/ilasm.csproj
@@ -12,9 +12,6 @@
true
true
true
-
-
- false
enable