New issue
Advanced search Search tips

Issue 776849 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Oct 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Rust does not build with newer llvm version

Project Member Reported by manojgupta@chromium.org, Oct 20 2017

Issue description

We want to upgrade the llvm in chroot to a newer version but rust is failing to build. This is blocking us from rolling the new llvm compiler.

https://uberchromegw.corp.google.com/i/chromiumos.tryserver/builders/chromiumos-sdk/builds/2632

rust-1.21.0: running: "x86_64-cros-linux-gnu-clang++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-O2" "-pipe" "--target=x86_64-unknown-linux-gnu" "-I/usr/include" "-O2" "-pipe" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-Werror=unguarded-availability-new" "-std=c++11" "-Wall" "-W" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-pedantic" "-Wno-long-long" "-Wcovered-switch-default" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-fcolor-diagnostics" "-ffunction-sections" "-fdata-sections" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_X86" "-o" "/var/tmp/portage/dev-lang/rust-1.21.0/work/rustc-1.21.0-src/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-6f022fb7269c2d10/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp"
rust-1.21.0: cargo:warning=In file included from ../rustllvm/PassWrapper.cpp:11:
rust-1.21.0: cargo:warning=In file included from /usr/include/stdio.h:954:
rust-1.21.0: cargo:warning=/usr/include/bits/stdio2.h:79:6: warning: 'enable_if' is a clang extension [-Wgcc-compat]
rust-1.21.0: cargo:warning=     __clang_enable_if (__bos (__s) != (size_t) -1 && __bos (__s) < __n,
rust-1.21.0: cargo:warning=     ^


rust-1.21.0: cargo:warning=/usr/include/sys/cdefs.h:149:50: note: expanded from macro '__clang_enable_if'
rust-1.21.0: cargo:warning=# define __clang_enable_if(c, m) __attribute__ ((enable_if ((c), (m))))
rust-1.21.0: cargo:warning=                                                 ^
rust-1.21.0: cargo:warning=../rustllvm/PassWrapper.cpp:207:23: error: no member named 'Default' in namespace 'llvm::CodeModel'
rust-1.21.0: cargo:warning=    return CodeModel::Default;
rust-1.21.0: cargo:warning=           ~~~~~~~~~~~^
rust-1.21.0: cargo:warning=../rustllvm/PassWrapper.cpp:209:23: error: no member named 'JITDefault' in namespace 'llvm::CodeModel'
rust-1.21.0: cargo:warning=    return CodeModel::JITDefault;
rust-1.21.0: cargo:warning=           ~~~~~~~~~~~^
rust-1.21.0: cargo:warning=7 warnings and 2 errors generated.
rust-1.21.0: exit code: 1
rust-1.21.0: 
rust-1.21.0: 
rust-1.21.0: command did not execute successfully, got: exit code: 1

Repro steps:

1. Update llvm to the newer version
USE="llvm-next" sudo emerge llvm cross-armv7a-cros-linux-gnueabi/compiler-rt cross-aarch64-cros-linux-gnu/compiler-rt

2. Build rust which fails
sudo emerge rust 

 
Cc: g...@chromium.org

Comment 2 by g...@chromium.org, Oct 20 2017

r309911 got rid of these. Looks like things that accepted CodeModel::*Default now take an Optional<CodeModel>, which should be None if we want the default value.

Comment 3 by za...@chromium.org, Oct 20 2017

Status: Started (was: Untriaged)
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/4eef831b7ff71ca21d9e067684150cb4d22b59da

commit 4eef831b7ff71ca21d9e067684150cb4d22b59da
Author: Manoj Gupta <manojgupta@google.com>
Date: Sun Oct 22 04:37:57 2017

rust: Fix the build to work with both current and next llvm.

The previous fix somehow didn't work. Bump the llvm version to a higher number
to fix the builds for now.

BUG= chromium:776849 
TEST=rust builds with current and llvm-next.

Change-Id: Icb30435bea0a99638954cf2cf4bb731435f5e819
Reviewed-on: https://chromium-review.googlesource.com/731870
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Trybot-Ready: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>

[rename] https://crrev.com/4eef831b7ff71ca21d9e067684150cb4d22b59da/dev-lang/rust/rust-1.21.0-r2.ebuild

Status: Verified (was: Started)

Sign in to add a comment