Fix dllimports of static data from rlibs

This commit is contained in:
Vadim Chugunov 2015-08-21 00:41:07 -07:00
parent cefe5f25b2
commit e82bb915e4
4 changed files with 106 additions and 32 deletions

View file

@ -0,0 +1,8 @@
# Test that on *-pc-windows-msvc we can link to a rlib containing only data.
# See #26591, #27438
-include ../tools.mk
all:
$(RUSTC) foo.rs
$(RUSTC) bar.rs

View file

@ -0,0 +1,15 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate foo;
fn main() {
println!("The answer is {} !", foo::FOO);
}

View file

@ -0,0 +1,13 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type = "rlib"]
pub static FOO: i32 = 42;