Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Handle wasi case
  • Loading branch information
am11 committed Mar 27, 2023
commit 5d3fe81a483a3068e2bc1a16514193e9e7995132
8 changes: 5 additions & 3 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ function (get_symbol_file_name targetName outputSymbolFilename)
endif ()

set(${outputSymbolFilename} ${strip_destination_file} PARENT_SCOPE)
else(CLR_CMAKE_HOST_UNIX)
elseif(CLR_CMAKE_HOST_WIN32)
# We can't use the $<TARGET_PDB_FILE> generator expression here since
# the generator expression isn't supported on resource DLLs.
set(${outputSymbolFilename} $<TARGET_FILE_DIR:${targetName}>/$<TARGET_FILE_PREFIX:${targetName}>$<TARGET_FILE_BASE_NAME:${targetName}>.pdb PARENT_SCOPE)
endif(CLR_CMAKE_HOST_UNIX)
endif()
endfunction()

function(strip_symbols targetName outputFilename)
Expand Down Expand Up @@ -443,7 +443,9 @@ endfunction()
function(install_with_stripped_symbols targetName kind destination)
if(NOT CLR_CMAKE_KEEP_NATIVE_SYMBOLS)
strip_symbols(${targetName} symbol_file)
install_symbol_file(${symbol_file} ${destination} ${ARGN})
if (NOT "${symbolFile}" STREQUAL "")
install_symbol_file(${symbol_file} ${destination} ${ARGN})
endif()
endif()

if (CLR_CMAKE_TARGET_APPLE AND ("${kind}" STREQUAL "TARGETS"))
Expand Down
2 changes: 0 additions & 2 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,6 @@
DestinationFiles="@(_MonoRuntimeBuildArtifacts->'$(RuntimeBinDir)build\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" />

<Exec Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true' and '$(MonoGenerateOffsetsOSGroups)' == '' and ('$(TargetsOSX)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true')" Command="install_name_tool -id @rpath/$(MonoFileName) $(RuntimeBinDir)$(MonoFileName)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you verify that the rpath is correct after this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed this works because we pass -DMONO_SHARED_LIB_NAME=$(MonoSharedLibName) into cmake now so the filename is correct from the beginning (and thus the rpath).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I mainly relied upon the CI for this one. We switched cmake install with our wrapper install_with_stripped_symbols, which is used for all binaries for coreclr, libs and corehost.

Now that you have mentioned it, I tested it on osx-arm64 and otool gives me the same output before (main) and after (PR):

$ ./build.sh mono -c Release

$ otool -l artifacts/bin/mono/osx.arm64.Release/libcoreclr.dylib
[...]
Load command 4
          cmd LC_ID_DYLIB
      cmdsize 48
         name @rpath/libcoreclr.dylib (offset 24)
   time stamp 1 Thu Jan  1 02:00:01 1970
      current version 2.0.0
[...]

If the passing CI legs do not indicate that iOS / other targets are in the clear and this testing (on osx-arm64) is not enough, I can try to build for those platforms as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the failures on runtime-extra-platforms and none of them seem to be related :)

</Target>

<Target Name="CleanMono">
Expand Down