[104052] trunk/dports/lang/rust
larryv at macports.org
larryv at macports.org
Wed Mar 13 23:14:14 PDT 2013
Revision: 104052
https://trac.macports.org/changeset/104052
Author: larryv at macports.org
Date: 2013-03-13 23:14:14 -0700 (Wed, 13 Mar 2013)
Log Message:
-----------
rust: Fix broken build by reintegrating work from sandbox.
* Include 3 upstream patches to fix major issues.
* Use the snapshot compiler from "stage0" distfile; disable curl requirement.
* Blacklist Apple Clang based on LLVM 2.9 or older.
* Fix configure to accept all LLVM 3.x and Clang 3.x and 4.x.
* If not compiling with Clang, remove unrecognized flags.
* Add build dependencies on Perl, Python, and port-provided compilers.
* Explicitly specify GNU Make for building.
* Use "$CC -E" as CPP, otherwise Clang builds fail.
* Enable test phase.
* Install vim support files and ctags file.
* Delete 0-byte libraries left over from build.
* Make all build phases verbose.
* Disable universal variant.
* Use text from Rust website for descriptions.
* Specify livecheck type.
* Add self as a maintainer.
* Revbump, naturally.
Modified Paths:
--------------
trunk/dports/lang/rust/Portfile
trunk/dports/lang/rust/files/patch-configure.diff
Added Paths:
-----------
trunk/dports/lang/rust/files/patch-non_apple_gcc.diff
trunk/dports/lang/rust/files/patch-src-etc-local_stage0.sh.diff
trunk/dports/lang/rust/files/patch-src-librusti-rusti.rc.diff
trunk/dports/lang/rust/files/patch-src-rustllvm-RustWrapper.cpp.diff
Property Changed:
----------------
trunk/dports/lang/rust/
Property changes on: trunk/dports/lang/rust
___________________________________________________________________
Added: svn:mergeinfo
+ /users/larryv/dports/lang/rust:103862-104051
Modified: trunk/dports/lang/rust/Portfile
===================================================================
--- trunk/dports/lang/rust/Portfile 2013-03-14 05:41:30 UTC (rev 104051)
+++ trunk/dports/lang/rust/Portfile 2013-03-14 06:14:14 UTC (rev 104052)
@@ -2,59 +2,156 @@
# $Id$
PortSystem 1.0
+PortGroup compiler_blacklist_versions 1.0
name rust
version 0.5
-revision 2
+revision 3
categories lang devel
platforms darwin
supported_archs i386 x86_64
+# https://github.com/mozilla/rust/issues/2024
+universal_variant no
license {MIT Apache-2} BSD zlib NCSA Permissive
-maintainers g5pw openmaintainer
+maintainers g5pw larryv
-description Compiler for the Rust programming language
-long_description This is a compiler for Rust, including standard \
- libraries, tools and documentation.
-homepage http://www.rust-lang.org
+description A safe, concurrent, practical language
+long_description Rust is a curly-brace, block-structured expression \
+ language. It visually resembles the C language \
+ family, but differs significantly in syntactic and \
+ semantic details. Its design is oriented toward \
+ concerns of “programming in the large”, that is, of \
+ creating and maintaining boundaries — both abstract \
+ and operational — that preserve large-system \
+ integrity, availability and concurrency.
+homepage http://www.rust-lang.org/
-master_sites http://dl.rust-lang.org/dist
-checksums rmd160 b4988da7be984aa1337f4076e96e6d0c72e3170d \
- sha256 d326d22707f0562d669c11efbc33ae812ddbf76ab78f07087fc5beb095a8928a
-patchfiles patch-configure.diff
-post-patch {
- reinplace "s/__BUILD_ARCH__/${configure.build_arch}/g" \
- ${worksrcpath}/configure
+# Select the snapshot compiler; see src/snapshots.txt in distribution.
+set stage0(date) 2012-12-19
+set stage0(rev) 8554d5e
+set stage0(platform) macos-${configure.build_arch}
+switch ${configure.build_arch} {
+ x86_64 {
+ set stage0(hash) e4564933f11b17f7dbd25b61032233693da21dc5
+ set stage0(rmd160) 3d966bd2d17e3f2c74ed78f3674439c89d5a16ee
+ set stage0(sha256) a2e287a683128e2e213e11c5b9f92e5e628eb63163591d61523549deb2e21f7d
+ }
+ i386 {
+ set stage0(hash) 151ff211c01f0b7a1895b93ff0bc021bf1472346
+ set stage0(rmd160) 300b17458073a8704817821bd5406189a264f765
+ set stage0(sha256) 5e598d4c45ee2dd8b7f2b69d92f60d16e57991e796d76ca255a612357a5e48e0
+ }
}
+set stage0(distfile) [join "rust stage0 ${stage0(date)} ${stage0(rev)}
+ ${stage0(platform)} ${stage0(hash)}" -].tar.bz2
+set stage0(distdir) rust-stage0
-configure.args --disable-docs
+master_sites http://dl.rust-lang.org/dist:dist \
+ http://static.rust-lang.org/stage0-snapshots:stage0
+distfiles ${distname}${extract.suffix}:dist \
+ ${stage0(distfile)}:stage0
+checksums ${distname}${extract.suffix} \
+ rmd160 b4988da7be984aa1337f4076e96e6d0c72e3170d \
+ sha256 d326d22707f0562d669c11efbc33ae812ddbf76ab78f07087fc5beb095a8928a \
+ ${stage0(distfile)} \
+ rmd160 ${stage0(rmd160)} \
+ sha256 ${stage0(sha256)}
+
+depends_extract bin:bzip2:bzip2
+extract.only-delete ${stage0(distfile)}
+post-extract {
+ set expand "bzip2 -dc ${distpath}/${stage0(distfile)}"
+ set untar "${portutil::autoconf::tar_command} -xf -"
+ system -W ${workpath} "${expand} | ${untar}"
+}
+
+# Upstream only supports gcc 4.4 and newer and clang based on LLVM
+# 3.0svn and newer. The clang restriction could probably be tighter;
+# clang-77 is Apple Clang 1.7 (LLVM 2.9svn) from Xcode 3.2.6.
compiler.blacklist gcc-3.3 gcc-4.0 gcc-4.2 \
apple-gcc-4.0 apple-gcc-4.2 \
llvm-gcc-4.2 macports-llvm-gcc-4.2 \
macports-gcc-4.2 macports-gcc-4.3 \
- macports-clang-2.9
+ {clang <= 77} macports-clang-2.9
+# TODO: Remove when base fallback lists are updated (2.2?).
+compiler.fallback-append macports-clang-3.2
-# Use MacPorts' clang as fallback compiler.
-# TODO: Remove when base fallback lists are updated (2.2?).
-compiler.fallback-append macports-clang-3.2
-if {${configure.compiler} == "macports-clang-3.2"} {
- depends_build-append port:clang-3.2
- depends_skip_archcheck-append clang-3.2
+patch.pre_args -p1
+patchfiles patch-configure.diff \
+ patch-src-etc-local_stage0.sh.diff \
+ patch-src-librusti-rusti.rc.diff \
+ patch-src-rustllvm-RustWrapper.cpp.diff
+# Non-Apple GCC - and, by extension, DragonEgg - accepts neither
+# -Wnewline-eof (https://github.com/mozilla/rust/issues/4783)
+# nor -arch (until 4.7).
+if {[string first clang ${configure.compiler}] == -1} {
+ patchfiles-append patch-non_apple_gcc.diff
}
+post-patch {
+ reinplace "s/__BUILD_ARCH__/${configure.build_arch}/g" \
+ ${worksrcpath}/configure
+}
-if {[string match *clang* ${configure.compiler}]} {
+# Using MacPorts' LLVM currently results in a stage2 compiler that
+# segfaults during the build (with llvm-3.2, at least); until we fix
+# this, we need Python. The weird dependency is to accommodate older
+# systems that only have Python 2.6; if we have to provide our own, we'd
+# rather install 2.7. The build itself will detect either.
+depends_build bin:perl:perl5 \
+ bin:python2.6:python27
+depends_skip_archcheck python27
+
+# TODO: Remove when automatic compiler dependencies are released (2.2?).
+if {[info exists portconfigure::compiler_name_map(${configure.compiler})]} {
+ set compiler $portconfigure::compiler_name_map(${configure.compiler})
+ if {[string first macports-gcc- ${configure.compiler}] == 0} {
+ depends_lib-append port:${compiler}
+ } else {
+ depends_build-append port:${compiler}
+ }
+ if {[portconfigure::arch_flag_supported ${configure.compiler}]} {
+ depends_skip_archcheck-append ${compiler}
+ }
+}
+
+configure.args --disable-docs \
+ --enable-local-rust \
+ --local-rust-root=${workpath}/${stage0(distdir)}
+if {[string first clang ${configure.compiler}] != -1} {
configure.args-append --enable-clang
}
-configure.universal_args-delete \
- --disable-dependency-tracking
-
-# There's a makefile that ignores the configure script CC options, this makes \
-# it behave.
-build.args-append CC=${configure.cc} \
+build.type gnu
+build.args VERBOSE=1 \
+ CC=${configure.cc} \
CXX=${configure.cxx} \
- CPP=${configure.cpp}
+ CPP="${configure.cc} -E"
-livecheck.url ${homepage}/
-livecheck.regex "/release-(\\d\.\\d)/"
+test.run yes
+test.target check
+test.env VERBOSE=1
+
+destroot.args VERBOSE=1
+post-destroot {
+ foreach dir {after/syntax ftdetect indent syntax} {
+ xinstall -d ${destroot}${prefix}/share/vim/vimfiles/${dir}
+ xinstall -m 644 ${worksrcpath}/src/etc/vim/${dir}/rust.vim \
+ ${destroot}${prefix}/share/vim/vimfiles/${dir}
+ }
+ xinstall -d ${destroot}${prefix}/share/${name}
+ xinstall -m 644 ${worksrcpath}/src/etc/ctags.rust \
+ ${destroot}${prefix}/share/${name}
+
+ # Remove zero-byte libraries until
+ # https://github.com/mozilla/rust/issues/4468 is resolved.
+ delete ${destroot}${prefix}/lib/libcargo.dylib \
+ ${destroot}${prefix}/lib/librustc.dylib \
+ ${destroot}${prefix}/lib/librustdoc.dylib \
+ ${destroot}${prefix}/lib/librusti.dylib
+}
+
+livecheck.type regex
+livecheck.url ${homepage}
+livecheck.regex {/release-(\d\.\d)/}
Modified: trunk/dports/lang/rust/files/patch-configure.diff
===================================================================
--- trunk/dports/lang/rust/files/patch-configure.diff 2013-03-14 05:41:30 UTC (rev 104051)
+++ trunk/dports/lang/rust/files/patch-configure.diff 2013-03-14 06:14:14 UTC (rev 104052)
@@ -1,6 +1,8 @@
---- configure.orig 2012-12-18 18:29:12.000000000 -0500
-+++ configure 2013-03-08 20:04:05.000000000 -0500
-@@ -234,17 +234,7 @@
+diff --git a/configure b/configure
+index f2afa2d..e6c859f 100755
+--- a/configure
++++ b/configure
+@@ -234,17 +234,7 @@ need_cmd sed
msg "inspecting environment"
CFG_OSTYPE=$(uname -s)
@@ -19,7 +21,16 @@
# The goal here is to come up with the same triple as LLVM would,
# at least for the subset of platforms we're willing to target.
-@@ -382,8 +372,10 @@
+@@ -363,7 +353,7 @@ fi
+ step_msg "looking for build programs"
+
+ probe_need CFG_PERL perl
+-probe_need CFG_CURL curl
++probe CFG_CURL curl
+ probe_need CFG_PYTHON python2.7 python2.6 python2 python
+
+ python_version=$($CFG_PYTHON -V 2>&1)
+@@ -382,8 +372,10 @@ else
probe_need CFG_GIT git
fi
@@ -32,12 +43,21 @@
probe CFG_LD ld
probe CFG_LLVM_CONFIG llvm-config
probe CFG_VALGRIND valgrind
-@@ -516,7 +508,7 @@
+@@ -494,7 +486,7 @@ then
+ LLVM_VERSION=$($LLVM_CONFIG --version)
+
+ case $LLVM_VERSION in
+- (3.1svn|3.1|3.0svn|3.0)
++ (3.?svn|3.?)
+ msg "found ok version of LLVM: $LLVM_VERSION"
+ ;;
+ (*)
+@@ -516,7 +508,7 @@ then
| cut -d ' ' -f 2)
case $CFG_CLANG_VERSION in
- (3.0svn | 3.0 | 3.1 | 4.0 | 4.1)
-+ (3.0svn | 3.0 | 3.1 | 3.2 | 4.0 | 4.1)
++ (3.0svn | 3.? | 4.?)
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
CFG_C_COMPILER="clang"
;;
Copied: trunk/dports/lang/rust/files/patch-non_apple_gcc.diff (from rev 104051, users/larryv/dports/lang/rust/files/patch-non_apple_gcc.diff)
===================================================================
--- trunk/dports/lang/rust/files/patch-non_apple_gcc.diff (rev 0)
+++ trunk/dports/lang/rust/files/patch-non_apple_gcc.diff 2013-03-14 06:14:14 UTC (rev 104052)
@@ -0,0 +1,159 @@
+diff --git a/mk/libuv/ia32/mac/src/libuv/run-benchmarks.target.mk b/mk/libuv/ia32/mac/src/libuv/run-benchmarks.target.mk
+index b8cc0a1..b72d2da 100644
+--- a/mk/libuv/ia32/mac/src/libuv/run-benchmarks.target.mk
++++ b/mk/libuv/ia32/mac/src/libuv/run-benchmarks.target.mk
+@@ -14,8 +14,7 @@ DEFS_Debug := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Debug := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch i386 \
++ -m32 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+@@ -49,8 +48,7 @@ DEFS_Release := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Release := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch i386 \
++ -m32 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+diff --git a/mk/libuv/ia32/mac/src/libuv/run-tests.target.mk b/mk/libuv/ia32/mac/src/libuv/run-tests.target.mk
+index be0c2c6..c48674e 100644
+--- a/mk/libuv/ia32/mac/src/libuv/run-tests.target.mk
++++ b/mk/libuv/ia32/mac/src/libuv/run-tests.target.mk
+@@ -14,8 +14,7 @@ DEFS_Debug := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Debug := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch i386 \
++ -m32 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+@@ -49,8 +48,7 @@ DEFS_Release := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Release := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch i386 \
++ -m32 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+diff --git a/mk/libuv/ia32/mac/src/libuv/uv.target.mk b/mk/libuv/ia32/mac/src/libuv/uv.target.mk
+index 9838606..427fca2 100644
+--- a/mk/libuv/ia32/mac/src/libuv/uv.target.mk
++++ b/mk/libuv/ia32/mac/src/libuv/uv.target.mk
+@@ -17,8 +17,7 @@ DEFS_Debug := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Debug := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch i386 \
++ -m32 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+@@ -59,8 +58,7 @@ DEFS_Release := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Release := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch i386 \
++ -m32 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+diff --git a/mk/libuv/x86_64/mac/src/libuv/run-benchmarks.target.mk b/mk/libuv/x86_64/mac/src/libuv/run-benchmarks.target.mk
+index f5930c9..8734156 100644
+--- a/mk/libuv/x86_64/mac/src/libuv/run-benchmarks.target.mk
++++ b/mk/libuv/x86_64/mac/src/libuv/run-benchmarks.target.mk
+@@ -14,8 +14,7 @@ DEFS_Debug := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Debug := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch x86_64 \
++ -m64 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+@@ -49,8 +48,7 @@ DEFS_Release := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Release := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch x86_64 \
++ -m64 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+diff --git a/mk/libuv/x86_64/mac/src/libuv/run-tests.target.mk b/mk/libuv/x86_64/mac/src/libuv/run-tests.target.mk
+index 4694c7c..fc93deb 100644
+--- a/mk/libuv/x86_64/mac/src/libuv/run-tests.target.mk
++++ b/mk/libuv/x86_64/mac/src/libuv/run-tests.target.mk
+@@ -14,8 +14,7 @@ DEFS_Debug := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Debug := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch x86_64 \
++ -m64 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+@@ -49,8 +48,7 @@ DEFS_Release := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Release := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch x86_64 \
++ -m64 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+diff --git a/mk/libuv/x86_64/mac/src/libuv/uv.target.mk b/mk/libuv/x86_64/mac/src/libuv/uv.target.mk
+index 385a64c..6a348a1 100644
+--- a/mk/libuv/x86_64/mac/src/libuv/uv.target.mk
++++ b/mk/libuv/x86_64/mac/src/libuv/uv.target.mk
+@@ -17,8 +17,7 @@ DEFS_Debug := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Debug := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch x86_64 \
++ -m64 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+@@ -59,8 +58,7 @@ DEFS_Release := '-D_LARGEFILE_SOURCE' \
+ CFLAGS_Release := -Os \
+ -gdwarf-2 \
+ -fvisibility=hidden \
+- -Wnewline-eof \
+- -arch x86_64 \
++ -m64 \
+ -fno-strict-aliasing \
+ -Wall \
+ -Wendif-labels \
+diff --git a/mk/platform.mk b/mk/platform.mk
+index d2f8745..12fb7e2 100644
+--- a/mk/platform.mk
++++ b/mk/platform.mk
+@@ -101,8 +101,8 @@ ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
+ # approaches welcome!
+ #
+ # NB: Currently GCC's optimizer breaks rustrt (task-comm-1 hangs) on Darwin.
+- CFG_GCCISH_CFLAGS_i386 := -m32 -arch i386
+- CFG_GCCISH_CFLAGS_x86_64 := -m64 -arch x86_64
++ CFG_GCCISH_CFLAGS_i386 := -m32
++ CFG_GCCISH_CFLAGS_x86_64 := -m64
+ CFG_GCCISH_LINK_FLAGS_i386 := -m32
+ CFG_GCCISH_LINK_FLAGS_x86_64 := -m64
+ CFG_DSYMUTIL := dsymutil
Copied: trunk/dports/lang/rust/files/patch-src-etc-local_stage0.sh.diff (from rev 104051, users/larryv/dports/lang/rust/files/patch-src-etc-local_stage0.sh.diff)
===================================================================
--- trunk/dports/lang/rust/files/patch-src-etc-local_stage0.sh.diff (rev 0)
+++ trunk/dports/lang/rust/files/patch-src-etc-local_stage0.sh.diff 2013-03-14 06:14:14 UTC (rev 104052)
@@ -0,0 +1,24 @@
+From 1d315aac4403f22274fceab3e22ec1cdb95bad78 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lawrence=20Vela=CC=81zquez?= <larryv at alum.mit.edu>
+Date: Tue, 12 Mar 2013 03:34:14 -0400
+Subject: [PATCH] Copy libsyntax from local Rust to stage0.
+
+The local_stage0 script was not updated after commit 7dcbaed renamed
+librustsyntax to libsyntax, so builds using local Rust fail due to
+missing libsyntax.
+---
+ src/etc/local_stage0.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
+index e4d7b61..5898bc5 100755
+--- a/src/etc/local_stage0.sh
++++ b/src/etc/local_stage0.sh
+@@ -46,3 +46,4 @@ cp ${PREFIX}/lib/rustc/${TARG_DIR}/${LIBDIR}/* ${TARG_DIR}/stage0/${LIBDIR}/
+ cp ${PREFIX}/lib/librust*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
+ cp ${PREFIX}/lib/libcore*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
+ cp ${PREFIX}/lib/libstd*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
++cp ${PREFIX}/lib/libsyntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIBDIR}/
+--
+1.7.10
+
Copied: trunk/dports/lang/rust/files/patch-src-librusti-rusti.rc.diff (from rev 104051, users/larryv/dports/lang/rust/files/patch-src-librusti-rusti.rc.diff)
===================================================================
--- trunk/dports/lang/rust/files/patch-src-librusti-rusti.rc.diff (rev 0)
+++ trunk/dports/lang/rust/files/patch-src-librusti-rusti.rc.diff 2013-03-14 06:14:14 UTC (rev 104052)
@@ -0,0 +1,26 @@
+From 9bf87bbf66227c132283ae59720f919601de9a56 Mon Sep 17 00:00:00 2001
+From: Patrick Walton <pcwalton at mimiga.net>
+Date: Fri, 21 Dec 2012 22:38:45 -0500
+Subject: [PATCH] rusti: Perform mode computation. Closes #4230.
+
+---
+ src/librusti/rusti.rc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/librusti/rusti.rc b/src/librusti/rusti.rc
+index 906735d..80eedbb 100644
+--- a/src/librusti/rusti.rc
++++ b/src/librusti/rusti.rc
+@@ -246,6 +246,9 @@ fn run(repl: Repl, input: ~str) -> Repl {
+ debug!("loop checking");
+ middle::check_loop::check_crate(ty_cx, crate);
+
++ debug!("mode computation");
++ middle::mode::compute_modes(ty_cx, method_map, crate);
++
+ debug!("alt checking");
+ middle::check_alt::check_crate(ty_cx, method_map, crate);
+
+--
+1.7.10
+
Copied: trunk/dports/lang/rust/files/patch-src-rustllvm-RustWrapper.cpp.diff (from rev 104051, users/larryv/dports/lang/rust/files/patch-src-rustllvm-RustWrapper.cpp.diff)
===================================================================
--- trunk/dports/lang/rust/files/patch-src-rustllvm-RustWrapper.cpp.diff (rev 0)
+++ trunk/dports/lang/rust/files/patch-src-rustllvm-RustWrapper.cpp.diff 2013-03-14 06:14:14 UTC (rev 104052)
@@ -0,0 +1,30 @@
+From 3ee1d3ebb81de199fc630a86933ac18c0a869482 Mon Sep 17 00:00:00 2001
+From: Patrick Walton <pcwalton at mimiga.net>
+Date: Sat, 22 Dec 2012 16:24:19 -0500
+Subject: [PATCH] rustllvm: Fix symbol resolution on Mac for rusti. rs=bugfix
+
+---
+ src/rustllvm/RustWrapper.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
+index 86a302e..bb00f04 100644
+--- a/src/rustllvm/RustWrapper.cpp
++++ b/src/rustllvm/RustWrapper.cpp
+@@ -290,6 +290,13 @@ void *RustMCJITMemoryManager::getPointerToNamedFunction(const std::string &Name,
+ void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
+ if (Ptr) return Ptr;
+
++ // If it wasn't found and if it starts with an underscore ('_') character,
++ // try again without the underscore.
++ if (NameStr[0] == '_') {
++ Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr+1);
++ if (Ptr) return Ptr;
++ }
++
+ if (AbortOnFailure)
+ report_fatal_error("Program used external function '" + Name +
+ "' which could not be resolved!");
+--
+1.7.10
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130313/2f9ceae0/attachment-0001.html>
More information about the macports-changes
mailing list