Skip to content

Commit c8cecb2

Browse files
committed
---
yaml --- r: 139505 b: refs/heads/try2 c: bd7eb7e h: refs/heads/master i: 139503: 3c43485 v: v3
1 parent 19c57ef commit c8cecb2

File tree

19 files changed

+101
-31
lines changed

19 files changed

+101
-31
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e3327d3833e6b1ea4b23ecd3332b869ce82f1999
8+
refs/heads/try2: bd7eb7e0f906c83228f01c65ec669fb71f7a42df
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,9 +1539,9 @@ for spawning [tasks][tasks].
15391539

15401540
Rust closures have a convenient subtyping property: you can pass any kind of
15411541
closure (as long as the arguments and return types match) to functions
1542-
that expect a `fn()`. Thus, when writing a higher-order function that
1542+
that expect a `&fn()`. Thus, when writing a higher-order function that
15431543
only calls its function argument, and does nothing else with it, you
1544-
should almost always declare the type of that argument as `fn()`. That way,
1544+
should almost always declare the type of that argument as `&fn()`. That way,
15451545
callers may pass any kind of closure.
15461546

15471547
~~~~

branches/try2/mk/install.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ $(foreach target,$(CFG_TARGET_TRIPLES), \
5151
define INSTALL_TARGET_N
5252
install-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
5353
$$(Q)mkdir -p $$(PTL$(1)$(2))
54-
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CFG_RUNTIME_$(1)))
54+
$$(Q)$$(call INSTALL_LIB,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CFG_RUNTIME_$(1)))
5555
$$(Q)$$(call INSTALL_LIB, \
5656
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CORELIB_GLOB_$(1)))
5757
$$(Q)$$(call INSTALL_LIB, \
5858
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(STDLIB_GLOB_$(1)))
59-
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),libmorestack.a)
59+
$$(Q)$$(call INSTALL_LIB,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),libmorestack.a)
6060

6161
endef
6262

6363
define INSTALL_HOST_N
6464
install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
6565
$$(Q)mkdir -p $$(PTL$(1)$(2))
66-
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CFG_RUNTIME_$(1)))
66+
$$(Q)$$(call INSTALL_LIB,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CFG_RUNTIME_$(1)))
6767
$$(Q)$$(call INSTALL_LIB, \
6868
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CORELIB_GLOB_$(1)))
6969
$$(Q)$$(call INSTALL_LIB, \
@@ -80,7 +80,7 @@ install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
8080
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(LIBRUSTI_GLOB_$(1)))
8181
$$(Q)$$(call INSTALL_LIB, \
8282
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(LIBRUST_GLOB_$(1)))
83-
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),libmorestack.a)
83+
$$(Q)$$(call INSTALL_LIB,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),libmorestack.a)
8484

8585
endef
8686

branches/try2/mk/platform.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ ifdef CFG_VALGRIND
6161
endif
6262

6363
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
64-
# -znoexecstack is here because librt is for some reason being created
65-
# with executable stack and Fedora (or SELinux) doesn't like that (#798)
6664
ifdef CFG_PERF
6765
ifneq ($(CFG_PERF_WITH_LOGFD),)
6866
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3 --log-fd 2
@@ -126,7 +124,7 @@ CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-gnu := -fno-rtti
126124
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-gnu := -shared -fPIC -ldl -lpthread -lrt -g -m64
127125
CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
128126
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-whole-archive
129-
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive -Wl,-znoexecstack
127+
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
130128
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
131129
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
132130
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
@@ -152,7 +150,7 @@ CFG_GCCISH_CXXFLAGS_i686-unknown-linux-gnu := -fno-rtti
152150
CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-gnu := -shared -fPIC -ldl -lpthread -lrt -g -m32
153151
CFG_GCCISH_DEF_FLAG_i686-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
154152
CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-whole-archive
155-
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive -Wl,-znoexecstack
153+
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
156154
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
157155
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
158156
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
@@ -228,7 +226,7 @@ CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti
228226
CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi := -shared -fPIC -ldl -g -lm -lsupc++ -lgnustl_shared
229227
CFG_GCCISH_DEF_FLAG_arm-linux-androideabi := -Wl,--export-dynamic,--dynamic-list=
230228
CFG_GCCISH_PRE_LIB_FLAGS_arm-linux-androideabi := -Wl,-whole-archive
231-
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive -Wl,-znoexecstack
229+
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive
232230
CFG_DEF_SUFFIX_arm-linux-androideabi := .android.def
233231
CFG_INSTALL_NAME_arm-linux-androideabi =
234232
CFG_LIBUV_LINK_FLAGS_arm-linux-androideabi =

branches/try2/src/rt/arch/arm/_context.S

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm
@@ -17,12 +22,12 @@ swap_registers:
1722
str r10, [r0, #40]
1823
str r11, [r0, #44]
1924
str r12, [r0, #48]
20-
str sp, [r0, #52]
25+
str sp, [r0, #52]
2126
str lr, [r0, #56]
2227

2328
mrs r2, cpsr
2429
str r2, [r0, #64]
25-
30+
2631

2732
ldr r0, [r1, #0]
2833
ldr r3, [r1, #12]
@@ -35,10 +40,10 @@ swap_registers:
3540
ldr r10, [r1, #40]
3641
ldr r11, [r1, #44]
3742
ldr r12, [r1, #48]
38-
43+
3944
ldr sp, [r1, #52]
4045
ldr lr, [r1, #56]
41-
46+
4247
ldr r2, [r1, #64]
4348
msr cpsr_cxsf, r2
4449

branches/try2/src/rt/arch/arm/ccall.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm
@@ -19,4 +24,3 @@ __morestack:
1924
pop {r4, fp, lr}
2025
mov pc, lr
2126
.fnend
22-

branches/try2/src/rt/arch/arm/morestack.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm

branches/try2/src/rt/arch/arm/record_sp.S

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.code 32
38
.arm
@@ -45,17 +50,17 @@ get_sp_limit:
4550
get_sp:
4651
mov r0, sp
4752
mov pc, lr
48-
53+
4954
.data
5055
my_cpu: .long 0
5156
.global my_array
52-
my_array:
57+
my_array:
58+
.long 0
5359
.long 0
5460
.long 0
5561
.long 0
5662
.long 0
5763
.long 0
5864
.long 0
5965
.long 0
60-
.long 0
6166
.end

branches/try2/src/rt/arch/i386/_context.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27

38
/*

branches/try2/src/rt/arch/i386/ccall.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
The function for switching to the C stack. It is called
38
__morestack because gdb allows any frame with that name to

branches/try2/src/rt/arch/i386/morestack.S

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
__morestack
38
@@ -218,11 +223,11 @@ MORESTACK:
218223
.L$bail:
219224
movl 32(%esp),%eax
220225
inc %eax
221-
226+
222227
addl $44, %esp
223228
popl %ebp
224229
addl $4+8,%esp
225-
230+
226231
jmpl *%eax
227232

228233
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
@@ -241,7 +246,7 @@ L_rust_get_task$stub:
241246
L_upcall_new_stack$stub:
242247
.indirect_symbol _upcall_new_stack
243248
.ascii "\364\364\364\364\364"
244-
249+
245250
L_upcall_del_stack$stub:
246251
.indirect_symbol _upcall_del_stack
247252
.ascii "\364\364\364\364\364"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif

branches/try2/src/rt/arch/mips/_context.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27
.globl swap_registers
38
.align 2

branches/try2/src/rt/arch/mips/ccall.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27

38
.globl __morestack

branches/try2/src/rt/arch/mips/record_sp.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
.text
27

38
.globl record_sp_limit

branches/try2/src/rt/arch/x86_64/_context.S

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
#include "regs.h"
27
#define ARG0 RUSTRT_ARG0_S
38
#define ARG1 RUSTRT_ARG1_S
4-
9+
510
.text
611

712
/*
@@ -11,7 +16,7 @@ and Microsoft discussion at
1116
http://msdn.microsoft.com/en-US/library/9z1stfyw%28v=VS.80%29.aspx.
1217
1318
BOTH CALLING CONVENTIONS
14-
19+
1520
Callee save registers:
1621
R12--R15, RDI, RSI, RBX, RBP, RSP
1722
XMM0--XMM5
@@ -30,7 +35,7 @@ User flags have no specified role and are not preserved
3035
across calls, with the exception of DF in %rFLAGS,
3136
which must be clear (set to "forward" direction)
3237
on function entry and return.
33-
38+
3439
MICROSOFT CALLING CONVENTIONS
3540
3641
Return value: RAX
@@ -39,15 +44,15 @@ First four arguments:
3944
RCX, RDX, R8, R9
4045
XMM0, XMM1, XMM2, XMM3
4146
*/
42-
47+
4348
/*
4449
Stores current registers into arg0/RCX and restores
4550
registers found in arg1/RDX. This is used by our
4651
implementation of getcontext. Only saves/restores nonvolatile
4752
registers and the register used for the first argument.
4853
Volatile registers in general ought to be saved by the caller
4954
anyhow.
50-
*/
55+
*/
5156

5257
#if defined(__APPLE__) || defined(_WIN32)
5358
#define SWAP_REGISTERS _swap_registers

branches/try2/src/rt/arch/x86_64/ccall.S

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
The function for switching to the C stack. It is called
38
__morestack because gdb allows any frame with that name to
@@ -10,7 +15,7 @@
1015
#define ARG0 RUSTRT_ARG0_S
1116
#define ARG1 RUSTRT_ARG1_S
1217
#define ARG2 RUSTRT_ARG2_S
13-
18+
1419
.text
1520

1621
#if defined(__APPLE__) || defined(_WIN32)

branches/try2/src/rt/arch/x86_64/morestack.S

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif
5+
16
/*
27
__morestack
38
@@ -78,7 +83,7 @@ MORESTACK:
7883
movq %r11, %rdx // Size of stack arguments
7984
movq %rax, %rsi // Address of stack arguments
8085
movq %r10, %rdi // The amount of stack needed
81-
86+
8287
#ifdef __APPLE__
8388
call UPCALL_NEW_STACK
8489
#endif
@@ -132,7 +137,7 @@ MORESTACK:
132137
popq %rax // Restore the return value
133138
popq %rbp
134139
ret
135-
140+
136141
.cfi_endproc
137142

138143
#else
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Mark stack as non-executable
2+
#if defined(__linux__) && defined(__ELF__)
3+
.section .note.GNU-stack, "", @progbits
4+
#endif

0 commit comments

Comments
 (0)