diff --git a/src/cargo/util/toml.rs b/src/cargo/util/toml.rs
index 784311f9ce2..6e91bf51d28 100644
--- a/src/cargo/util/toml.rs
+++ b/src/cargo/util/toml.rs
@@ -198,15 +198,16 @@ fn normalize(lib: Option<&[TomlLibTarget]>,
     }
 
     fn lib_targets(dst: &mut Vec<Target>, libs: &[TomlLibTarget]) {
-        let l = &libs[0];
-        let path = l.path.clone().unwrap_or_else(|| format!("src/{}.rs", l.name));
-        let crate_types = l.crate_type.clone().and_then(|kinds| {
-            LibKind::from_strs(kinds).ok()
-        }).unwrap_or_else(|| vec!(Lib));
-
-        for profile in target_profiles(l).iter() {
-            dst.push(Target::lib_target(l.name.as_slice(), crate_types.clone(),
-                                        &Path::new(path.as_slice()), profile));
+        for l in libs.iter() {
+            let path = l.path.clone().unwrap_or_else(|| format!("src/{}.rs", l.name));
+            let crate_types = l.crate_type.clone().and_then(|kinds| {
+                LibKind::from_strs(kinds).ok()
+            }).unwrap_or_else(|| vec!(Lib));
+
+            for profile in target_profiles(l).iter() {
+                dst.push(Target::lib_target(l.name.as_slice(), crate_types.clone(),
+                                            &Path::new(path.as_slice()), profile));
+            }
         }
     }
 
diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs
index 168603d22f9..38e96e24b61 100644
--- a/tests/test_cargo_compile.rs
+++ b/tests/test_cargo_compile.rs
@@ -559,3 +559,47 @@ test!(many_crate_types {
     assert!(file0.ends_with(os::consts::DLL_SUFFIX) ||
             file1.ends_with(os::consts::DLL_SUFFIX));
 })
+
+test!(multiple_libs {
+    let mut p = project("foo");
+    p = p
+        .file("Cargo.toml", r#"
+            [project]
+
+            name = "foo"
+            version = "0.5.0"
+            authors = ["wycats@example.com"]
+
+            [[lib]]
+
+            name = "foofoofoo"
+
+            [[lib]]
+
+            name = "barbarbar"
+        "#)
+        .file("src/foofoofoo.rs", r#"
+            pub fn foo() {}
+        "#)
+        .file("src/barbarbar.rs", r#"
+            pub fn bar() {}
+        "#);
+
+    assert_that(p.cargo_process("cargo-build"),
+                execs().with_status(0));
+
+    let files = fs::readdir(&p.root().join("target")).assert();
+    let mut files: Vec<String> = files.iter().filter_map(|f| {
+        match f.filename_str().unwrap() {
+            "deps" => None,
+            s if s.contains("fingerprint") => None,
+            s => Some(s.to_str())
+        }
+    }).collect();
+    files.sort();
+    let file0 = files.get(0).as_slice();
+    let file1 = files.get(1).as_slice();
+    println!("{} {}", file0, file1);
+    assert!(file0.contains("barbarbar"));
+    assert!(file1.contains("foofoofoo"));
+})