Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMerge compiler-builtins into core #49380
Comments
japaric
added
the
WG-embedded
label
Mar 26, 2018
japaric
assigned
michaelwoerister
Mar 26, 2018
This comment has been minimized.
This comment has been minimized.
|
Alternative options discussed during meeting 1:
|
This comment has been minimized.
This comment has been minimized.
|
@japaric What about the |
This comment has been minimized.
This comment has been minimized.
|
@whitequark we are going to go ahead with the first approach in @jamesmunns' comment. (a) There's not going to be a compiler-builtins / core merge, (b) the expansion of |
This comment has been minimized.
This comment has been minimized.
|
With this approach we can still do the merge sometime in the future. |
This comment has been minimized.
This comment has been minimized.
|
Sounds great! |
ppannuto
referenced this issue
Apr 5, 2018
Closed
Tracking: Minimize dependencies to build kernel #866
This comment has been minimized.
This comment has been minimized.
|
#49503 has landed so I'm going to remove the WG-embedded request label. @alexcrichton you expressed interest in seeing the compiler-builtins / core merge implemented. Do you want to keep this ticket open to track that? |
japaric
removed
the
WG-embedded
label
Apr 7, 2018
This comment has been minimized.
This comment has been minimized.
|
We'll still need this to avoid mentioning compiler-builtins on the Cargo file, so yeah I hope work continues. |
This comment has been minimized.
This comment has been minimized.
|
@japaric indeed! I don't think the need is pressing though so I'm fine closing this and making a new issue if it ever becomes pressing |
japaric commentedMar 26, 2018
•
edited
This is a P-high embedded-WG issue that needs to be fixed to make embedded Rust work on stable.
Background:
The
compiler-builtinscrate contains compiler intrinsics that LLVM may call when lowering operations likei64multiplication to machine code. This crate currently is its own crate due to these requirements: its object file needs to appear at the end of the linker argument list and it needs be marked with the#![compiler_builtins]attribute (symbol visibility, etc.).On
#![no_std]compiler-builtinsneeds to appear in the dependency graph to avoid linker errors but that requires the#[feature(compiler_builtins_lib)]feature gate because the crate is unstable -- it's a compiler implementation detail.The fix is to put the compiler intrinsics into
coreand eliminate thecompiler-builtinscrate from thestdfacade. This has become possible thanks to recent progress in multiple codegen units.What roughly needs to be done
Include
compiler-builtinsas source code intocoreusing something like#[path = "../compiler-builtins/src/lib.rs"] mod intrinsics.Create some attribute to mark the whole
intrinsicsmodule as#![compiler_builtins]and to force the whole module to be into its own codegen unit so it gets its own object file.cc @michaelwoerister @eddyb @alexcrichton