diff options
author | Li-Wen Hsu <lwhsu@FreeBSD.org> | 2013-04-24 13:46:41 +0000 |
---|---|---|
committer | Li-Wen Hsu <lwhsu@FreeBSD.org> | 2013-04-24 13:46:41 +0000 |
commit | 363f864259d97dcace50b6165d7ed6d7e7349b6a (patch) | |
tree | 7bf15438072007443742108775dda3a86af6e375 /lang/rust/files | |
parent | 5f1dca0a1ba8513fb4752caac3d9c9ef7b6354c1 (diff) | |
download | ports-363f864259d97dcace50b6165d7ed6d7e7349b6a.tar.gz ports-363f864259d97dcace50b6165d7ed6d7e7349b6a.zip |
Notes
Diffstat (limited to 'lang/rust/files')
-rw-r--r-- | lang/rust/files/log2.patch | 82 | ||||
-rw-r--r-- | lang/rust/files/patch-configure | 17 | ||||
-rw-r--r-- | lang/rust/files/patch-mk_platform.mk | 38 | ||||
-rw-r--r-- | lang/rust/files/tgammaf.patch | 32 |
4 files changed, 65 insertions, 104 deletions
diff --git a/lang/rust/files/log2.patch b/lang/rust/files/log2.patch index ed0b307f6a66..d6054b3b5ef5 100644 --- a/lang/rust/files/log2.patch +++ b/lang/rust/files/log2.patch @@ -1,48 +1,66 @@ ---- src/libcore/cmath.rs.orig 2012-10-16 21:22:12.704922039 +0800 -+++ src/libcore/cmath.rs 2012-10-16 21:23:23.023337237 +0800 -@@ -56,7 +56,6 @@ - // renamed: to be consitent with log as ln - #[link_name="log1p"] pure fn ln1p(n: c_double) -> c_double; - pure fn log10(n: c_double) -> c_double; -- pure fn log2(n: c_double) -> c_double; - #[link_name="ilogb"] pure fn ilog_radix(n: c_double) -> c_int; - pure fn modf(n: c_double, iptr: &mut c_double) -> c_double; - pure fn pow(n: c_double, e: c_double) -> c_double; -@@ -131,7 +130,6 @@ - #[link_name="logf"] pure fn ln(n: c_float) -> c_float; - #[link_name="logbf"] pure fn log_radix(n: c_float) -> c_float; - #[link_name="log1pf"] pure fn ln1p(n: c_float) -> c_float; -- #[link_name="log2f"] pure fn log2(n: c_float) -> c_float; - #[link_name="log10f"] pure fn log10(n: c_float) -> c_float; - #[link_name="ilogbf"] pure fn ilog_radix(n: c_float) -> c_int; - #[link_name="modff"] pure fn modf(n: c_float, ---- src/libcore/f32.rs.orig 2012-10-16 21:22:27.909922315 +0800 -+++ src/libcore/f32.rs 2012-10-16 21:24:32.932336957 +0800 -@@ -135,7 +135,11 @@ - } +--- src/libcore/num/cmath.rs.orig 2013-04-06 12:52:09.596039132 +0800 ++++ src/libcore/num/cmath.rs 2013-04-06 12:53:24.474452681 +0800 +@@ -64,7 +64,6 @@ + // renamed: to be consitent with log as ln + #[link_name="log1p"] unsafe fn ln1p(n: c_double) -> c_double; + unsafe fn log10(n: c_double) -> c_double; +- unsafe fn log2(n: c_double) -> c_double; + #[link_name="ilogb"] unsafe fn ilog_radix(n: c_double) -> c_int; + unsafe fn modf(n: c_double, iptr: &mut c_double) -> c_double; + unsafe fn pow(n: c_double, e: c_double) -> c_double; +@@ -148,7 +147,6 @@ + #[link_name="logf"] unsafe fn ln(n: c_float) -> c_float; + #[link_name="logbf"] unsafe fn log_radix(n: c_float) -> c_float; + #[link_name="log1pf"] unsafe fn ln1p(n: c_float) -> c_float; +- #[link_name="log2f"] unsafe fn log2(n: c_float) -> c_float; + #[link_name="log10f"] unsafe fn log10(n: c_float) -> c_float; + #[link_name="ilogbf"] unsafe fn ilog_radix(n: c_float) -> c_int; + #[link_name="modff"] unsafe fn modf(n: c_float, +--- src/libcore/num/f32.rs.orig 2013-04-06 12:52:15.395037527 +0800 ++++ src/libcore/num/f32.rs 2013-04-06 13:00:55.623679761 +0800 +@@ -81,7 +81,6 @@ + cmath::c_float_utils::log_radix) + delegate!(fn ln1p(n: c_float) -> c_float = cmath::c_float_utils::ln1p) + delegate!(fn log10(n: c_float) -> c_float = cmath::c_float_utils::log10) +-delegate!(fn log2(n: c_float) -> c_float = cmath::c_float_utils::log2) + delegate!(fn ilog_radix(n: c_float) -> c_int = + cmath::c_float_utils::ilog_radix) + delegate!(fn modf(n: c_float, iptr: &mut c_float) -> c_float = +@@ -254,7 +253,12 @@ - pub pure fn logarithm(n: f32, b: f32) -> f32 { + #[inline(always)] + pub fn logarithm(n: f32, b: f32) -> f32 { - return log2(n) / log2(b); + return ln(n) / ln(b); +} + -+pub pure fn log2(n: f32) -> f32 { ++#[inline(always)] ++pub fn log2(n: f32) -> f32 { + return ln(n) / consts::ln_2; } - impl f32: num::Num { ---- src/libcore/f64.rs.orig 2012-10-16 21:22:34.895921647 +0800 -+++ src/libcore/f64.rs 2012-10-16 21:25:30.466586496 +0800 -@@ -154,7 +154,11 @@ - } + #[cfg(notest)] +--- src/libcore/num/f64.rs.orig 2013-04-06 12:52:25.866037307 +0800 ++++ src/libcore/num/f64.rs 2013-04-06 13:02:33.051357016 +0800 +@@ -82,7 +82,6 @@ + cmath::c_double_utils::log_radix) + delegate!(fn ln1p(n: c_double) -> c_double = cmath::c_double_utils::ln1p) + delegate!(fn log10(n: c_double) -> c_double = cmath::c_double_utils::log10) +-delegate!(fn log2(n: c_double) -> c_double = cmath::c_double_utils::log2) + delegate!(fn ilog_radix(n: c_double) -> c_int = + cmath::c_double_utils::ilog_radix) + delegate!(fn modf(n: c_double, iptr: &mut c_double) -> c_double = +@@ -276,7 +275,12 @@ - pub pure fn logarithm(n: f64, b: f64) -> f64 { + #[inline(always)] + pub fn logarithm(n: f64, b: f64) -> f64 { - return log2(n) / log2(b); + return ln(n) / ln(b); +} + -+pub pure fn log2(n: f64) -> f64 { ++#[inline(always)] ++pub fn log2(n: f64) -> f64 { + return ln(n) / consts::ln_2; } - impl f64: num::Num { + #[cfg(notest)] diff --git a/lang/rust/files/patch-configure b/lang/rust/files/patch-configure index da7744e5f074..ba22d3f04a97 100644 --- a/lang/rust/files/patch-configure +++ b/lang/rust/files/patch-configure @@ -1,6 +1,6 @@ ---- configure.orig 2012-12-19 07:29:12.000000000 +0800 -+++ configure 2012-12-24 20:52:33.524922231 +0800 -@@ -363,7 +363,6 @@ +--- configure.orig 2013-04-06 12:44:15.918202587 +0800 ++++ configure 2013-04-06 12:45:10.302044128 +0800 +@@ -401,7 +401,6 @@ step_msg "looking for build programs" probe_need CFG_PERL perl @@ -8,7 +8,7 @@ probe_need CFG_PYTHON python2.7 python2.6 python2 python python_version=$($CFG_PYTHON -V 2>&1) -@@ -472,15 +471,6 @@ +@@ -511,15 +510,6 @@ fi fi @@ -24,12 +24,3 @@ if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ] then err "either clang or gcc is required" -@@ -516,7 +506,7 @@ - | 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) - step_msg "found ok version of CLANG: $CFG_CLANG_VERSION" - CFG_C_COMPILER="clang" - ;; diff --git a/lang/rust/files/patch-mk_platform.mk b/lang/rust/files/patch-mk_platform.mk index e699a662bcef..7aafd3ac0abc 100644 --- a/lang/rust/files/patch-mk_platform.mk +++ b/lang/rust/files/patch-mk_platform.mk @@ -1,27 +1,11 @@ ---- mk/platform.mk.orig 2012-12-25 08:33:07.971922333 +0800 -+++ mk/platform.mk 2012-12-25 08:33:16.996994081 +0800 -@@ -222,7 +222,7 @@ - ifeq ($(origin CPP),default) - CPP=clang -E - endif -- CFG_GCCISH_CFLAGS += -Wall -Werror -g -+ CFG_GCCISH_CFLAGS += -Wall -g - CFG_GCCISH_CXXFLAGS += -fno-rtti - CFG_GCCISH_LINK_FLAGS += -g - # These flags will cause the compiler to produce a .d file -@@ -268,7 +268,7 @@ - ifeq ($(origin CPP),default) - CPP=gcc -E - endif -- CFG_GCCISH_CFLAGS += -Wall -Werror -g -+ CFG_GCCISH_CFLAGS += -Wall -g - CFG_GCCISH_CXXFLAGS += -fno-rtti - CFG_GCCISH_LINK_FLAGS += -g - # These flags will cause the compiler to produce a .d file -@@ -322,4 +322,4 @@ - endef - - $(foreach target,$(CFG_TARGET_TRIPLES),\ -- $(eval $(call CFG_MAKE_ASSEMBLER,$(target)))) -\ No newline at end of file -+ $(eval $(call CFG_MAKE_ASSEMBLER,$(target)))) +--- mk/platform.mk.orig 2013-04-06 12:47:35.924036199 +0800 ++++ mk/platform.mk 2013-04-06 12:48:04.696038055 +0800 +@@ -299,7 +299,7 @@ + CFG_LIB_NAME_x86_64-unknown-freebsd=lib$(1).so + CFG_LIB_GLOB_x86_64-unknown-freebsd=lib$(1)-*.so + CFG_LIB_DSYM_GLOB_x86_64-unknown-freebsd=$(1)-*.dylib.dSYM +-CFG_GCCISH_CFLAGS_x86_64-unknown-freebsd := -Wall -Werror -g -fPIC -I/usr/local/include ++CFG_GCCISH_CFLAGS_x86_64-unknown-freebsd := -Wall -g -fPIC -I/usr/local/include + CFG_GCCISH_LINK_FLAGS_x86_64-unknown-freebsd := -shared -fPIC -g -lpthread -lrt + CFG_GCCISH_DEF_FLAG_x86_64-unknown-freebsd := -Wl,--export-dynamic,--dynamic-list= + CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-freebsd := -Wl,-whole-archive diff --git a/lang/rust/files/tgammaf.patch b/lang/rust/files/tgammaf.patch deleted file mode 100644 index ec35761daf40..000000000000 --- a/lang/rust/files/tgammaf.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- src/libcore/cmath.rs.orig 2012-10-16 21:27:43.459921547 +0800 -+++ src/libcore/cmath.rs 2012-10-16 21:27:59.451920798 +0800 -@@ -145,7 +145,6 @@ - #[link_name="sqrtf"] pure fn sqrt(n: c_float) -> c_float; - #[link_name="tanf"] pure fn tan(n: c_float) -> c_float; - #[link_name="tanhf"] pure fn tanh(n: c_float) -> c_float; -- #[link_name="tgammaf"] pure fn tgamma(n: c_float) -> c_float; - #[link_name="truncf"] pure fn trunc(n: c_float) -> c_float; - } - ---- src/libcore/f32.rs.orig 2012-10-16 21:27:50.924920698 +0800 -+++ src/libcore/f32.rs 2012-10-16 21:30:50.177658387 +0800 -@@ -7,6 +7,8 @@ - pub use cmath::c_float::*; - pub use cmath::c_float_targ_consts::*; - -+priv use cmath::c_double_utils; -+ - // These are not defined inside consts:: for consistency with - // the integer types - -@@ -130,6 +132,10 @@ - pub const ln_10: f32 = 2.30258509299404568401799145468436421_f32; - } - -+pub pure fn tgamma(n: f32) -> f32 { -+ return c_double_utils::tgamma(n as f64) as f32; -+} -+ - pub pure fn signbit(x: f32) -> int { - if is_negative(x) { return 1; } else { return 0; } - } |