Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 671608

Summary: dev-lang/rust-1.30.1-r1: /usr/include/stdlib.h:133:35: error: missing binary operator before token "("
Product: Gentoo Linux Reporter: Sergey 'L29Ah' Alirzaev <zl29ah>
Component: Current packagesAssignee: Gentoo Rust Project <rust>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log
emerge --info

Description Sergey 'L29Ah' Alirzaev 2018-11-21 07:19:39 UTC
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
Comment 1 Sergey 'L29Ah' Alirzaev 2018-11-21 07:21:09 UTC
Created attachment 555848 [details]
emerge --info
Comment 2 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-23 12:23:56 UTC
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?
Comment 3 Sergey 'L29Ah' Alirzaev 2018-11-23 12:25:08 UTC
Nah, sys-devel/llvm-7.0.0-r1 was built fine here.
Comment 4 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-23 12:28:37 UTC
In that case, try building Rust with system-llvm.
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-11-23 12:42:08 UTC
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.
Comment 6 Sergey 'L29Ah' Alirzaev 2018-11-23 16:37:12 UTC
Looks worky, thanks.
Comment 7 Georgy Yakovlev archtester gentoo-dev 2020-03-05 09:34:17 UTC
this ebuild no longer in tree, closing.
please reopen if you can reproduce on current ebuilds.
Comment 8 Alexei Colin 2020-06-13 01:39:52 UTC
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).