diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake
index d5a28fec536b78..eaef0d65df0664 100644
--- a/eng/native/functions.cmake
+++ b/eng/native/functions.cmake
@@ -390,11 +390,12 @@ function(strip_symbols targetName outputFilename)
message(FATAL_ERROR "strip not found")
endif()
+ set(strip_command ${STRIP} -no_code_signature_warning -S ${strip_source_file})
+
+ # codesign release build
string(TOLOWER "${CMAKE_BUILD_TYPE}" LOWERCASE_CMAKE_BUILD_TYPE)
if (LOWERCASE_CMAKE_BUILD_TYPE STREQUAL release)
- set(strip_command ${STRIP} -no_code_signature_warning -S ${strip_source_file} && codesign -f -s - ${strip_source_file})
- else ()
- set(strip_command)
+ set(strip_command ${strip_command} && codesign -f -s - ${strip_source_file})
endif ()
execute_process(
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
index 5ad1cf0d15581d..a5970704a52823 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
@@ -86,15 +86,17 @@
-
+
-
-
-
+
-
+
+
+
+
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.props b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.props
index 19f4d8604dda64..b150bf6392cb2e 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.props
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.props
@@ -14,10 +14,13 @@ The .NET Foundation licenses this file to you under the MIT license.
-->
- clang
+ true
+ clang
+ gcc
$(CppCompilerAndLinker)
$(CppCompilerAndLinker)
ar
+ --flat
@@ -106,7 +109,42 @@ The .NET Foundation licenses this file to you under the MIT license.
-
-
+
+
+
+
+
+
+ $(CppCompilerAndLinkerAlternative)
+ $(CppCompilerAndLinker)
+ $(CppCompilerAndLinker)
+ <_WhereLinker>0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(DsymUtilOptions) --minimize
+
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
index ef10a3e41d768b..d5c08a768d970e 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
@@ -70,6 +70,10 @@ The .NET Foundation licenses this file to you under the MIT license.
.lib
.a
+ .dwarf
+ .pdb
+ .dbg
+
.def
.exports
@@ -341,6 +345,16 @@ The .NET Foundation licenses this file to you under the MIT license.
+
+
+
+
+
+
true`.
No action is needed on Windows since the platform convention is to generate debug information into a separate file (`*.pdb`).