Created attachment 555846 [details] build log /usr/include/stdlib.h:133:35: error: missing binary operator before token "(" #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT) ^ gcc (Gentoo Hardened 8.2.0-r4 p1.5) 8.2.0 sys-libs/glibc-2.27-r6
Created attachment 555848 [details] emerge --info
This seems to fail while building LLVM -- which makes it not very Rust-specific. Do you get similar problems when trying to build LLVM-7.x in this build environment?
Nah, sys-devel/llvm-7.0.0-r1 was built fine here.
In that case, try building Rust with system-llvm.
As for the root cause, I don't have a clue. The gcc version you have is the latest stable, so presumably it's quite common and other people have built Rust with it successfully. There might be something deviant about the hardened profile or something on your box to explain this, but I can't tell what that might be. I also checked the code in /usr/include/stdlib.h:133, which looks exactly the same for me but doesn't cause trouble, so not sure what to make of this.
Looks worky, thanks.
this ebuild no longer in tree, closing. please reopen if you can reproduce on current ebuilds.
FWIW: I've got this error on a different unrelated ebuild inside Gentoo Prefix. The reason turned out to be a -I/usr/include on the compile line. The /usr/include is a path on the host, outside the prefix. So, the error happened as a result of mixing system headers from different libc(/gcc toolchain) versions: headers on the host with headers in the prefix. The fix was to patch the packages build system to get rid of all -I arguments that pointed outside the prefix (which shouldn't be there in the first place, since /usr/include is implied).