Skip to content
Snippets Groups Projects

contrib: rust: enable more Rust targets

Merged Steve Lhomme requested to merge robUx4/vlc:more-rust into master
2 unresolved threads

Based on https://doc.rust-lang.org/nightly/rustc/platform-support.html

Edited by Steve Lhomme

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Martin Storsjö
    Martin Storsjö @mstorsjo started a thread on commit 3db7c594
  • 4 4 # This file is under the same license as the vlc package.
    5 5
    6 6 ifdef HAVE_WIN32
    7 ifndef HAVE_WINSTORE
    7 ifdef HAVE_UCRT
    8 ifndef HAVE_WINSTORE # UWP is available as Tier 3
    9 ifeq ($(HOST),i686-w64-mingw32)
    10 RUST_TARGET = i686-pc-windows-gnullvm # ARCH is i386
    • Commenting on the commit message here ("The naming in Rust is bogus but it does means it's using UCRT") - I wouldn't say it's bogus, but it combines multiple things. A GCC toolchain using UCRT probably shouldn't use the -gnullvm targets. So I think the naming is mostly reasonable, the -gnu vs -gnullvm is primarily about tool type, but they also have the -gnullvm targets to imply UCRT.

    • Hey, I'm the -windows-gnullvm target maintainer. Martin is right, gnullvm targets most importantly use LLVM libraries and ABI. So libgcc is replaced with libunwind, the linker is LLD, it uses native TLS instead of emutls, function sections are enabled, and there's probably something else that I forgot. UCRT is another difference, but a smaller one since the changes from my previous sentence cause builds with GCC/Binutils to break.

      windows-gnu targets are built with MSVCRT, but that shouldn't be a big deal as long as you stick to the default static std library (in other words, as long as you don't use -C prefer-dynamic). I can't guarantee it will always work, but it's much better compared to using windows-gnullvm targets, which have a 100% chance of failing when using them with GCC/Binutils. Unless you want to migrate to LLVM as well (windows-gnullvm targets by default will pick Clang from PATH as the linker), but that would be a much bigger change than this PR implies.

    • Author Developer

      Thanks for the tips. Maybe it should only be used with HAVE_CLANG then (which we already test) for better safety.

      We do plan to make the VLC 4 Windows builds with LLVM but there's very little Rust code in it yet. In that scenario every library is compiled with the same LLVM and we even build our compiler from scratch.

    • It sounds reasonable to at least guard it on the define. By the way, one day, windows-gnu will move to UCRT for prebuilt libraries, but there is no ETA.

    • Yes but due to various issues in GCC/Binutils and lack of build with Binutils 2.40+ at https://github.com/niXman/mingw-builds-binaries/releases?page=1 Rust is still using mingw-w64 from 2 years ago.

    • Please register or sign in to reply
  • Steve Lhomme mentioned in merge request !5803 (merged)

    mentioned in merge request !5803 (merged)

  • Please register or sign in to reply
    Loading