Skip to content

Commit 4af51d2

Browse files
author
Elly Jones
committed
---
yaml --- r: 6781 b: refs/heads/master c: 648b69d h: refs/heads/master i: 6779: cb5c3a2 v: v3
1 parent e2af6fd commit 4af51d2

33 files changed

+51
-213
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: bf4efa3a204b54d3467521858321ae6e71e9f2bf
2+
refs/heads/master: 648b69d69229a0a82f09a494a81444a38ba87333

trunk/LICENSE.txt

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -223,32 +223,9 @@ included:
223223
details.
224224

225225

226-
* Additional copyright may be retained by contributors other
227-
than Mozilla or the parties enumerated in this file. Such
228-
copyright can be determined on a case-by-case basis by
229-
examining the author of each portion of a file in the
230-
revision-control commit records of the project, or by
231-
consulting representative comments claiming copyright
232-
ownership for a file.
233-
234-
For example, the text:
235-
236-
"Copyright (c) 2011 Google Inc."
237-
238-
appears in some files, and these files thereby denote
239-
that their author and copyright-holder is Google Inc.
240-
241-
In all such cases, the absence of explicit licensing text
242-
indicates that the contributor chose to license their
243-
work for distribution under identical terms to those
244-
Mozilla has chosen for the collective work, enumerated
245-
below. The only difference is the retention of copyright
246-
itself, held by the contributor.
247-
248-
249226
The remaining code and documentation in the collective work
250227
presented here, as well as the collective work itslf, is
251-
distributed under the following terms ("The Rust License"):
228+
distributed under the following terms:
252229

253230
Copyright (c) 2006-2011 Graydon Hoare
254231
Copyright (c) 2009-2011 Mozilla Foundation

trunk/Makefile.in

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,31 +289,19 @@ ifdef CFG_DISABLE_SHAREDSTD
289289
$$(HLIB$(1)_H_$(3))/libcore.rlib
290290
TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
291291
$$(TLIB$(1)_T_$(2)_H_$(3))/libcore.rlib
292-
293292
HSTDLIB_DEFAULT$(1)_H_$(3) = \
294293
$$(HLIB$(1)_H_$(3))/libstd.rlib
295294
TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
296295
$$(TLIB$(1)_T_$(2)_H_$(3))/libstd.rlib
297-
298-
HLIBRUSTC_DEFAULT$(1)_H_$(3) = \
299-
$$(HLIB$(1)_H_$(3))/librustc.rlib
300-
TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \
301-
$$(TLIB$(1)_T_$(2)_H_$(3))/librustc.rlib
302296
else
303297
HCORELIB_DEFAULT$(1)_H_$(3) = \
304298
$$(HLIB$(1)_H_$(3))/$(CFG_CORELIB)
305299
TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
306300
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_CORELIB)
307-
308301
HSTDLIB_DEFAULT$(1)_H_$(3) = \
309302
$$(HLIB$(1)_H_$(3))/$(CFG_STDLIB)
310303
TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3) = \
311304
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB)
312-
313-
HLIBRUSTC_DEFAULT$(1)_H_$(3) = \
314-
$$(HLIB$(1)_H_$(3))/$(CFG_LIBRUSTC)
315-
TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3) = \
316-
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTC)
317305
endif
318306

319307
# Preqrequisites for using the stageN compiler
@@ -323,7 +311,6 @@ HSREQ$(1)_H_$(3) = \
323311
$$(HLIB$(1)_H_$(3))/$$(CFG_RUSTLLVM) \
324312
$$(HCORELIB_DEFAULT$(1)_H_$(3)) \
325313
$$(HSTDLIB_DEFAULT$(1)_H_$(3)) \
326-
$$(HLIBRUSTC_DEFAULT$(1)_H_$(3)) \
327314
$$(MKFILE_DEPS)
328315

329316
# Prerequisites for using the stageN compiler to build target artifacts
@@ -337,8 +324,7 @@ TSREQ$(1)_T_$(2)_H_$(3) = \
337324
SREQ$(1)_T_$(2)_H_$(3) = \
338325
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
339326
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \
340-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB) \
341-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
327+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB)
342328

343329
ifeq ($(1),0)
344330
# Don't run the the stage0 compiler under valgrind - that ship has sailed

trunk/doc/tutorial/ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ microsecond-resolution timer.
189189
use std;
190190
type timeval = {mutable tv_sec: u32,
191191
mutable tv_usec: u32};
192-
#[nolink]
192+
#[link_name = ""]
193193
native mod libc {
194194
fn gettimeofday(tv: *timeval, tz: *()) -> i32;
195195
}
@@ -199,7 +199,7 @@ microsecond-resolution timer.
199199
ret (x.tv_sec as u64) * 1000_000_u64 + (x.tv_usec as u64);
200200
}
201201

202-
The `#[nolink]` sets the name of the native module to the
202+
The `#[link_name = ""]` sets the name of the native module to the
203203
empty string to prevent the rust compiler from trying to link it.
204204
The standard C library is already linked with Rust programs.
205205

trunk/mk/host.mk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ $$(HLIB$(2)_H_$(4))/libstd.rlib: \
6868
@$$(call E, cp: $$@)
6969
$$(Q)cp $$< $$@
7070

71-
$$(HLIB$(2)_H_$(4))/librustc.rlib: \
72-
$$(TLIB$(1)_T_$(4)_H_$(3))/librustc.rlib \
73-
$$(HLIB$(2)_H_$(4))/libcore.rlib \
74-
$$(HLIB$(2)_H_$(4))/libstd.rlib \
75-
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME)
76-
@$$(call E, cp: $$@)
77-
$$(Q)cp $$< $$@
78-
7971
$$(HLIB$(2)_H_$(4))/$$(CFG_RUSTLLVM): \
8072
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_RUSTLLVM)
8173
@$$(call E, cp: $$@)

trunk/mk/install.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ install-target-$(1)-host-$(2): $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
4040
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(CORELIB_GLOB))
4141
$$(Q)$$(call INSTALL_LIB, \
4242
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(STDLIB_GLOB))
43-
$$(Q)$$(call INSTALL_LIB, \
44-
$$(TL$(1)$(2)),$$(PTL$(1)$(2)),$$(LIBRUSTC_GLOB))
4543
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),intrinsics.bc)
4644
$$(Q)$$(call INSTALL,$$(TL$(1)$(2)),$$(PTL$(1)$(2)),libmorestack.a)
4745
endef
@@ -68,11 +66,9 @@ install-host: $(SREQ$(ISTAGE)_T_$(CFG_HOST_TRIPLE)_H_$(CFG_HOST_TRIPLE))
6866
$(Q)mkdir -p $(PREFIX_LIB)
6967
$(Q)mkdir -p $(PREFIX_ROOT)/share/man/man1
7068
$(Q)$(call INSTALL,$(HB),$(PHB),rustc$(X))
71-
$(Q)$(call INSTALL,$(HB),$(PHB),cargo$(X))
7269
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUNTIME))
7370
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(CORELIB_GLOB))
7471
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(STDLIB_GLOB))
75-
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(LIBRUSTC_GLOB))
7672
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM))
7773
$(Q)$(call INSTALL,$(S)/man, \
7874
$(PREFIX_ROOT)/share/man/man1,rustc.1)

trunk/mk/stage0.mk

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ $(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_STDLIB): \
2121
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
2222
$(Q)touch $@
2323

24-
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_LIBRUSTC): \
25-
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
26-
$(Q)touch $@
27-
2824
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUSTLLVM): \
2925
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
3026
$(Q)touch $@
@@ -56,11 +52,6 @@ $$(HLIB0_H_$(1))/$(CFG_STDLIB): \
5652
@$$(call E, cp: $$@)
5753
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(STDLIB_GLOB) $$@
5854

59-
$$(HLIB0_H_$(1))/$(CFG_LIBRUSTC): \
60-
$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_LIBRUSTC)
61-
@$$(call E, cp: $$@)
62-
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(LIBRUSTC_GLOB) $$@
63-
6455
$$(HLIB0_H_$(1))/$(CFG_RUSTLLVM): \
6556
$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_RUSTLLVM)
6657
@$$(call E, cp: $$@)

trunk/mk/target.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
4949
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
5050
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
5151
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM) \
52-
$$(TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
53-
$$(TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
54-
$$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
52+
$$(TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3))
5553
@$$(call E, compile_and_link: $$@)
5654
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$<
5755

5856
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
5957
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
6058
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
6159
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM) \
62-
$$(TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
6360
$$(TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3))
6461
@$$(call E, compile_and_link: $$@)
6562
$$(STAGE$(1)_T_$(2)_H_$(3)) --lib -o $$@ $$< && touch $$@

trunk/src/cargo/cargo.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ fn load_source_packages(&c: cargo, &src: source) {
242242
load_one_source_package(src, _p);
243243
}
244244
_ {
245-
warn("Malformed source json: " + src.name + " (non-dict pkg)");
245+
warn("Malformed source json: " + src.name +
246+
" (non-dict pkg)");
246247
}
247248
}
248249
}

trunk/src/comp/metadata/creader.rs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,18 @@ fn visit_item(e: env, i: @ast::item) {
5757
}
5858
either::left(msg) { e.sess.span_fatal(i.span, msg); }
5959
}
60-
6160
let cstore = e.sess.get_cstore();
6261
let native_name = i.ident;
63-
let already_added = false;
64-
if vec::len(attr::find_attrs_by_name(i.attrs, "nolink")) == 0u {
65-
alt attr::get_meta_item_value_str_by_name(i.attrs, "link_name") {
66-
some(nn) { native_name = nn; }
67-
none. { }
68-
}
69-
if native_name == "" {
70-
e.sess.span_fatal(i.span,
71-
"empty #[link_name] not allowed; use #[nolink].");
72-
}
73-
already_added = !cstore::add_used_library(cstore, native_name);
62+
alt attr::get_meta_item_value_str_by_name(i.attrs, "link_name") {
63+
some(nn) { native_name = nn; }
64+
none. { }
7465
}
75-
let link_args = attr::find_attrs_by_name(i.attrs, "link_args");
76-
if vec::len(link_args) > 0u && already_added {
77-
e.sess.span_fatal(i.span, "library '" + native_name +
78-
"' already added: can't specify link_args.");
79-
}
80-
for a: ast::attribute in link_args {
66+
if !cstore::add_used_library(cstore, native_name) { ret; }
67+
for a: ast::attribute in
68+
attr::find_attrs_by_name(i.attrs, "link_args") {
69+
8170
alt attr::get_meta_item_value_str(attr::attr_meta(a)) {
82-
some(linkarg) {
83-
cstore::add_used_link_args(cstore, linkarg);
84-
}
71+
some(linkarg) { cstore::add_used_link_args(cstore, linkarg); }
8572
none. {/* fallthrough */ }
8673
}
8774
}

trunk/src/comp/metadata/cstore.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ fn get_used_crate_files(cstore: cstore) -> [str] {
9090
}
9191

9292
fn add_used_library(cstore: cstore, lib: str) -> bool {
93-
assert lib != "";
93+
if lib == "" { ret false; }
9494

9595
if vec::member(lib, p(cstore).used_libraries) { ret false; }
96+
9697
p(cstore).used_libraries += [lib];
9798
ret true;
9899
}

trunk/src/etc/snapshot.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,18 @@ def scrub(b):
1717

1818
snapshot_files = {
1919
"linux": ["bin/rustc",
20-
"bin/cargo",
2120
"lib/libcore-*.so",
2221
"lib/libstd-*.so",
23-
"lib/librustc-*.so",
2422
"lib/librustrt.so",
2523
"lib/librustllvm.so"],
2624
"macos": ["bin/rustc",
27-
"bin/cargo",
2825
"lib/libcore-*.dylib",
2926
"lib/libstd-*.dylib",
30-
"lib/librustc-*.dylib",
3127
"lib/librustrt.dylib",
3228
"lib/librustllvm.dylib"],
3329
"winnt": ["bin/rustc.exe",
34-
"bin/cargo.exe",
3530
"lib/core-*.dll",
3631
"lib/std-*.dll",
37-
"lib/rustc-*.dll",
3832
"lib/rustrt.dll",
3933
"lib/rustllvm.dll"]
4034
}

trunk/src/libstd/linux_os.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export fsync_fd;
2424
// FIXME Somehow merge stuff duplicated here and macosx_os.rs. Made difficult
2525
// by https://github.com/graydon/rust/issues#issue/268
2626

27-
#[link_name = ""] // FIXME remove after #[nolink] is snapshotted
28-
#[nolink]
27+
#[link_name = ""]
2928
#[abi = "cdecl"]
3029
native mod libc {
3130
fn read(fd: fd_t, buf: *u8, count: size_t) -> ssize_t;

trunk/src/libstd/macos_os.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export fsync_fd;
1818
// FIXME Refactor into unix_os module or some such. Doesn't
1919
// seem to work right now.
2020

21-
#[link_name = ""] // FIXME: Remove after snapshotting
22-
#[nolink]
21+
#[link_name = ""]
2322
#[abi = "cdecl"]
2423
native mod libc {
2524
fn read(fd: fd_t, buf: *u8, count: size_t) -> ssize_t;
@@ -119,8 +118,7 @@ native mod rustrt {
119118

120119
fn getcwd() -> str { ret rustrt::rust_getcwd(); }
121120

122-
#[link_name = ""] // FIXME remove after #[nolink] is snapshotted
123-
#[nolink]
121+
#[link_name = ""]
124122
#[abi = "cdecl"]
125123
native mod mac_libc {
126124
fn _NSGetExecutablePath(buf: str::sbuf,

trunk/src/libstd/win32_os.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import core::option;
22
import ctypes::*;
33

44
#[abi = "cdecl"]
5-
#[link_name = ""] // FIXME remove after #[nolink] is snapshotted
6-
#[nolink]
5+
#[link_name = ""]
76
native mod libc {
87
fn read(fd: fd_t, buf: *u8, count: size_t) -> ssize_t;
98
fn write(fd: fd_t, buf: *u8, count: size_t) -> ssize_t;

trunk/src/rt/arch/i386/morestack.S

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,11 @@ MORESTACK:
6262
#endif
6363

6464
// NB: This can be called with the fastcc convention so we
65-
// have to preserve any argument registers
66-
67-
// NB: __morestack is called misaligned by 4 bytes, i.e.
68-
// subl $4, %esp would get us to a normal alignment
69-
70-
subl $44,%esp
71-
72-
// Save fastcc arguments
73-
movl %ecx, 28(%esp)
74-
movl %edx, 24(%esp)
65+
// have to preserve any argument registers we want to use
7566

7667
// FIXME (1226): main is compiled with the split-stack prologue,
7768
// causing it to call __morestack, so we have to jump back out
69+
subl $28,%esp
7870
calll RUST_GET_TASK
7971
testl %eax,%eax
8072
jz .L$bail
@@ -93,13 +85,13 @@ MORESTACK:
9385
// for the unwinder
9486
leal 20(%ebp), %eax
9587
movl %eax, -4(%ebp)
96-
88+
9789
// The arguments to rust_new_stack2
98-
movl 56(%esp),%eax // Size of stack arguments
90+
movl 40(%esp),%eax // Size of stack arguments
9991
movl %eax,20(%esp)
100-
leal 64(%esp),%eax // Address of stack arguments
92+
leal 48(%esp),%eax // Address of stack arguments
10193
movl %eax,16(%esp)
102-
movl 52(%esp),%eax // The amount of stack needed
94+
movl 36(%esp),%eax // The amount of stack needed
10395
movl %eax,12(%esp)
10496
movl $0, 8(%esp) // Out pointer
10597

@@ -116,25 +108,19 @@ MORESTACK:
116108
movl %eax,(%esp)
117109
call UPCALL_CALL_C
118110

119-
movl 48(%esp),%eax // Grab the return pointer.
111+
movl 32(%esp),%eax // Grab the return pointer.
120112
inc %eax // Skip past the ret instruction in the parent fn
121113

122-
// Restore fastcc arguments
123-
movl 28(%esp), %ecx
124-
movl 24(%esp), %edx
125-
126114
movl 8(%esp),%esp // Switch stacks.
127-
call *%eax // Re-enter the function that called us.
115+
call *%eax // Re-enter the function that called us.
128116

129117
// Now the function that called us has returned, so we need to delete the
130118
// old stack space.
131119

132120
// Switch back to the rust stack
133121
movl %ebp, %esp
134122

135-
// Remember that __morestack is called misaligned so %ebp
136-
// is not aligned to a 16-byte boundary, these 4 bytes realign.
137-
subl $4, %esp
123+
subl $8, %esp // Alignment
138124

139125
// Now that we're on the return path we want to avoid
140126
// stomping on %eax. FIXME: Need to save and restore
@@ -151,7 +137,7 @@ MORESTACK:
151137
pushl $0
152138
call UPCALL_CALL_C
153139

154-
addl $12,%esp
140+
addl $16,%esp
155141

156142
popl %ebp
157143
#if defined(__linux__) || defined(__APPLE__)
@@ -164,7 +150,7 @@ MORESTACK:
164150
movl 32(%esp),%eax
165151
inc %eax
166152

167-
addl $44, %esp
153+
addl $28, %esp
168154
popl %ebp
169155
addl $4+8,%esp
170156

0 commit comments

Comments
 (0)