Skip to content

Commit 1b4656f

Browse files
committed
Auto merge of #430 - tessel:master, r=posborne
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.
2 parents 9f3f7c2 + 1f2d896 commit 1b4656f

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

src/sys/signal.rs

+34-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub enum Signal {
2828
SIGPIPE = libc::SIGPIPE,
2929
SIGALRM = libc::SIGALRM,
3030
SIGTERM = libc::SIGTERM,
31-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "emscripten"))]
31+
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))]
3232
SIGSTKFLT = libc::SIGSTKFLT,
3333
SIGCHLD = libc::SIGCHLD,
3434
SIGCONT = libc::SIGCONT,
@@ -54,7 +54,7 @@ pub enum Signal {
5454

5555
pub use self::Signal::*;
5656

57-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "emscripten"))]
57+
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), not(target_arch = "mips")))]
5858
const SIGNALS: [Signal; 31] = [
5959
SIGHUP,
6060
SIGINT,
@@ -87,6 +87,38 @@ const SIGNALS: [Signal; 31] = [
8787
SIGIO,
8888
SIGPWR,
8989
SIGSYS];
90+
#[cfg(all(any(target_os = "linux", target_os = "android", target_os = "emscripten"), target_arch = "mips"))]
91+
const SIGNALS: [Signal; 30] = [
92+
SIGHUP,
93+
SIGINT,
94+
SIGQUIT,
95+
SIGILL,
96+
SIGTRAP,
97+
SIGABRT,
98+
SIGBUS,
99+
SIGFPE,
100+
SIGKILL,
101+
SIGUSR1,
102+
SIGSEGV,
103+
SIGUSR2,
104+
SIGPIPE,
105+
SIGALRM,
106+
SIGTERM,
107+
SIGCHLD,
108+
SIGCONT,
109+
SIGSTOP,
110+
SIGTSTP,
111+
SIGTTIN,
112+
SIGTTOU,
113+
SIGURG,
114+
SIGXCPU,
115+
SIGXFSZ,
116+
SIGVTALRM,
117+
SIGPROF,
118+
SIGWINCH,
119+
SIGIO,
120+
SIGPWR,
121+
SIGSYS];
90122
#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "emscripten")))]
91123
const SIGNALS: [Signal; 31] = [
92124
SIGHUP,

0 commit comments

Comments
 (0)