test: Fix some tests to run with musl

There were a few test cases to fix:

* Dynamic libraries are not supported with MUSL right now, so all of those
  related test which force or require dylibs are ignored.
* Looks like the default stack for MUSL is smaller than glibc, so a few stack
  allocations in benchmarks were boxed up (shouldn't have a perf impact).
* Some small linkage tweaks here and there
* Out-of-stack detection does not currently work with MUSL
This commit is contained in:
Alex Crichton 2015-04-23 18:41:37 -07:00
parent 60f8f6bde9
commit 247842b741
8 changed files with 18 additions and 14 deletions

View File

@ -113,7 +113,7 @@ $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))
ifeq ($$(findstring windows,$(1)),windows)
$$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1))
$$(Q)cp $$< $$^
$$(Q)cp $$^ $$@
endif
endef
@ -227,7 +227,7 @@ COMPRT_DEPS := $(wildcard \
$(S)src/compiler-rt/*/*/*/*)
endif
COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
COMPRT_NAME_$(1) := libcompiler-rt.a
COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt

View File

@ -101,8 +101,8 @@ impl Noise2DContext {
fn main() {
let symbols = [' ', '░', '▒', '▓', '█', '█'];
let mut pixels = [0f32; 256*256];
let n2d = Noise2DContext::new();
let mut pixels = Box::new([0f32; 256*256]);
let n2d = Box::new(Noise2DContext::new());
for _ in 0..100 {
for y in 0..256 {

View File

@ -50,17 +50,17 @@ use std::ptr::copy;
use std::thread;
struct Tables {
table8: [u8; 1 << 8],
table16: [u16; 1 << 16]
table8: Box<[u8; 1 << 8]>,
table16: Box<[u16; 1 << 16]>,
}
impl Tables {
fn new() -> Tables {
let mut table8 = [0;1 << 8];
let mut table8 = Box::new([0;1 << 8]);
for (i, v) in table8.iter_mut().enumerate() {
*v = Tables::computed_cpl8(i as u8);
}
let mut table16 = [0;1 << 16];
let mut table16 = Box::new([0;1 << 16]);
for (i, v) in table16.iter_mut().enumerate() {
*v = (table8[i & 255] as u16) << 8 |
table8[i >> 8] as u16;

View File

@ -12,6 +12,7 @@
// aux-build:issue-13560-2.rs
// aux-build:issue-13560-3.rs
// ignore-stage1
// ignore-musl
// Regression test for issue #13560, the test itself is all in the dependent
// libraries. The fail which previously failed to compile is the one numbered 3.

View File

@ -11,6 +11,7 @@
// aux-build:issue-12133-rlib.rs
// aux-build:issue-12133-dylib.rs
// aux-build:issue-12133-dylib2.rs
// ignore-musl
// pretty-expanded FIXME #23616

View File

@ -11,6 +11,7 @@
// aux-build:linkage-visibility.rs
// ignore-android: FIXME(#10379)
// ignore-windows: std::dynamic_lib does not work on Windows well
// ignore-musl
#![feature(std_misc)]

View File

@ -8,11 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//ignore-android
//ignore-freebsd
//ignore-ios
//ignore-dragonfly
//ignore-bitrig
// ignore-android
// ignore-freebsd
// ignore-ios
// ignore-dragonfly
// ignore-bitrig
// ignore-musl
#![feature(asm)]

View File

@ -14,8 +14,8 @@
// Test accessing external items from multiple compilation units.
extern crate sepcomp_extern_lib;
#[link(name = "sepcomp_extern_lib")]
extern {
#[allow(ctypes)]
fn foo() -> usize;