Maybe this is more of a llvm question but hopefully someone here knows.
I used to build kernel stuff using a custom target triple. After updating my FreeBSD system I get this error when building libcore.
===> Building core
Assertion failed: (hasFlag(Feature)), function ApplyFeatureFlag, file /wrkdirs/usr/ports/devel/llvm40/work/llvm-4.0.1.src/lib/MC/SubtargetFeature.cpp, line 194.
*** Signal 6
Removing this line from the json and the build works: "features": "+soft-float, -mmx, -sse, -sse2, -sse3, -ssse3, -sse4.1, -sse4.2, -3dnow, -3dnowa, -avx, -avx2"
Any ideas what has changed in llvm and what I'm supposed to use instead of features?
The rust toolchain I use is unchanged.
That's not the problem. The problem is that the syntax has changed.
Apparently the old way (as used here: Set Up Rust | Writing an OS in Rust (First Edition)) "features": "+soft-float,-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2",
Cause assert failure in llvm code. However, this: "features": ["+soft-float,-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2"],
seem to work.
That is, it has to be an array, not one long string with features.
I'm still not sure though if this is due to change in llvm or rust...
Hmm, that is weird indeed... I think default in FreeBSD is now LLVM 6 but the assertion message claims to be from LLVM 4 (which my rustc is built on?).
The only I can think of that changed on my system is the system compiler version from 5 to 6.
Ok, now I'm seriously confused. After switching toolchains (with rustup) around for a bit it suddenly builds - the old style.
I can't update, rust-docs is broken on FreeBSD
Besides, I need this version for a big project I'm working and it's a self-contained toolchain in the project so it should work.
If it happens next time, please try to provide as much information as possibel (gdb dump etc). This will help to hunt the bug down. But if it now works for you, that's great. Maybe somebody can explain this weird behavoir.