about summary refs log tree commit diff
path: root/src/comp/front
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2011-06-20 17:36:15 -0400
committerRafael Ávila de Espíndola <respindola@mozilla.com>2011-06-20 17:44:12 -0400
commit3d8a5cb9e67d0e38d2062bd7685aa5514305dfc6 (patch)
treeca77815fd66229bc0c64669c8deded58b01f4613 /src/comp/front
parenta2dcd08cc273bcc880fc9687bffc98796fa1f3c4 (diff)
downloadrust-3d8a5cb9e67d0e38d2062bd7685aa5514305dfc6.tar.gz
rust-3d8a5cb9e67d0e38d2062bd7685aa5514305dfc6.zip
Remember the library files we used in rustc and pass them to the "linker".
This avoid the hardcoded -lstd, allows programs to use other crates and avoids
any differences that may exist in the rustc and ld search logic.
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/creader.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/comp/front/creader.rs b/src/comp/front/creader.rs
index 09f90befa12..c57e7b732fa 100644
--- a/src/comp/front/creader.rs
+++ b/src/comp/front/creader.rs
@@ -582,12 +582,13 @@ fn find_library_crate(&session::session sess, &ast::ident ident,
     ret none;
 }
 
-fn load_library_crate(&session::session sess, &int cnum, &ast::ident ident,
+fn load_library_crate(&session::session sess, int cnum, &ast::ident ident,
                       &vec[@ast::meta_item] metas,
                       &vec[str] library_search_paths) {
     alt (find_library_crate(sess, ident, metas, library_search_paths)) {
         case (some(?t)) {
             sess.set_external_crate(cnum, rec(name=ident, data=t._1));
+            sess.add_used_library(t._0);
             ret;
         }
         case (_) { }