mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 00:24:52 +00:00
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:
parent
60f8f6bde9
commit
247842b741
4
mk/rt.mk
4
mk/rt.mk
|
@ -113,7 +113,7 @@ $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))
|
||||||
|
|
||||||
ifeq ($$(findstring windows,$(1)),windows)
|
ifeq ($$(findstring windows,$(1)),windows)
|
||||||
$$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1))
|
$$(RT_OUTPUT_DIR_$(1))/lib$(2).a: $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1))
|
||||||
$$(Q)cp $$< $$^
|
$$(Q)cp $$^ $$@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
@ -227,7 +227,7 @@ COMPRT_DEPS := $(wildcard \
|
||||||
$(S)src/compiler-rt/*/*/*/*)
|
$(S)src/compiler-rt/*/*/*/*)
|
||||||
endif
|
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_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
|
||||||
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
|
COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
|
||||||
|
|
||||||
|
|
|
@ -101,8 +101,8 @@ fn get(&self, x: f32, y: f32) -> f32 {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let symbols = [' ', '░', '▒', '▓', '█', '█'];
|
let symbols = [' ', '░', '▒', '▓', '█', '█'];
|
||||||
let mut pixels = [0f32; 256*256];
|
let mut pixels = Box::new([0f32; 256*256]);
|
||||||
let n2d = Noise2DContext::new();
|
let n2d = Box::new(Noise2DContext::new());
|
||||||
|
|
||||||
for _ in 0..100 {
|
for _ in 0..100 {
|
||||||
for y in 0..256 {
|
for y in 0..256 {
|
||||||
|
|
|
@ -50,17 +50,17 @@
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
struct Tables {
|
struct Tables {
|
||||||
table8: [u8; 1 << 8],
|
table8: Box<[u8; 1 << 8]>,
|
||||||
table16: [u16; 1 << 16]
|
table16: Box<[u16; 1 << 16]>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tables {
|
impl Tables {
|
||||||
fn new() -> 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() {
|
for (i, v) in table8.iter_mut().enumerate() {
|
||||||
*v = Tables::computed_cpl8(i as u8);
|
*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() {
|
for (i, v) in table16.iter_mut().enumerate() {
|
||||||
*v = (table8[i & 255] as u16) << 8 |
|
*v = (table8[i & 255] as u16) << 8 |
|
||||||
table8[i >> 8] as u16;
|
table8[i >> 8] as u16;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
// aux-build:issue-13560-2.rs
|
// aux-build:issue-13560-2.rs
|
||||||
// aux-build:issue-13560-3.rs
|
// aux-build:issue-13560-3.rs
|
||||||
// ignore-stage1
|
// ignore-stage1
|
||||||
|
// ignore-musl
|
||||||
|
|
||||||
// Regression test for issue #13560, the test itself is all in the dependent
|
// 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.
|
// libraries. The fail which previously failed to compile is the one numbered 3.
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// aux-build:issue-12133-rlib.rs
|
// aux-build:issue-12133-rlib.rs
|
||||||
// aux-build:issue-12133-dylib.rs
|
// aux-build:issue-12133-dylib.rs
|
||||||
// aux-build:issue-12133-dylib2.rs
|
// aux-build:issue-12133-dylib2.rs
|
||||||
|
// ignore-musl
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
// aux-build:linkage-visibility.rs
|
// aux-build:linkage-visibility.rs
|
||||||
// ignore-android: FIXME(#10379)
|
// ignore-android: FIXME(#10379)
|
||||||
// ignore-windows: std::dynamic_lib does not work on Windows well
|
// ignore-windows: std::dynamic_lib does not work on Windows well
|
||||||
|
// ignore-musl
|
||||||
|
|
||||||
#![feature(std_misc)]
|
#![feature(std_misc)]
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,12 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
//ignore-android
|
// ignore-android
|
||||||
//ignore-freebsd
|
// ignore-freebsd
|
||||||
//ignore-ios
|
// ignore-ios
|
||||||
//ignore-dragonfly
|
// ignore-dragonfly
|
||||||
//ignore-bitrig
|
// ignore-bitrig
|
||||||
|
// ignore-musl
|
||||||
|
|
||||||
#![feature(asm)]
|
#![feature(asm)]
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
// Test accessing external items from multiple compilation units.
|
// Test accessing external items from multiple compilation units.
|
||||||
|
|
||||||
|
extern crate sepcomp_extern_lib;
|
||||||
|
|
||||||
#[link(name = "sepcomp_extern_lib")]
|
|
||||||
extern {
|
extern {
|
||||||
#[allow(ctypes)]
|
#[allow(ctypes)]
|
||||||
fn foo() -> usize;
|
fn foo() -> usize;
|
||||||
|
|
Loading…
Reference in a new issue