Skip to content

Enable 64-bit checked multiplication on 32-bit #12276

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

Merged
merged 1 commit into from
Feb 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,13 +1122,6 @@ fn link_args(sess: Session,
args.push(~"-Wl,--allow-multiple-definition");
}

// Stack growth requires statically linking a __morestack function
args.push(~"-lmorestack");
// compiler-rt contains implementations of low-level LLVM helpers
// It should go before platform and user libraries, so it has first dibs
// at resolving symbols that also appear in libgcc.
args.push(~"-lcompiler-rt");

add_local_native_libraries(&mut args, sess);
add_upstream_rust_crates(&mut args, sess, dylib, tmpdir);
add_upstream_native_libraries(&mut args, sess);
Expand Down Expand Up @@ -1163,6 +1156,13 @@ fn link_args(sess: Session,
args.push_all(rpath::get_rpath_flags(sess, out_filename));
}

// Stack growth requires statically linking a __morestack function
args.push(~"-lmorestack");
// compiler-rt contains implementations of low-level LLVM helpers
// It should go before platform and user libraries, so it has first dibs
// at resolving symbols that also appear in libgcc.
args.push(~"-lcompiler-rt");

// Finally add all the linker arguments provided on the command line along
// with any #[link_args] attributes found inside the crate
args.push_all(sess.opts.cg.link_args);
Expand Down
2 changes: 0 additions & 2 deletions src/libstd/num/i64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ impl CheckedSub for i64 {
}
}

// FIXME: #8449: should not be disabled on 32-bit
#[cfg(target_word_size = "64")]
impl CheckedMul for i64 {
#[inline]
fn checked_mul(&self, v: &i64) -> Option<i64> {
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ pub trait Int: Integer
+ Bitwise
+ CheckedAdd
+ CheckedSub
// + CheckedMul // FIXME #8849: currently not impled on 32-bit
+ CheckedMul
+ CheckedDiv {}

/// Returns the smallest power of 2 greater than or equal to `n`.
Expand Down
2 changes: 0 additions & 2 deletions src/libstd/num/u64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ impl CheckedSub for u64 {
}
}

// FIXME: #8449: should not be disabled on 32-bit
#[cfg(target_word_size = "64")]
impl CheckedMul for u64 {
#[inline]
fn checked_mul(&self, v: &u64) -> Option<u64> {
Expand Down