Skip to content

BASEPRI and FAULTMASK break the standalone build on armv6m #98

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

Closed
dtwood opened this issue Jul 16, 2018 · 2 comments · Fixed by #102
Closed

BASEPRI and FAULTMASK break the standalone build on armv6m #98

dtwood opened this issue Jul 16, 2018 · 2 comments · Fixed by #102

Comments

@dtwood
Copy link

dtwood commented Jul 16, 2018

PS C:\Users\david\Devel\cortex-m> cat .\build.ps1
$env:RUSTFLAGS="-Z linker-flavor=ld.lld -C linker=ld.lld.exe"
$env:CC="clang"
$env:AR="llvm-ar"
cargo build --target=thumbv6m-none-eabi --release
PS C:\Users\david\Devel\cortex-m> .\build.ps1
   Compiling cortex-m v0.5.2 (file:///C:/Users/david/Devel/cortex-m)
error: failed to run custom build command for `cortex-m v0.5.2 (file:///C:/Users/david/Devel/cortex-m)`
process didn't exit successfully: `C:\Users\david\Devel\cortex-m\target\release\build\cortex-m-d6e8f84c8a15b15f\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("thumbv6m-none-eabi")
OPT_LEVEL = Some("3")
TARGET = Some("thumbv6m-none-eabi")
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("thumbv6m-none-eabi")
TARGET = Some("thumbv6m-none-eabi")
HOST = Some("x86_64-pc-windows-msvc")
CC_thumbv6m-none-eabi = None
CC_thumbv6m_none_eabi = None
TARGET_CC = None
CC = Some("clang")
TARGET = Some("thumbv6m-none-eabi")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_thumbv6m-none-eabi = None
CFLAGS_thumbv6m_none_eabi = None
TARGET_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=thumbv6m-none-eabi" "-Wall" "-Wextra" "-o" "C:\\Users\\david\\Devel\\cortex-m\\target\\thumbv6m-none-eabi\\release\\build\\cortex-m-9e47ce484a32dbc3\\out\\asm\\basepri_r.o" "-c" "asm/basepri_r.s"
cargo:warning=clang.exe: warning: argument unused during compilation: '-ffunction-sections' [-Wunused-command-line-argument]
cargo:warning=clang.exe: warning: argument unused during compilation: '-fdata-sections' [-Wunused-command-line-argument]
cargo:warning=asm/basepri_r.s:3:11: error: invalid operand for instruction
cargo:warning=  mrs r0, BASEPRI
cargo:warning=          ^
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "clang" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "--target=thumbv6m-none-eabi" "-Wall" "-Wextra" "-o" "C:\\Users\\david\\Devel\\cortex-m\\target\\thumbv6m-none-eabi\\release\\build\\cortex-m-9e47ce484a32dbc3\\out\\asm\\basepri_r.o" "-c" "asm/basepri_r.s" with args "clang" did not execute successfully (status code exit code: 1).

', C:\Users\david\.cargo\registry\src\github.com-1ecc6299db9ec823\cc-1.0.18\src\lib.rs:2181:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
japaric added a commit that referenced this issue Aug 2, 2018
The BASEPRI and FAULTMASK registers don't exist on that architecture

closes #98
bors bot added a commit that referenced this issue Aug 2, 2018
102: don't assemble basepri*.s and faultmask.s for ARMv6-M r=japaric a=japaric

The BASEPRI and FAULTMASK registers don't exist on that architecture

closes #98

Co-authored-by: Jorge Aparicio <[email protected]>
@bors bors bot closed this as completed in #102 Aug 2, 2018
@japaric
Copy link
Member

japaric commented Aug 2, 2018

The latest release (v0.5.3) contains a fix for this.

BTW, @dtwood I see that you are overriding the assembler / compiler and the archiver. Did the default values not work for you?

@dtwood
Copy link
Author

dtwood commented Aug 6, 2018

I haven't actually tried the default values - my windows machine has a copy of clang/lld that I've built from source, but no gcc or binutils

adamgreig pushed a commit that referenced this issue Jan 12, 2022
98: v0.5.3 r=adamgreig a=japaric

commit required to make a new release

r? @rust-embedded/cortex-m (anyone)

Co-authored-by: Jorge Aparicio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants