about summary refs log tree commit diff
path: root/src/librustpkg
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-11-06 15:16:04 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-11-11 10:40:34 -0800
commit7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff (patch)
treec00e95dee93195cb7744c4a37ea1d4d438db9456 /src/librustpkg
parent4059b5c4b3b8a57a645982b0770d25f0283dfb06 (diff)
Remove #[fixed_stack_segment] and #[rust_stack]
These two attributes are no longer useful now that Rust has decided to leave
segmented stacks behind. It is assumed that the rust task's stack is always
large enough to make an FFI call (due to the stack being very large).

There's always the case of stack overflow, however, to consider. This does not
change the behavior of stack overflow in Rust. This is still normally triggered
by the __morestack function and aborts the whole process.

C stack overflow will continue to corrupt the stack, however (as it did before
this commit as well). The future improvement of a guard page at the end of every
rust stack is still unimplemented and is intended to be the mechanism through
which we attempt to detect C stack overflow.

Closes #8822
Closes #10155
Diffstat (limited to 'src/librustpkg')
-rw-r--r--src/librustpkg/path_util.rs2
-rw-r--r--src/librustpkg/tests.rs6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs
index 949efacaa11..56cf073cbdf 100644
--- a/src/librustpkg/path_util.rs
+++ b/src/librustpkg/path_util.rs
@@ -462,7 +462,6 @@ pub fn versionize(p: &Path, v: &Version) -> Path {
 
 #[cfg(target_os = "win32")]
 pub fn chmod_read_only(p: &Path) -> bool {
-    #[fixed_stack_segment];
     unsafe {
         do p.with_c_str |src_buf| {
             libc::chmod(src_buf, S_IRUSR as libc::c_int) == 0 as libc::c_int
@@ -472,7 +471,6 @@ pub fn chmod_read_only(p: &Path) -> bool {
 
 #[cfg(not(target_os = "win32"))]
 pub fn chmod_read_only(p: &Path) -> bool {
-    #[fixed_stack_segment];
     unsafe {
         do p.with_c_str |src_buf| {
             libc::chmod(src_buf, S_IRUSR as libc::mode_t) == 0
diff --git a/src/librustpkg/tests.rs b/src/librustpkg/tests.rs
index 4460d1701b5..b65e1b7ba02 100644
--- a/src/librustpkg/tests.rs
+++ b/src/librustpkg/tests.rs
@@ -2319,7 +2319,7 @@ fn test_c_dependency_ok() {
     let dir = dir.path();
     writeFile(&dir.join_many(["src", "cdep-0.1", "main.rs"]),
               "#[link_args = \"-lfoo\"]\nextern { fn f(); } \
-              \n#[fixed_stack_segment]\nfn main() { unsafe { f(); } }");
+              \nfn main() { unsafe { f(); } }");
     writeFile(&dir.join_many(["src", "cdep-0.1", "foo.c"]), "void f() {}");
 
     debug!("dir = {}", dir.display());
@@ -2340,7 +2340,7 @@ fn test_c_dependency_no_rebuilding() {
     let dir = dir.path();
     writeFile(&dir.join_many(["src", "cdep-0.1", "main.rs"]),
               "#[link_args = \"-lfoo\"]\nextern { fn f(); } \
-              \n#[fixed_stack_segment]\nfn main() { unsafe { f(); } }");
+              \nfn main() { unsafe { f(); } }");
     writeFile(&dir.join_many(["src", "cdep-0.1", "foo.c"]), "void f() {}");
 
     debug!("dir = {}", dir.display());
@@ -2371,7 +2371,7 @@ fn test_c_dependency_yes_rebuilding() {
     let dir = dir.path();
     writeFile(&dir.join_many(["src", "cdep-0.1", "main.rs"]),
               "#[link_args = \"-lfoo\"]\nextern { fn f(); } \
-              \n#[fixed_stack_segment]\nfn main() { unsafe { f(); } }");
+              \nfn main() { unsafe { f(); } }");
     let c_file_name = dir.join_many(["src", "cdep-0.1", "foo.c"]);
     writeFile(&c_file_name, "void f() {}");