Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment: move builtins within a virtual workspace #702

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 5 additions & 78 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,82 +1,9 @@
[package]
authors = ["Jorge Aparicio <[email protected]>"]
name = "compiler_builtins"
version = "0.1.130"
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/compiler-builtins"
homepage = "https://github.com/rust-lang/compiler-builtins"
documentation = "https://docs.rs/compiler_builtins"
edition = "2021"
description = """
Compiler intrinsics used by the Rust compiler. Also available for other targets
if necessary!
"""
include = [
'/Cargo.toml',
'/build.rs',
'/configure.rs',
'/src/*',
'/examples/*',
'/LICENSE.txt',
'/README.md',
'/compiler-rt/*',
'/libm/src/math/*',
]
links = 'compiler-rt'

[lib]
test = false

[dependencies]
# For more information on this dependency see
# https://github.com/rust-lang/rust/tree/master/library/rustc-std-workspace-core
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }

[build-dependencies]
cc = { optional = true, version = "1.0" }

[dev-dependencies]
panic-handler = { path = 'crates/panic-handler' }

[features]
default = ["compiler-builtins"]

# Enable compilation of C code in compiler-rt, filling in some more optimized
# implementations and also filling in unimplemented intrinsics
c = ["cc"]

# Workaround for the Cranelift codegen backend. Disables any implementations
# which use inline assembly and fall back to pure Rust versions (if avalible).
no-asm = []

# Workaround for codegen backends which haven't yet implemented `f16` and
# `f128` support. Disabled any intrinsics which use those types.
no-f16-f128 = []

# Flag this library as the unstable compiler-builtins lib
compiler-builtins = []

# Generate memory-related intrinsics like memcpy
mem = []

# Mangle all names so this can be linked in with other versions or other
# compiler-rt implementations. Also used for testing
mangled-names = []

# Only used in the compiler's build system
rustc-dep-of-std = ['compiler-builtins', 'core']

# This makes certain traits and function specializations public that
# are not normally public but are required by the `testcrate`
public-test-deps = []

[[example]]
name = "intrinsics"
required-features = ["compiler-builtins"]

[workspace]
members = ["testcrate"]
resolver = "2"
members = [
"compiler-builtins",
"testcrate"
]

[profile.release]
panic = 'abort'
Expand Down
85 changes: 85 additions & 0 deletions compiler-builtins/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[package]
authors = ["Jorge Aparicio <[email protected]>"]
name = "compiler_builtins"
version = "0.1.130"
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/compiler-builtins"
homepage = "https://github.com/rust-lang/compiler-builtins"
documentation = "https://docs.rs/compiler_builtins"
edition = "2021"
description = """
Compiler intrinsics used by the Rust compiler. Also available for other targets
if necessary!
"""
include = [
'/Cargo.toml',
'/build.rs',
'/configure.rs',
'/src/*',
'/examples/*',
'/LICENSE.txt',
'/README.md',
'/compiler-rt/*',
'/libm/src/math/*',
]
links = 'compiler-rt'

[lib]
test = false

[dependencies]
# For more information on this dependency see
# https://github.com/rust-lang/rust/tree/master/library/rustc-std-workspace-core
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }

[build-dependencies]
cc = { optional = true, version = "1.0" }

[dev-dependencies]
panic-handler = { path = '../crates/panic-handler' }

[features]
default = ["compiler-builtins"]

# Enable compilation of C code in compiler-rt, filling in some more optimized
# implementations and also filling in unimplemented intrinsics
c = ["cc"]

# Workaround for the Cranelift codegen backend. Disables any implementations
# which use inline assembly and fall back to pure Rust versions (if avalible).
no-asm = []

# Workaround for codegen backends which haven't yet implemented `f16` and
# `f128` support. Disabled any intrinsics which use those types.
no-f16-f128 = []

# Flag this library as the unstable compiler-builtins lib
compiler-builtins = []

# Generate memory-related intrinsics like memcpy
mem = []

# Mangle all names so this can be linked in with other versions or other
# compiler-rt implementations. Also used for testing
mangled-names = []

# Only used in the compiler's build system
rustc-dep-of-std = ['compiler-builtins', 'core']

# This makes certain traits and function specializations public that
# are not normally public but are required by the `testcrate`
public-test-deps = []

[[example]]
name = "intrinsics"
required-features = ["compiler-builtins"]

# [workspace]
# members = ["testcrate"]

[profile.release]
panic = 'abort'

[profile.dev]
panic = 'abort'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/math.rs → compiler-builtins/src/math.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[allow(dead_code)]
#[allow(unused_imports)]
#[allow(clippy::all)]
#[path = "../libm/src/math/mod.rs"]
#[path = "../../libm/src/math/mod.rs"]
mod libm;

#[allow(unused_macros)]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion testcrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rand_xoshiro = "0.6"
rustc_apfloat = "0.2.1"

[dependencies.compiler_builtins]
path = ".."
path = "../compiler-builtins"
default-features = false
features = ["public-test-deps"]

Expand Down
2 changes: 1 addition & 1 deletion testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum Feature {
}

mod builtins_configure {
include!("../configure.rs");
include!("../compiler-builtins/configure.rs");
}

fn main() {
Expand Down
Loading