Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with LLVM trunk. #55714

Closed
vext01 opened this issue Nov 6, 2018 · 8 comments
Closed

Build fails with LLVM trunk. #55714

vext01 opened this issue Nov 6, 2018 · 8 comments

Comments

@vext01
Copy link
Contributor

vext01 commented Nov 6, 2018

Hi,

I'm not sure if you target LLVM trunk, but I guess this will have to be fixed some day anyway.

Using LLVM trunk as of today (commit 5bc1446f3bee779c5a15a0256169bc7623682121 in git) and Rust master (commit 24e66c28980442a48d9458f1a4f9b76cc722dc8a in git), I have the following compilation error when building src/libstd:

   Compiling libc v0.2.43
   Compiling rustc-demangle v0.1.9
   Compiling memmap v0.6.2
   Compiling num_cpus v1.8.0
   Compiling rustc_llvm v0.0.0 (/home/vext01/source/rust/src/librustc_llvm)
error: failed to run custom build command for `rustc_llvm v0.0.0 (/home/vext01/source/rust/src/librustc_llvm)`
process didn't exit successfully: `/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/release/build/rustc_llvm-05b28adcfb95b2e9/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=/opt/llvm/bin/llvm-config
cargo:rerun-if-env-changed=LLVM_CONFIG
cargo:rustc-cfg=llvm_component="aarch64"
cargo:rustc-cfg=llvm_component="amdgpu"
cargo:rustc-cfg=llvm_component="arm"
cargo:rustc-cfg=llvm_component="asmparser"
cargo:rustc-cfg=llvm_component="bitreader"
cargo:rustc-cfg=llvm_component="bitwriter"
cargo:rustc-cfg=llvm_component="hexagon"
cargo:rustc-cfg=llvm_component="instrumentation"
cargo:rustc-cfg=llvm_component="interpreter"
cargo:rustc-cfg=llvm_component="ipo"
cargo:rustc-cfg=llvm_component="linker"
cargo:rustc-cfg=llvm_component="lto"
cargo:rustc-cfg=llvm_component="mcjit"
cargo:rustc-cfg=llvm_component="mips"
cargo:rustc-cfg=llvm_component="msp430"
cargo:rustc-cfg=llvm_component="nvptx"
cargo:rustc-cfg=llvm_component="powerpc"
cargo:rustc-cfg=llvm_component="sparc"
cargo:rustc-cfg=llvm_component="systemz"
cargo:rustc-cfg=llvm_component="webassembly"
cargo:rustc-cfg=llvm_component="x86"
cargo:rerun-if-changed-env=LLVM_RUSTLLVM
cargo:rerun-if-changed=../rustllvm/llvm-rebuild-trigger
cargo:rerun-if-changed=../rustllvm/.editorconfig
cargo:rerun-if-changed=../rustllvm/RustWrapper.cpp
cargo:rerun-if-changed=../rustllvm/rustllvm.h
cargo:rerun-if-changed=../rustllvm/ArchiveWrapper.cpp
cargo:rerun-if-changed=../rustllvm/PassWrapper.cpp
cargo:rerun-if-changed=../rustllvm/Linker.cpp
cargo:rerun-if-changed=../rustllvm/README
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("2")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_x86_64-unknown-linux-gnu = Some("c++")
CXXFLAGS_x86_64-unknown-linux-gnu = Some("-ffunction-sections -fdata-sections -fPIC -m64")
DEBUG = Some("false")
running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I/opt/llvm/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-g" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-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_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-e2b8d44760d75287/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp"
exit code: 0
running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I/opt/llvm/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-g" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-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_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-e2b8d44760d75287/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp"
cargo:warning=../rustllvm/RustWrapper.cpp: In function ‘LLVMOpaqueMetadata* LLVMRustDIBuilderCreateStaticVariable(LLVMRustDIBuilderRef, LLVMMetadataRef, const char*, const char*, LLVMMetadataRef, unsigned int, LLVMMetadataRef, bool, LLVMValueRef, LLVMMetadataRef, uint32_t)’:
cargo:warning=../rustllvm/RustWrapper.cpp:799:55: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘llvm::MDTuple*’ [-fpermissive]
cargo:warning=       InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
cargo:warning=                                                       ^
cargo:warning=In file included from ../rustllvm/rustllvm.h:63:0,
cargo:warning=                 from ../rustllvm/RustWrapper.cpp:11:
cargo:warning=/opt/llvm/include/llvm/IR/DIBuilder.h:582:33: note:   initializing argument 10 of ‘llvm::DIGlobalVariableExpression* llvm::DIBuilder::createGlobalVariableExpression(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DIType*, bool, llvm::DIExpression*, llvm::MDNode*, llvm::MDTuple*, uint32_t)’
cargo:warning=     DIGlobalVariableExpression *createGlobalVariableExpression(
cargo:warning=                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exit code: 1

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-I/opt/llvm/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wno-missing-field-initializers" "-pedantic" "-Wno-long-long" "-Wno-maybe-uninitialized" "-Wdelete-non-virtual-dtor" "-Wno-comment" "-g" "-fno-exceptions" "-fno-rtti" "-D_GNU_SOURCE" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-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_LTO" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0-codegen/x86_64-unknown-linux-gnu/release/build/rustc_llvm-e2b8d44760d75287/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp" with args "c++" did not execute successfully (status code exit code: 1).

', /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.25/src/lib.rs:2260:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:345
   7: cc::fail
   8: cc::Build::compile
   9: build_script_build::main
  10: std::rt::lang_start::{{closure}}
  11: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  12: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  13: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  14: main
  15: __libc_start_main
  16: _start

command did not execute successfully: "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--manifest-path" "/home/vext01/source/rust/src/librustc_codegen_llvm/Cargo.toml" "--features" "" "--message-format" "json"
expected success, got: exit code: 101
thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1101:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::begin_panic
             at libstd/panicking.rs:410
   6: bootstrap::compile::run_cargo
             at bootstrap/compile.rs:1101
   7: <bootstrap::compile::CodegenBackend as bootstrap::builder::Step>::run
             at bootstrap/compile.rs:686
   8: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:1215
   9: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
             at bootstrap/compile.rs:964
  10: bootstrap::builder::Builder::ensure
             at bootstrap/builder.rs:1215
  11: bootstrap::builder::Builder::compiler
             at bootstrap/builder.rs:579
  12: <bootstrap::compile::Test as bootstrap::builder::Step>::make_run
             at bootstrap/compile.rs:328
  13: bootstrap::builder::StepDescription::maybe_run
             at bootstrap/builder.rs:191
  14: bootstrap::builder::StepDescription::run
             at bootstrap/builder.rs:234
  15: bootstrap::builder::Builder::run_step_descriptions
             at bootstrap/builder.rs:571
  16: bootstrap::builder::Builder::execute_cli
             at bootstrap/builder.rs:561
  17: bootstrap::Build::build
             at bootstrap/lib.rs:479
  18: bootstrap::main
             at bootstrap/bin/main.rs:29
  19: std::rt::lang_start::{{closure}}
             at libstd/rt.rs:74
  20: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  21: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  22: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  23: std::rt::lang_start
             at libstd/rt.rs:74
  24: main
  25: __libc_start_main
  26: _start
failed to run: /home/vext01/source/rust/build/bootstrap/debug/bootstrap build --config .buildbot.toml --stage 1 src/libtest
Build completed unsuccessfully in 0:09:54

My config.toml:

[rust]
codegen-units = 0
debuginfo = true

[target.x86_64-unknown-linux-gnu]
llvm-config = "/opt/llvm/bin/llvm-config"

I'm using Debian 9.

I'll try to get a fix, but I'm no LLVM expert.

@vext01
Copy link
Contributor Author

vext01 commented Nov 6, 2018

It seems that LLVM added a new optional argument to createGlobalVariableExpression, but for some reason they didn't add it to the end of the argument list, so this causes us to pass argument 10 incorrectly.

The following makes the build pass:

diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 3dbde46f76..2a5bece1fe 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -796,7 +796,7 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
   llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
       unwrapDI<DIDescriptor>(Context), Name, LinkageName,
       unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
-      InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
+      InitExpr, unwrapDIPtr<MDNode>(Decl), nullptr, AlignInBits);

   InitVal->setMetadata("dbg", VarExpr);

I'll check the tests work.

@vext01
Copy link
Contributor Author

vext01 commented Nov 6, 2018

BTW: Do you expect to be able to target versions on LLVM with and without this argument? It might be more robust to pass the optional arguments as such, instead of as positional arguments?

@vext01
Copy link
Contributor Author

vext01 commented Nov 6, 2018

Not sure if this is to do with my change (or maybe a new LLVM), but the tests are failing with lots of "procedural macro API is used outside of a procedural macro" errors.

Here's the output of one:

command: "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/vext01/source/rust/src/test/ui-fulldeps/invalid-punct-ident-3.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/invalid-punct-ident-3/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/vext01/source/rust/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/invalid-punct-ident-3/auxiliary" "-A" "unused"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
thread '<unnamed>' panicked at 'procedural macro API is used outside of a procedural macro', libproc_macro/lib.rs:1314:13
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::begin_panic
             at ./src/libstd/panicking.rs:410
   6: proc_macro::Span::call_site
             at libproc_macro/lib.rs:1314
             at libproc_macro/lib.rs:297
   7: invalid_punct_ident::invalid_raw_ident
   8: std::panicking::try::do_call
             at libsyntax_ext/proc_macro_impl.rs:73
             at ./src/libstd/panic.rs:319
             at ./src/libstd/panicking.rs:310
   9: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  10: <std::thread::local::LocalKey<T>>::with
             at ./src/libstd/panicking.rs:289
             at ./src/libstd/panic.rs:398
             at libsyntax_ext/proc_macro_impl.rs:73
             at ./src/libproc_macro/lib.rs:1300
             at ./src/libstd/thread/local.rs:309
             at ./src/libstd/thread/local.rs:255
  11: <syntax_ext::proc_macro_impl::BangProcMacro as syntax::ext::base::ProcMacro>::expand
             at ./src/libproc_macro/lib.rs:1284
             at libsyntax_ext/proc_macro_impl.rs:72
  12: syntax::ext::expand::MacroExpander::expand_invoc
             at libsyntax/ext/expand.rs:857
             at libsyntax/ext/expand.rs:525
  13: syntax::ext::expand::MacroExpander::expand_fragment
             at libsyntax/ext/expand.rs:361
  14: syntax::ext::expand::MacroExpander::expand_crate
             at libsyntax/ext/expand.rs:288
  15: rustc_driver::driver::phase_2_configure_and_expand_inner::{{closure}}
             at librustc_driver/driver.rs:1011
             at ./src/librustc/util/common.rs:163
             at ./src/librustc/util/common.rs:157
             at librustc_driver/driver.rs:1010
  16: rustc_driver::driver::phase_2_configure_and_expand_inner
             at ./src/librustc/util/common.rs:163
             at ./src/librustc/util/common.rs:157
             at librustc_driver/driver.rs:963
  17: rustc_driver::driver::compile_input
             at librustc_driver/driver.rs:766
             at librustc_driver/driver.rs:186
  18: rustc_driver::run_compiler
             at librustc_driver/lib.rs:552
             at librustc_driver/lib.rs:474
             at librustc_driver/driver.rs:76
             at /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
             at librustc_driver/driver.rs:75
             at librustc_driver/lib.rs:473
  19: <scoped_tls::ScopedKey<T>>::set
             at librustc_driver/lib.rs:1725
             at librustc_driver/lib.rs:189
             at /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
             at ./src/libsyntax/lib.rs:123
             at /home/vext01/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  20: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at ./src/libsyntax/lib.rs:122
             at librustc_driver/lib.rs:188
             at librustc_driver/lib.rs:1640
             at ./src/libstd/panic.rs:319
  21: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  22: rustc_driver::run
             at ./src/libstd/panicking.rs:289
             at ./src/libstd/panic.rs:398
             at librustc_driver/lib.rs:1554
             at librustc_driver/lib.rs:1565
             at librustc_driver/lib.rs:1639
             at librustc_driver/lib.rs:187
  23: rustc_driver::main
             at librustc_driver/lib.rs:1718
  24: std::rt::lang_start::{{closure}}
             at ./src/libstd/rt.rs:74
  25: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  26: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  27: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:398
             at libstd/rt.rs:58
  28: main
  29: __libc_start_main
  30: _start
{"message":"proc macro panicked","code":null,"level":"error","spans":[{"file_name":"/home/vext01/source/rust/src/test/ui-fulldeps/invalid-punct-ident-3.rs","byte_start":552,"byte_end":573,"line_start":16,"line_end":16,"column_start":1,"column_end":22,"is_primary":true,"text":[{"text":"invalid_raw_ident!(); //~ ERROR proc macro panicked","highlight_start":1,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"message: procedural macro API is used outside of a procedural macro","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error: proc macro panicked\n  --> /home/vext01/source/rust/src/test/ui-fulldeps/invalid-punct-ident-3.rs:16:1\n   |\nLL | invalid_raw_ident!(); //~ ERROR proc macro panicked\n   | ^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: message: procedural macro API is used outside of a procedural macro\n\n"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}

@vext01
Copy link
Contributor Author

vext01 commented Nov 6, 2018

I'm just learning that Rust uses a fork of LLVM, so this is probably garbage. Sorry for the noise.

@vext01 vext01 closed this as completed Nov 6, 2018
@nikic
Copy link
Contributor

nikic commented Nov 6, 2018

@vext01 You are running fulldeps tests with a stage1 compiler. I believe a stage2 compiler is necessary for that.

It is generally not expected that rust is able to build against LLVM trunk. To support a newer version of LLVM the procedure would be to a) update https://github.com/rust-lang/llvm to a newer version (rebasing existing patches), b) update the llvm submodule in this repository and c) introduce version checks to support different LLVM versions. In this case, the appropriate check would be #if LLVM_VERSION_GE(8, 0).

What do you need the trunk version for though? Do you need some specific commits that have landed in the meantime?

@nikic
Copy link
Contributor

nikic commented Nov 6, 2018

To clarify, Rust supports building against vanilla LLVM, you don't need to use the fork. However, it only supports building against released versions of LLVM or the specific revision at which the fork currently is. It's hard to support anything else, because LLVM is a moving target and we only have the version number as a basis for conditional compilation.

@vext01
Copy link
Contributor Author

vext01 commented Nov 6, 2018

Hi nikic,

I'm involved a research project which is based on rustc. I need to be able to use the recent DILabel codegen, which sadly only landed in LLVM trunk this month.

Since my changes are not going to be suitable for upstream, I'm not sure it's fair to ask you guys to update your fork... Unless that's something you'd be doing anyway?

@vext01
Copy link
Contributor Author

vext01 commented Nov 7, 2018

@nikic since the tests passed when testing at stage2, I've raised a PR ^.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants