<pre style='margin:0'>
Perry E. Metzger (pmetzger) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/59e48b191dc589eebdba456929a8050c7dff5055">https://github.com/macports/macports-ports/commit/59e48b191dc589eebdba456929a8050c7dff5055</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 59e48b191dc mrustc: new port
</span>59e48b191dc is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 59e48b191dc589eebdba456929a8050c7dff5055
</span>Author: Evan Miller <emmiller@gmail.com>
AuthorDate: Mon Dec 13 08:00:29 2021 -0500
<span style='display:block; white-space:pre;color:#404040;'> mrustc: new port
</span>---
lang/mrustc/Portfile | 104 ++++++++++++
.../mrustc/files/patch-mrustc-macos-bootstrap.diff | 185 +++++++++++++++++++++
.../files/patch-mrustc-macports-compiler.diff | 13 ++
.../mrustc/files/patch-mrustc-macports-libdir.diff | 14 ++
.../files/patch-mrustc-macports-version.diff | 13 ++
5 files changed, 329 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mrustc/Portfile b/lang/mrustc/Portfile
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..7a5a7f255d5
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mrustc/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,104 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortSystem 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup github 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+github.setup thepowersgang mrustc 4bee8893e8f471d315c1d2d9535216b116cdfe23
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 20220111
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+categories lang devel
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+license MIT
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+maintainers nomaintainer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+description Alternative implementation of Rust
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+supported_archs x86_64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+long_description \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ In-progress alternative rust compiler. Capable of building a \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fully-working copy of rustc, but not suitable for everyday use \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (due to inadequate error messages).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+master_sites-append https://static.rust-lang.org/dist/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set rust_version 1.39.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set rust_version_major [join [lrange [split ${rust_version} .-] 0 1] .]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set rust_version_major_underscore [join [lrange [split ${rust_version} .-] 0 1] _]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+distfiles-append rustc-${rust_version}-src.tar.gz
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums mrustc-${github.version}.tar.gz \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rmd160 c16b5b1ceb5f79f61712c22488662a0c68464ea9 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 28f53fca94ef4edec4f1e37d0d9d3c12bca5b4b867dbb2a62e80692afaee141e \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 1173691 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rustc-${rust_version}-src.tar.gz \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rmd160 d5b04b87fc336e3be7d592f70de0363aa66622aa \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 b4a1f6b6a93931f270691aba4fc85eee032fecda973e6b9c774cd06857609357 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 152803201
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+use_configure no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compiler.cxx_standard 2014
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compiler.c_standard 2011
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Thread-local storage is not needed to compile mrustc, but is required
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# for compiling Rust files (e.g. the standard library)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compiler.thread_local_storage yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# A C compiler is needed at run-time; it doesn't have to be the same version as
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# the C++ compiler used to compile mrustc, but we'll use that one as the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# default, and declare the dependency here
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if { [string match macports-clang-* ${configure.compiler}] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_run-append port:[string map {"macports-" ""} ${configure.compiler}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# GCC can't be used as a run-time compiler, see
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/thepowersgang/mrustc/issues/214
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compiler.blacklist *gcc*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Uncomment the lines below and delete the line above when GCC support is fixed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if { [string match macports-gcc-* ${configure.compiler}] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# depends_run-append port:[string map {"macports-gcc-" "gcc"} ${configure.compiler}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://github.com/thepowersgang/mrustc/pull/192
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-mrustc-macos-bootstrap.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Set the default MRUSTC_LIBDIR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-mrustc-macports-libdir.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@MACPORTS_MRUSTC_LIBDIR@|${prefix}/lib/mrustc-${rust_version_major}|" ${worksrcpath}/src/main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Set the default CC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-mrustc-macports-compiler.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@MACPORTS_MRUSTC_CC@|${configure.cc}|" ${worksrcpath}/src/trans/codegen_c.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Set the default gTargetVersion
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-mrustc-macports-version.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ reinplace "s|@MACPORTS_MRUSTC_TARGET_VER@|${rust_version_major_underscore}|" ${worksrcpath}/src/main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Patch the Rust source code with the patch included with mrustc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${workpath}/rustc-${rust_version}-src "patch -p0 < ${worksrcpath}/rustc-${rust_version}-src.patch"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file rename ${workpath}/rustc-${rust_version}-src ${worksrcpath}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+build {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${worksrcpath} "/usr/bin/env CXX=${configure.cxx} CC=${configure.cc} CXXFLAGS_EXTRA='${configure.cxxflags}' ${build.cmd} all"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${worksrcpath}/tools/minicargo "/usr/bin/env CXX=${configure.cxx} CC=${configure.cc} ${build.cmd} all"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${worksrcpath} "/usr/bin/env CXX=${configure.cxx} CC=${configure.cc} RUSTC_VERSION=${rust_version} RUSTC_TARGET=${build_arch}-apple-darwin MRUSTC_LIBDIR=output-${rust_version} MRUSTC_TARGET_VER=${rust_version_major} ${build.cmd} -f minicargo.mk LIBS"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -m 0755 -W ${worksrcpath} ./bin/${name} ${destroot}${prefix}/bin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall -m 0755 -W ${worksrcpath} ./bin/minicargo ${destroot}${prefix}/bin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file copy ${worksrcpath}/output-${rust_version} ${destroot}${prefix}/lib/mrustc-${rust_version_major}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Run a Hello, world! test
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.env RUSTC_VERSION=${rust_version} MRUSTC_LIBDIR=output-${rust_version}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.run yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test.target test
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mrustc/files/patch-mrustc-macos-bootstrap.diff b/lang/mrustc/files/patch-mrustc-macos-bootstrap.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..625d1fb3c2b
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mrustc/files/patch-mrustc-macos-bootstrap.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,185 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/thepowersgang/mrustc/pull/192
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- run_rustc/Makefile.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ run_rustc/Makefile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -27,13 +27,13 @@ endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ifeq ($(shell uname -s || echo not),Darwin)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DYLIB_EXT := dylib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PLATFORM := macos
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ RUSTC_TARGET ?= x86_64-apple-darwin
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DYLIB_EXT := so
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PLATFORM := linux
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ RUSTC_TARGET ?= x86_64-unknown-linux-gnu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-RUSTC_TARGET ?= x86_64-unknown-linux-gnu
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TARGETVER_LEAST_1_29 := $(shell test "$(RUSTC_VERSION)" ">" "1.29" && echo yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TARGETVER_LEAST_1_39 := $(shell test "$(RUSTC_VERSION)" ">" "1.39" && echo yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ TARGETVER_LEAST_1_54 := $(shell test "$(RUSTC_VERSION)" ">" "1.54" && echo yes)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- rustc-1.39.0-src.patch.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ rustc-1.39.0-src.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -64,8 +64,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use self::generic as arch;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-index da9d9d5bfdc0..3d47471f0ef0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ --- src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ +++ src/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ @@ -16,6 +16,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -80,18 +78,69 @@ index da9d9d5bfdc0..3d47471f0ef0 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ## gcc (used by mrustc) has 16-byte uint128_t alignment, while rustc uses 8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ##
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#--- src/libsyntax/ast.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#+++ src/libsyntax/ast.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#@@ -986,2 +986,2 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#-#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#-static_assert_size!(Expr, 96);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#+//#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#+//static_assert_size!(Expr, 96);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#--- src/librustc/ty/sty.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#+++ src/librustc/ty/sty.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#@@ -2258,2 +2258,2 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#-#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#-static_assert_size!(Const<'_>, 40);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#+//#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#+//static_assert_size!(Const<'_>, 40);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++--- src/libsyntax/ast.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++++ src/libsyntax/ast.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@@ -985,3 +985,3 @@ pub struct Expr {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++#[cfg(all(target_arch = "x86_64", not(rust_compiler="mrustc")))]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static_assert_size!(Expr, 96);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++--- src/librustc/ty/sty.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++++ src/librustc/ty/sty.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@@ -2257,3 +2257,3 @@ pub struct Const<'tcx> {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++#[cfg(all(target_arch = "x86_64", not(rust_compiler="mrustc")))]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ static_assert_size!(Const<'_>, 40);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++--- src/librustc/hir/mod.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++++ src/librustc/hir/mod.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@@ -1412,8 +1412,8 @@ pub struct Expr {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-static_assert_size!(Expr, 72);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++#[cfg(all(target_arch = "x86_64", not(rust_compiler="mrustc")))]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++static_assert_size!(Expr, 72);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ impl Expr {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pub fn precedence(&self) -> ExprPrecedence {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++--- src/librustc/mir/interpret/value.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++++ src/librustc/mir/interpret/value.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@@ -106,8 +106,8 @@ pub enum Scalar<Tag = (), Id = AllocId> {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Ptr(Pointer<Tag, Id>),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-#[cfg(target_arch = "x86_64")]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-static_assert_size!(Scalar, 24);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++#[cfg(all(target_arch = "x86_64", not(rust_compiler="mrustc")))]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++static_assert_size!(Scalar, 24);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ impl<Tag: fmt::Debug, Id: fmt::Debug> fmt::Debug for Scalar<Tag, Id> {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# Workaround linker error attempting to find symbol CFMutableAttributedStringGetTypeID on macOS.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# See details at https://github.com/servo/core-foundation-rs/pull/357
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++--- vendor/core-foundation/src/attributed_string.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++++ vendor/core-foundation/src/attributed_string.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@@ -41,7 +41,7 @@ impl CFAttributedString {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ declare_TCFType!{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CFMutableAttributedString, CFMutableAttributedStringRef
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-impl_TCFType!(CFMutableAttributedString, CFMutableAttributedStringRef, CFMutableAttributedStringGetTypeID);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++impl_TCFType!(CFMutableAttributedString, CFMutableAttributedStringRef, CFAttributedStringGetTypeID);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ impl CFMutableAttributedString {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ #[inline]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++--- vendor/core-foundation-sys/src/attributed_string.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+++++ vendor/core-foundation-sys/src/attributed_string.rs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++@@ -51,6 +51,4 @@ extern {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ attr_name: CFStringRef,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ value: CFTypeRef,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++- pub fn CFMutableAttributedStringGetTypeID() -> CFTypeID;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/trans/codegen_c.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/trans/codegen_c.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1210,7 +1210,9 @@ namespace {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ args.push_back(c);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ args.push_back("-Wl,--start-group"); // Group to avoid linking ordering
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ //args.push_back("-Wl,--push-state");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for(auto l_d : libraries_and_dirs)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1240,7 +1242,9 @@ namespace {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ //args.push_back("-Wl,--pop-state");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if !defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ args.push_back("-Wl,--end-group"); // Group to avoid linking ordering
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for( const auto& a : Target_GetCurSpec().m_backend_c.m_linker_opts )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ args.push_back( a.c_str() );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -2478,10 +2482,10 @@ namespace {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_of << "\tif(arg0) rv._0 |= __builtin_add_overflow" << msvc_suffix_u32 << "(rv._1, 1, &rv._1);\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_of << "\treturn rv;\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // `fn llvm_addcarryx_u32(a: u8, b: u32, c: u32, d: *mut u8) -> u32`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // `fn llvm_addcarryx_u32(a: u8, b: u32, c: u32, d: *mut u8) -> u8`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else if( item.m_linkage.name == "llvm.x86.addcarryx.u32") {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_of << "\t*arg3 = __builtin_add_overflow" << msvc_suffix_u32 << "(arg1, arg2, &rv);\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- m_of << "\tif(*arg3) *arg3 |= __builtin_add_overflow" << msvc_suffix_u32 << "(rv, 1, &rv);\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ m_of << "\trv = __builtin_add_overflow" << msvc_suffix_u32 << "(arg1, arg2, arg3);\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ m_of << "\tif(arg0) rv |= __builtin_add_overflow" << msvc_suffix_u32 << "(*arg3, 1, arg3);\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m_of << "\treturn rv;\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // `fn llvm_subborrow" << msvc_suffix_u32 << "(a: u8, b: u32, c: u32) -> (u8, u32);`
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/trans/target.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/trans/target.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -532,7 +532,7 @@ namespace
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCH_X86_64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if(target_name == "x86_64-apple-macosx")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if(target_name == "x86_64-apple-darwin")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // NOTE: OSX uses Mach-O binaries, which don't fully support the defaults used for GNU targets
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return TargetSpec {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -540,7 +540,7 @@ namespace
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ARCH_X86_64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else if(target_name == "aarch64-apple-macosx")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else if(target_name == "aarch64-apple-darwin")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // NOTE: OSX uses Mach-O binaries, which don't fully support the defaults used for GNU targets
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return TargetSpec {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- tools/common/target_detect.h.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ tools/common/target_detect.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -86,9 +86,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // - Apple devices
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # if defined(__aarch64__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define DEFAULT_TARGET_NAME "aarch64-apple-macosx"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define DEFAULT_TARGET_NAME "aarch64-apple-darwin"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define DEFAULT_TARGET_NAME "x86_64-apple-macosx"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define DEFAULT_TARGET_NAME "x86_64-apple-darwin"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // - Haiku
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #elif defined(__HAIKU__)
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mrustc/files/patch-mrustc-macports-compiler.diff b/lang/mrustc/files/patch-mrustc-macports-compiler.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..aaacc495f73
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mrustc/files/patch-mrustc-macports-compiler.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Let MacPorts define the default compiler.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/trans/codegen_c.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/trans/codegen_c.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1159,7 +1159,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ args.push_back( Target_GetCurSpec().m_backend_c.m_c_compiler + "-gcc" );
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- args.push_back("gcc");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ args.push_back("@MACPORTS_MRUSTC_CC@");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ arg_file_start = args.get_vec().size();
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mrustc/files/patch-mrustc-macports-libdir.diff b/lang/mrustc/files/patch-mrustc-macports-libdir.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..274a22ed410
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mrustc/files/patch-mrustc-macports-libdir.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,14 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Let MacPorts set a default value for MRUSTC_LIBDIR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/main.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -892,6 +892,9 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ this->lib_search_dirs.push_back(a);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ this->lib_search_dirs.push_back("@MACPORTS_MRUSTC_LIBDIR@");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Hacky command-line parsing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for( int i = 1; i < argc; i ++ )
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/lang/mrustc/files/patch-mrustc-macports-version.diff b/lang/mrustc/files/patch-mrustc-macports-version.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..4180f508c69
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/lang/mrustc/files/patch-mrustc-macports-version.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,13 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Let MacPorts customize the default Rust target version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/main.cpp.orig
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/main.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -37,7 +37,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # include <DbgHelp.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-TargetVersion gTargetVersion = TargetVersion::Rustc1_29;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TargetVersion gTargetVersion = TargetVersion::Rustc@MACPORTS_MRUSTC_TARGET_VER@;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct ProgramParams
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span></pre><pre style='margin:0'>
</pre>