Skip to content

Commit

Permalink
Auto merge of #430 - tessel:master, r=posborne
Browse files Browse the repository at this point in the history
Removes SIGSTKFLT when cross-compiling to MIPS.

This is the only failing error when cross compiling to Tessel, which is a MIPS-based architecture.

Apparently libc does not have SIGSTKFLT (Term Stack fault on coprocessor) on this system, and indeed it does not have a coprocessor.

This commit should preserve the semantics for all other architectures. Potentially this can be inverted in the future if more platforms are added to only *whitelist* ARM, x86, x86_64, but I thought this conditional would suffice.
  • Loading branch information
homu committed Sep 19, 2016
2 parents 9f3f7c2 + 1f2d896 commit 1b4656f
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub enum Signal {
SIGPIPE = libc::SIGPIPE,
SIGALRM = libc::SIGALRM,
SIGTERM = libc::SIGTERM,
#[cfg(any(target_os = "linux", target_os = "android", target_os = "emscripten"))]
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))]
SIGSTKFLT = libc::SIGSTKFLT,
SIGCHLD = libc::SIGCHLD,
SIGCONT = libc::SIGCONT,
Expand All @@ -54,7 +54,7 @@ pub enum Signal {

pub use self::Signal::*;

#[cfg(any(target_os = "linux", target_os = "android", target_os = "emscripten"))]
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))]
const SIGNALS: [Signal; 31] = [
SIGHUP,
SIGINT,
Expand Down Expand Up @@ -87,6 +87,38 @@ const SIGNALS: [Signal; 31] = [
SIGIO,
SIGPWR,
SIGSYS];
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), target_arch = "mips"))]
const SIGNALS: [Signal; 30] = [
SIGHUP,
SIGINT,
SIGQUIT,
SIGILL,
SIGTRAP,
SIGABRT,
SIGBUS,
SIGFPE,
SIGKILL,
SIGUSR1,
SIGSEGV,
SIGUSR2,
SIGPIPE,
SIGALRM,
SIGTERM,
SIGCHLD,
SIGCONT,
SIGSTOP,
SIGTSTP,
SIGTTIN,
SIGTTOU,
SIGURG,
SIGXCPU,
SIGXFSZ,
SIGVTALRM,
SIGPROF,
SIGWINCH,
SIGIO,
SIGPWR,
SIGSYS];
#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "emscripten")))]
const SIGNALS: [Signal; 31] = [
SIGHUP,
Expand Down

0 comments on commit 1b4656f

Please sign in to comment.