Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
llvm-pass
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
llvm-pass
Commits
4427b856
Commit
4427b856
authored
6 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
rust no_std compiles
parent
7ec07144
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
rust/.gitignore
+0
-0
0 additions, 0 deletions
rust/.gitignore
rust/Cargo.toml
+10
-1
10 additions, 1 deletion
rust/Cargo.toml
rust/src/main.rs
+20
-2
20 additions, 2 deletions
rust/src/main.rs
with
30 additions
and
3 deletions
rust/
src/
.gitignore
→
rust/.gitignore
+
0
−
0
View file @
4427b856
File moved
This diff is collapsed.
Click to expand it.
rust/Cargo.toml
+
10
−
1
View file @
4427b856
...
...
@@ -2,6 +2,15 @@
name
=
"rust"
version
=
"0.1.0"
authors
=
[
"pln <Per Lindgren>"
]
edition
=
"2018"
#
edition = "2018"
[dependencies]
[profile.dev]
panic
=
"abort"
[profile.release]
panic
=
"abort"
codegen-units
=
1
# better optimizations
debug
=
true
# symbols are nice and they don't increase the size on Flash
lto
=
true
# better optimizations
\ No newline at end of file
This diff is collapsed.
Click to expand it.
rust/src/main.rs
+
20
−
2
View file @
4427b856
#![no_std]
#![feature(compiler_builtins_lib)]
#![feature(lang_items)]
#![feature(core_intrinsics)]
#![no_main]
//use core::ptr::read;
use
core
::
intrinsics
;
use
core
::
panic
::
PanicInfo
;
fn
main
()
{
#[panic_handler]
fn
panic
(
_info
:
&
PanicInfo
)
->
!
{
unsafe
{
intrinsics
::
abort
()
}
}
#[inline(never)]
fn
f1
()
->
u32
{
0
}
#[no_mangle]
fn
main
()
{
f1
();
}
// cargo rustc --release -- -C linker=true --emit=llvm-ir,llvm-bc
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment