Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 672608 - dev-lang/rust-1.30.1-r1 with wasm USE flag and sys-devel/llvm-6.0.1 - .../work/rustc-1.30.1-src/src/tools/lld/Common/ErrorHandler.cpp:52:34: error: ‘class llvm::FileOutputBuffer’ has no member named ‘discard’
Summary: dev-lang/rust-1.30.1-r1 with wasm USE flag and sys-devel/llvm-6.0.1 - .../wor...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-06 09:26 UTC by WGH
Modified: 2019-05-15 02:51 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
environment (environment,159.88 KB, text/plain)
2018-12-06 09:28 UTC, WGH
Details
build.log (build.log,80.80 KB, text/plain)
2018-12-06 09:29 UTC, WGH
Details

Note You need to log in before you can comment on or make changes to this bug.
Description WGH 2018-12-06 09:26:33 UTC
Building dev-lang/rust-1.30.1-r1 fails when using system-llvm, and LLVM version is 6.0.1.

I have not tested LLVM 7.

Log excerpts:
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/Common/ErrorHandler.cpp: In function ‘void lld::exitLld(int)’:
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/Common/ErrorHandler.cpp:52:34: error: ‘class llvm::FileOutputBuffer’ has no member named ‘discard’
     errorHandler().OutputBuffer->discard();

In file included from /var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/include/lld/Core/Resolver.h:17:0,
                 from /var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/Core/Resolver.cpp:10:
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/include/lld/Core/SymbolTable.h:15:10: fatal error: llvm/Support/DJB.h: No such file or directory
 #include "llvm/Support/DJB.h"

/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp: In function ‘bool lld::mach_o::compareAtomsSub(const lld::mach_o::LayoutPass::SortKey&, const lld::mach_o::LayoutPass::SortKey&, lld::mach_o::LayoutPass::SortOverride, std::__cxx11::string&)’:
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp:194:25: error: ‘formatReason’ was not declared in this scope
     LLVM_DEBUG(reason = formatReason("override", lc._override, rc._override));

/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp: In function ‘bool lld::mach_o::compareAtoms(const lld::mach_o::LayoutPass::SortKey&, const lld::mach_o::LayoutPass::SortKey&, lld::mach_o::LayoutPass::SortOverride)’:
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp:256:15: error: expected primary-expression before ‘comp’
     StringRef comp = result ? "<" : ">=";
               ^~~~
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp:256:15: error: expected ‘}’ before  comp’
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp:256:15: error: expected ‘)’ before  comp’
/var/tmp/portage/dev-lang/rust-1.30.1-r1/work/rustc-1.30.1-src/src/tools/lld/lib/ReaderWriter/MachO/LayoutPass.cpp:258:29: error: ‘comp’ was not declared in this scope
                  << "' " << comp << " '"


Reproducible: Always




Portage 2.3.51 (python 3.6.5-final-0, default/linux/amd64/17.0, gcc-7.3.0, glibc-2.27-r6, 4.18.16-gentoo x86_64)
=================================================================
System uname: Linux-4.18.16-gentoo-x86_64-Intel-R-_Core-TM-_i3-4010U_CPU_@_1.70GHz-with-gentoo-2.6
KiB Mem:     8057148 total,   1283224 free
KiB Swap:   16777212 total,  15730152 free
Timestamp of repository gentoo: Wed, 05 Dec 2018 21:15:01 +0000
Head commit of repository gentoo: 97f1a00c864815da233ca14bca2cfcb94ca1bf18
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p5) 2.30.0
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
ccache version 3.3.4 [disabled]
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15-r100::sage-on-gentoo, 3.5.5-r1::gentoo, 3.6.5::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.13.4-r2::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://mirror.yandex.ru/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

LocalOverlay
    location: /usr/local/portage
    masters: gentoo

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo

brother-overlay
    location: /var/lib/layman/brother-overlay
    sync-type: laymansync
    sync-uri: git://github.com/stefan-langenmaier/brother-overlay.git
    masters: gentoo
    priority: 50

johu
    location: /var/lib/layman/johu
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/dev/johu.git
    masters: gentoo
    priority: 50

mrueg
    location: /var/lib/layman/mrueg
    sync-type: laymansync
    sync-uri: https://github.com/mrueg/mrueg-overlay.git
    masters: gentoo
    priority: 50

pentoo
    location: /var/lib/layman/pentoo
    sync-type: laymansync
    sync-uri: https://github.com/pentoo/pentoo-overlay.git
    masters: gentoo
    priority: 50

qt
    location: /var/lib/layman/qt
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/qt.git
    masters: gentoo
    priority: 50

sage-on-gentoo
    location: /var/lib/layman/sage-on-gentoo
    sync-type: laymansync
    sync-uri: git://github.com/cschwan/sage-on-gentoo.git
    masters: gentoo science
    priority: 50

science
    location: /var/lib/layman/science
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/sci.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

stuff
    location: /var/lib/layman/stuff
    sync-type: laymansync
    sync-uri: https://github.com/istitov/stuff.git
    masters: gentoo
    priority: 50

wjn-overlay
    location: /var/lib/layman/wjn-overlay
    sync-type: laymansync
    sync-uri: https://bitbucket.org/wjn/wjn-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx2 -O2 -pipe -msahf -mmovbe --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=3072 -mtune=core-avx2 -fstack-protector"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core-avx2 -O2 -pipe -msahf -mmovbe --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=3072 -mtune=core-avx2 -fstack-protector"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync metadata-transfer multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS=" http://mirror.yandex.ru/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bindist bzip2 cli crypt cxx dri fortran gdbm glamor iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre pulseaudio readline seccomp ssl systemd tcpd unicode vaapi xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard synaptics evdev mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

sys-devel/llvm-6.0.1::gentoo was built with the following:
USE="gold libffi ncurses -debug -doc -libedit -test -xar -xml" ABI_X86="32 (64) (-x32)" LLVM_TARGETS="AArch64 ARM BPF (X86) -AMDGPU -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -Sparc -SystemZ -XCore"
Comment 1 WGH 2018-12-06 09:28:05 UTC
Created attachment 557144 [details]
environment
Comment 2 WGH 2018-12-06 09:29:00 UTC
Created attachment 557146 [details]
build.log
Comment 3 WGH 2018-12-06 09:40:01 UTC
FWIW, llvm::FileOutputBuffer::discard was introduced in https://github.com/llvm-mirror/llvm/commit/5cd279703c599cb0b2ad4f163374a10e97c8a954, way after LLVM 6.0 was released. src/tools/lld/ seems to be a forked part of LLVM. https://github.com/rust-lang/lld/commit/98dccd5d08261f7dcf4942f0a056be083cee12ec - this change from upstream did end up in 1.30.1 release. 

Is it intended that dev-lang/rust compiles forked LLD it when system-llvm is set?
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2018-12-06 09:43:13 UTC
Comment on attachment 557146 [details]
build.log

oops
Comment 5 Dirkjan Ochtman (RETIRED) gentoo-dev 2018-12-06 10:59:44 UTC
It works for me, even though I also have llvm-6.0.1. Can you try disabling the wasm flag?
Comment 6 WGH 2018-12-06 11:22:18 UTC
Yeah, I'm  actually in process of compiling rust without wasm USE flag. Although compilation hasn't completed yet, it certainly progressed past the point where it failed last time.
Comment 7 WGH 2018-12-06 16:59:22 UTC
Rust builds successfully without wasm USE flag.
Comment 8 Georgy Yakovlev archtester gentoo-dev 2019-05-15 02:51:11 UTC
this due to llvm:6 missing WebAssembly target.

internal rust builds with experimental-targets enabled, which includes webassembly, but system provided llvm:6 does not have it.


I'm going to remove old rust versions soonish, new versions have this sorted out and require proper llvm with proper flags.

closing, thanks for report.