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

Add support for illumos cross-compilation #37753

Merged
merged 1 commit into from
Jun 19, 2020
Merged

Add support for illumos cross-compilation #37753

merged 1 commit into from
Jun 19, 2020

Conversation

am11
Copy link
Member

@am11 am11 commented Jun 11, 2020

Summary of changes:

Essential

  • add tryrun configuration for illumos cross-compile.
    • note: src/installer didn't had one before.
  • detect ld, and based on that choose linker flags.
    • in cross-compile from Ubuntu, toolchain uses GNU ld, otherwise when we are compiling on SmartOS and other illumos-based distros, it is Solaris ld. Full ld --version output looks like this:

      ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1763 (illumos)

  • link is an llvm concept which does not have a separate equivalent tool in GCC toolchain; gcc -flto provides similar functionality. Perhaps llvm-link is unused in our builds and can be removed?
    • reason why it wasn't caught with GCC builds before:
      1. we always found a totally different "wrong" tool: link(1) via system introspection
      2. in rootfs isolation this unrelated tool is not available, and was failing the build.
  • add illumos RID to System.Data.ODBC project.
    • this is the only project which requires RID of new system, otherwise fails the cross-build of src/libraries.
    • rest of the libraries work will follow in separate PR.

Extra

  • add armv7-alpine in tryrun scripts.
  • prefer ${CMAKE_DL_LIBS} when possible instead of if/else (as already done under src/installer).
  • remove trailing slash .tools in .gitignore, so if they are symlinks they don't get added with git add :/

Contributes to: #34944.

@ghost
Copy link

ghost commented Jun 11, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

@am11 am11 marked this pull request as ready for review June 11, 2020 17:58
@am11
Copy link
Member Author

am11 commented Jun 11, 2020

cc @janvorli, @jclulow, with this change, the cross-compiled product succeeds dotnet helloworld.dll with coreclr runtime on SmartOS 2020 x64. mono runtime work is done separately: #37560.

src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt Outdated Show resolved Hide resolved
src/coreclr/tryrun.cmake Outdated Show resolved Hide resolved
eng/native/configurecompiler.cmake Outdated Show resolved Hide resolved
@am11
Copy link
Member Author

am11 commented Jun 19, 2020

@janvorli, thanks for the review. I have addressed the feedback. Some blocks were moved under else(CLR_CMAKE_TARGET_WIN32) to avoid the platform check again, therefore easier to follow the diff without a whitespace change: https://github.com/dotnet/runtime/pull/37753/files?w=1.

@janvorli janvorli merged commit 43ae9af into dotnet:master Jun 19, 2020
@am11 am11 deleted the feature/sunos/cross-compile branch June 19, 2020 12:50
@ghost ghost locked as resolved and limited conversation to collaborators Jan 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants