From 2e8f0b125bb8a00f1d1c128e1ed116ed74c6adfa Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 19 Nov 2018 22:02:13 -0800 Subject: [PATCH 1/4] Prepare for publication to crates.io This commit prepares to publish the compiler-builtins crate to crates.io in order for the standard library to directly depend on it from crates.io in rust-lang/rust#56092 --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 7eae2dc..0bbd22e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,11 @@ version = "0.1.0" [lib] test = false +[dependencies] +# For more information on this dependency see rust-lang/rust's +# `src/tools/rustc-std-workspace` folder +core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' } + [build-dependencies] cc = { optional = true, version = "1.0" } @@ -32,6 +37,9 @@ mangled-names = [] # Don't generate lang items for i128 intrisnics and such no-lang-items = [] +# Only used in the compiler's build system +rustc-dep-of-std = ['c', 'compiler-builtins', 'core'] + [[example]] name = "intrinsics" required-features = ["c", "compiler-builtins"] From d74c506aab3efa3ca7a82c23f8a2ce7fe62351a0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 21 Nov 2018 10:19:31 -0800 Subject: [PATCH 2/4] Use panic=abort for tests Try to fix issues with undefined `rust_eh_personality` symbols --- Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 0bbd22e..a7f34c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,3 +46,9 @@ required-features = ["c", "compiler-builtins"] [workspace] members = ["testcrate"] + +[profile.release] +panic = 'abort' + +[profile.dev] +panic = 'abort' From 2da5d40e849ae30c0693bc543fd3fa3b2ccee99e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 21 Nov 2018 10:48:58 -0800 Subject: [PATCH 3/4] Use `nm` on OSX Looks like it may be fixed now? --- ci/run.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ci/run.sh b/ci/run.sh index 8c85038..b777522 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -64,18 +64,7 @@ case $1 in ;; esac -case "$TRAVIS_OS_NAME" in - osx) - # NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent. - # Use GNU nm instead - NM=gnm - brew update - brew install binutils - ;; - *) - NM=nm - ;; -esac +NM=nm if [ -d /target ]; then path=/target/${1}/debug/deps/libcompiler_builtins-*.rlib From 02bcce860bbf247e8c0890e20540eb9915220e3a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 21 Nov 2018 11:07:07 -0800 Subject: [PATCH 4/4] Remove unknown feature --- examples/intrinsics.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/intrinsics.rs b/examples/intrinsics.rs index 1c49817..c1a7814 100644 --- a/examples/intrinsics.rs +++ b/examples/intrinsics.rs @@ -11,7 +11,6 @@ #![feature(lang_items)] #![feature(start)] #![feature(allocator_api)] -#![cfg_attr(windows, feature(panic_unwind))] #![no_std] extern crate panic_handler;