I have an unusual situation where the code in my project compiles and runs correctly in Debug, ReleaseSafe, and ReleaseFast. However, compiling for ReleaseSmall always causes the error:
local variable requires a valid scope
and the compiler aborts with a Segmentation fault
. This is version 0.14.0 although I believe the problem arose sometime during the 0.14-dev cycle.
The compile target is:
const platform_target = std.Build.parseTargetQuery(.{
.arch_os_abi = "thumb-freestanding-eabihf",
.cpu_features = "cortex_m4+strict_align+vfp4d16sp",
}) catch @panic("failed to parse platform target");
The failure also occurs with just: .cpu_features = "cortex_m4"
.
I have searched around and tried to reproduce the error with a minimal file, but have not been successful in that. The code is quite low level, contains exported functions and specific linker section directives. It is start up and device code. The compiler binary does indeed contain the error string, but since the pre-compiled binaries are distributed without symbolic information, I’m a bit lost as to how to proceed.
Has anyone else encountered this problem? Any suggestions on how to proceed?