Help test out ThinLTO!

Building an API server for one of my projects (https://github.com/brdgme/api) seems to be failing with thinlto:

> cargo clean ;and cargo +nightly build
...
Finished dev [unoptimized + debuginfo] target(s) in 97.5 secs

> cargo clean ;and cargo +nightly build --release
...
Finished release [optimized] target(s) in 321.62 secs

> cargo clean ;and env RUSTFLAGS='-C codegen-units=16 -Z thinlto' cargo +nightly build --release
...
error: linking with `cc` failed: exit code: 1                                                                                                                                                 
  |                                                                                                                                                                                          
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/mi[60/1160]
pment/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen0-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/ro
cket_codegen-5a77027a60795a43.rocket_codegen1-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_co
degen10-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen11-a62b4e5b08a5a21d50ac25607c1bcb
a3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen12-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Developm
ent/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen13-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/roc
ket_codegen-5a77027a60795a43.rocket_codegen14-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_co
degen15-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen2-a62b4e5b08a5a21d50ac25607c1bcba
3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen3-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Developmen
t/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen4-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket
_codegen-5a77027a60795a43.rocket_codegen5-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codege
n6-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen7-a62b4e5b08a5a21d50ac25607c1bcba3.rs.
rust-cgu.o" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen8-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "/home/mick/Development/brd
gme/api/target/release/deps/rocket_codegen-5a77027a60795a43.rocket_codegen9-a62b4e5b08a5a21d50ac25607c1bcba3.rs.rust-cgu.o" "-o" "/home/mick/Development/brdgme/api/target/release/deps/libroc
ket_codegen-5a77027a60795a43.so" "/home/mick/Development/brdgme/api/target/release/deps/rocket_codegen-5a77027a60795a43.crate.metadata.rust-cgu.o" "/home/mick/Development/brdgme/api/target/r
elease/deps/rocket_codegen-5a77027a60795a43.crate.allocator.rust-cgu.o" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/mick/Development/brdgme/api/target/release/deps" "-L" "/h
ome/mick/Development/brdgme/api/target/release/build/ring-7bb6aa5547ba76b4/out" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib"
 "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/librocket-59c875ed219aeb07.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libisatty-cf9a80299d1e
ccfd.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libordermap-6d71f6333e3eb727.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/
libcookie-0accafaa2b8b70f2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libring-70ca3af228185a9d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/r
ustc.Mzk2LALmeebA/libpear-07778ed69f5d84a1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libstate-8e773b7b8cabac49.rlib" "-Wl,--no-whole-archive" "-Wl,--whole
-archive" "/tmp/rustc.Mzk2LALmeebA/libsmallvec-a71ffd0558e4657f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libmemchr-dbed1aa94975e3b0.rlib" "-Wl,--no-whole
-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libtoml-8f55302f625f1ecc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libserde-60e5c302f2ec389a.rlib
" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libuntrusted-05746f736ed19364.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libhyper
-ae17eb4ae682fcea.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libtypeable-4a4cdfc852912ac0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.
Mzk2LALmeebA/libtraitobject-5da415ec4ae73e95.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libnum_cpus-4b546f158fd539c4.rlib" "-Wl,--no-whole-archive" "-Wl,--
whole-archive" "/tmp/rustc.Mzk2LALmeebA/libhttparse-5d5ae6b8ace1de17.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libtime-3f975a6cc4765363.rlib" "-Wl,--no-wh
ole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libbase64-cec0550b4e77c7a9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libsafemem-c88b91ecb499ee
88.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libbyteorder-510bd8ec96c41eba.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/l
iburl-80979afd8e28a176.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libidna-c9c35c48abc6696c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc
.Mzk2LALmeebA/libunicode_normalization-99e16780b4964889.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libunicode_bidi-eb8a985e5a8a668f.rlib" "-Wl,--no-whole-a
rchive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libmatches-d1db8758bd655355.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libunicase-6bf43a03bfefa78a.r
lib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/libmime-051870413a8438f8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/liblog-828
f15c33c615081.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/liblazy_static-6356575eae998e88.rlib" "-Wl,--no-whole-archive" "-L" "/home/mick/.rustup/toolchains
/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-l" "rustc_plugin-d0c80037b5aaac2d" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-li
nux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_metadata-bb2d597388e12fda" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux
-gnu/lib" "-l" "syntax_ext-695c755b5dd0ae58" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "proc_macro-de758cede928c102"
 "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc-c0634755b42b7b43" "-L" "/home/mick/.rustup/toolchains/nightly-x86_
64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "test-366460307f425418" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-li
nux-gnu/lib" "-l" "rustc_const_math-83638df796dcf76f" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_back-c5d84d6c
e923267a" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "graphviz-a697e8b29c6ccee7" "-L" "/home/mick/.rustup/toolchains/
nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "fmt_macros-4670434b15ca0e96" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib
/x86_64-unknown-linux-gnu/lib" "-l" "arena-975ba8c035208613" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax-7196e
f5e760f9aed" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_errors-4578edf1e51fb5c0" "-L" "/home/mick/.rustup/tool
chains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "syntax_pos-b046ac2ed7c19f1e" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/
rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_data_structures-29a9e0acf5f0596c" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/
lib" "-l" "term-e11151919d251b1a" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "serialize-36b4846eb48b573b" "-L" "/home
/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "rustc_cratesio_shim-cbd936708ad27d6f" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rus
tc.Mzk2LALmeebA/libyansi-6f21e18c8115e25e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/liblibc-26a8b35647b7682f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-a
rchive" "/tmp/rustc.Mzk2LALmeebA/libpercent_encoding-f4732633d5733a94.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.Mzk2LALmeebA/liblanguage_tags-fdfb07340ea0469f.rlib" "-
Wl,--no-whole-archive" "-L" "/home/mick/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-l" "std-b502f7a95dd2ef98" "-Wl,-Bstati
c" "/tmp/rustc.Mzk2LALmeebA/libcompiler_builtins-563ad6af5ea8d854.rlib" "-Wl,-Bdynamic" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "
m" "-l" "rt" "-l" "pthread" "-l" "util" "-shared"
  = note: /tmp/rustc.Mzk2LALmeebA/librocket-59c875ed219aeb07.rlib(rocket-59c875ed219aeb07.rocket14-7ef39126e4028fdd6ced00bfd6ff8b3a.rs.rust-cgu.o): In function `<core::option::Option<&'a T>>
::cloned':
          rocket14-7ef39126e4028fdd6ced00bfd6ff8b3a.rs:(.text._ZN53_$LT$core..option..Option$LT$$RF$$u27$a$u20$T$GT$$GT$6cloned17h8ea82038ef2c0f1dE+0x6f): undefined reference to `<alloc::vec
::Vec<T> as core::clone::Clone>::clone'
          /tmp/rustc.Mzk2LALmeebA/libstate-8e773b7b8cabac49.rlib(state-8e773b7b8cabac49.state6-4a72e48b567e08ff7300829fd7f358c2.rs.rust-cgu.o):(.data.rel.ro.vtable.0.llvm.AF121354+0x18): und
efined reference to `<T as core::any::Any>::get_type_id'
          /tmp/rustc.Mzk2LALmeebA/libtoml-8f55302f625f1ecc.rlib(toml-8f55302f625f1ecc.toml15-bb395ca246079d316a0e9af094f1b9a5.rs.rust-cgu.o): In function `<toml::value::Value as core::clone:
:Clone>::clone':
          toml15-bb395ca246079d316a0e9af094f1b9a5.rs:(.text._ZN57_$LT$toml..value..Value$u20$as$u20$core..clone..Clone$GT$5clone17h7f2333d2841a1b07E+0xdd): undefined reference to `<alloc::ve
c::Vec<T> as core::clone::Clone>::clone'
          /tmp/rustc.Mzk2LALmeebA/libtoml-8f55302f625f1ecc.rlib(toml-8f55302f625f1ecc.toml15-bb395ca246079d316a0e9af094f1b9a5.rs.rust-cgu.o): In function `_ZN59_$LT$toml..value..Value$u20$as
$u20$core..cmp..PartialEq$GT$2eq17h62623508a5dde72bE.llvm.F597E872':
          toml15-bb395ca246079d316a0e9af094f1b9a5.rs:(.text._ZN59_$LT$toml..value..Value$u20$as$u20$core..cmp..PartialEq$GT$2eq17h62623508a5dde72bE.llvm.F597E872+0x137): undefined reference
to `core::slice::<impl core::cmp::PartialEq<[B]> for [A]>::eq'
          /tmp/rustc.Mzk2LALmeebA/libtoml-8f55302f625f1ecc.rlib(toml-8f55302f625f1ecc.toml6-bb395ca246079d316a0e9af094f1b9a5.rs.rust-cgu.o): In function `<core::iter::Cloned<I> as core::iter
::iterator::Iterator>::next':
          toml6-bb395ca246079d316a0e9af094f1b9a5.rs:(.text._ZN78_$LT$core..iter..Cloned$LT$I$GT$$u20$as$u20$core..iter..iterator..Iterator$GT$4next17hbd3b903d2ffb2f6eE+0x1f): undefined refer
ence to `<core::option::Option<&'a T>>::cloned'
          /tmp/rustc.Mzk2LALmeebA/libhyper-ae17eb4ae682fcea.rlib(hyper-ae17eb4ae682fcea.hyper2-bef1d2f76f358a122034ddf6ba084555.rs.rust-cgu.o): In function `_ZN58_$LT$mime..Mime$LT$T$GT$$u20
$as$u20$core..clone..Clone$GT$5clone17he3a9ceda023c49ddE.llvm.BCD7E30C':
          hyper2-bef1d2f76f358a122034ddf6ba084555.rs:(.text._ZN58_$LT$mime..Mime$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he3a9ceda023c49ddE.llvm.BCD7E30C+0x1e1): undefined referenc
e to `<alloc::vec::Vec<T> as core::clone::Clone>::clone'
          /tmp/rustc.Mzk2LALmeebA/libhyper-ae17eb4ae682fcea.rlib(hyper-ae17eb4ae682fcea.hyper2-bef1d2f76f358a122034ddf6ba084555.rs.rust-cgu.o): In function `_ZN65_$LT$language_tags..Language
Tag$u20$as$u20$core..clone..Clone$GT$5clone17hb666d1ac2994b656E.llvm.BCD7E30C':
          hyper2-bef1d2f76f358a122034ddf6ba084555.rs:(.text._ZN65_$LT$language_tags..LanguageTag$u20$as$u20$core..clone..Clone$GT$5clone17hb666d1ac2994b656E.llvm.BCD7E30C+0x3d): undefined re
ference to `<alloc::vec::Vec<T> as core::clone::Clone>::clone'
          hyper2-bef1d2f76f358a122034ddf6ba084555.rs:(.text._ZN65_$LT$language_tags..LanguageTag$u20$as$u20$core..clone..Clone$GT$5clone17hb666d1ac2994b656E.llvm.BCD7E30C+0xb5): undefined re
ference to `<alloc::vec::Vec<T> as core::clone::Clone>::clone'
          hyper2-bef1d2f76f358a122034ddf6ba084555.rs:(.text._ZN65_$LT$language_tags..LanguageTag$u20$as$u20$core..clone..Clone$GT$5clone17hb666d1ac2994b656E.llvm.BCD7E30C+0xf9): undefined re
ference to `<alloc::vec::Vec<T> as core::clone::Clone>::clone'
          /tmp/rustc.Mzk2LALmeebA/libhyper-ae17eb4ae682fcea.rlib(hyper-ae17eb4ae682fcea.hyper7-bef1d2f76f358a122034ddf6ba084555.rs.rust-cgu.o): In function `_ZN84_$LT$alloc..btree..map..BTre
eMap$LT$K$C$$u20$V$GT$$u20$as$u20$core..clone..Clone$GT$5clone13clone_subtree17hb2489d6af4a34d57E.llvm.EC9CFF5A':
          hyper7-bef1d2f76f358a122034ddf6ba084555.rs:(.text._ZN84_$LT$alloc..btree..map..BTreeMap$LT$K$C$$u20$V$GT$$u20$as$u20$core..clone..Clone$GT$5clone13clone_subtree17hb2489d6af4a34d57E
.llvm.EC9CFF5A+0x176): undefined reference to `<alloc::vec::Vec<T> as core::clone::Clone>::clone'
          hyper7-bef1d2f76f358a122034ddf6ba084555.rs:(.text._ZN84_$LT$alloc..btree..map..BTreeMap$LT$K$C$$u20$V$GT$$u20$as$u20$core..clone..Clone$GT$5clone13clone_subtree17hb2489d6af4a34d57E
.llvm.EC9CFF5A+0x321): undefined reference to `<alloc::vec::Vec<T> as core::clone::Clone>::clone'
          /tmp/rustc.Mzk2LALmeebA/libunicode_bidi-eb8a985e5a8a668f.rlib(unicode_bidi-eb8a985e5a8a668f.unicode_bidi8-6ebb47785e5908234a709dc681d56b55.rs.rust-cgu.o):(.data.rel.ro.vtable.7.llv
m.A0D96016+0x18): undefined reference to `<core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_str'
          /tmp/rustc.Mzk2LALmeebA/libunicode_bidi-eb8a985e5a8a668f.rlib(unicode_bidi-eb8a985e5a8a668f.unicode_bidi8-6ebb47785e5908234a709dc681d56b55.rs.rust-cgu.o):(.data.rel.ro.vtable.7.llv
m.A0D96016+0x20): undefined reference to `<core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_char'
          /tmp/rustc.Mzk2LALmeebA/libunicode_bidi-eb8a985e5a8a668f.rlib(unicode_bidi-eb8a985e5a8a668f.unicode_bidi8-6ebb47785e5908234a709dc681d56b55.rs.rust-cgu.o):(.data.rel.ro.vtable.7.llv
m.A0D96016+0x28): undefined reference to `<core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_fmt'
          /usr/bin/ld: /home/mick/Development/brdgme/api/target/release/deps/librocket_codegen-5a77027a60795a43.so: hidden symbol `_ZN63_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..clone..
Clone$GT$5clone17h8ba1e6349161123aE' isn't defined
          /usr/bin/ld: final link failed: Bad value
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `rocket_codegen`.
warning: build failed, waiting for other jobs to finish...
error: build failed

I had a similar problem. You might want to try with RUSTFLAGS='-C codegen-units=16' and RUSTFLAGS='-Z thinlto' (ie, once without ThinLTO and once without multiple codegen units) to see if those fail as well. In my case, it was only when I had both features enabled that I got the linking errors.

Linux rustc 1.22.0-nightly (692b94ae2 2017-10-09) + AMD Ryzen 1700 + SSD

I have [profile.dev] opt-level = 1 and [profile.release] lto = true in Cargo.toml.

45 crates + ~5K sloc:

  • codegen-units=1 dev [optimized + debuginfo] target(s) in 54.6 secs
  • codegen-units=16 dev [optimized + debuginfo] target(s) in 27.37 secs
  • codegen-units=1 release [optimized] target(s) in 141.81 secs
  • codegen-units=16 -Z thinlto release [optimized] target(s) in 47.29 secs
1 Like

Tried on https://github.com/snipsco/rustling-ontology which has historically be a huge source of pain.

10/10 13:02 ~/dev/snips/rustling-ontology% cargo build --release
Finished release [optimized] target(s) in 1110.76 secs
10/10 13:24 ~/dev/snips/rustling-ontology% cargo +nightly build --release
Finished release [optimized] target(s) in 1036.68 secs
10/10 13:48 ~/dev/snips/rustling-ontology% RUSTFLAGS='-C codegen-units=16 -Z thinlto' cargo +nightly build --release
Finished release [optimized] target(s) in 401.22 secs

Runtime Benches show no measurable impact.

Congrats !

Indeed yeah, basically turning on ThinLTO, release, and disabling inlining in all cgus to measure the impact of that.

Thanks for testing out! Which nightly were you using perchance? Using rustc 1.22.0-nightly (692b94ae2 2017-10-09) I get an error like:

error: `std::sync::atomic::AtomicBool::new` is not yet stable as a const fn
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/yansi-0.3.2/src/lib.rs:479:57
    |
479 | #[cfg(feature="nightly")] static DISABLED: AtomicBool = AtomicBool::new(false);
    |                                                         ^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: in Nightly builds, add `#![feature(const_atomic_bool_new)]` to the crate attributes to enable

error: aborting due to previous error

so I haven’t been able to reproduce yet :frowning:

Building https://github.com/Nemo157/ripfs-rs with rustc 1.22.0-nightly (692b94ae2 2017-10-09) on a i5-6200U (2 cores, 4 threads) with SSD gives me:

RUSTFLAGS='-C codegen-units=1' cargo +nightly build
355.88s user 9.81s system 230% cpu 2:38.52 total

RUSTFLAGS='-C codegen-units=16' cargo +nightly build
383.83s user 10.60s system 267% cpu 2:27.20 total

RUSTFLAGS='-C codegen-units=1' cargo +nightly build --release
674.13s user 7.93s system 218% cpu 5:12.00 total
550.32s user 5.23s system 238% cpu 3:52.69 total

RUSTFLAGS='-C codegen-units=16 -Z thinlto' cargo +nightly build --release
1081.38s user 9.98s system 314% cpu 5:47.26 total
906.41s user 7.11s system 347% cpu 4:22.85 total

(the second timings for the release builds were performed a few hours after the first set of timings)

so, slightly slower on the release build, but performing much more work during that time. (No benchmarks for any of this code unfortunately).

@alexcrichton

$ rustc +nightly --version
rustc 1.22.0-nightly (692b94ae2 2017-10-09)
$ RUSTFLAGS='-C codegen-units=1' cargo +nightly build
      128.87 real       369.70 user        30.71 sys
$ RUSTFLAGS='-C codegen-units=16' cargo +nightly build
      118.54 real       477.28 user        38.48 sys
$ RUSTFLAGS='-C codegen-units=1' cargo +nightly build --release
      364.40 real       911.12 user        31.99 sys
$ RUSTFLAGS='-C codegen-units=16 -Z thinlto' cargo +nightly build --release
      247.08 real      1296.57 user        41.38 sys
$ RUSTFLAGS='-C codegen-units=16 -Z thinlto -Z inline-in-all-cgus=no' cargo +nightly build --release
      280.06 real      1427.57 user        48.12 sys

@sfackler fascinating! I actually misread the numbers before I think, looks like improvements across the board with the OP’s recommendations?

Yep!

Ah, I had to cargo update first as I haven’t updated my deps in a while. I’ve done that and pushed to the update-deps branch (git clone -b update-deps https://github.com/brdgme/api.git)

My rustc details (I use nightly by default):

$ rustup show
Default host: x86_64-unknown-linux-gnu

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
--------------------------------------

x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.22.0-nightly (692b94ae2 2017-10-09)

Also, as @joshlf suggests, the build works using one option or the other, but not both at the same time:

$ env RUSTFLAGS='-Z thinlto' cargo +nightly build --release
...
    Finished release [optimized] target(s) in 308.90 secs

$ env RUSTFLAGS='-C codegen-units=16' cargo +nightly build --release
...
    Finished release [optimized] target(s) in 164.39 secs

Oh sorry @cristicbz I think I forgot to reply! I thought it was from cargo clean but I may have been wrong. I’ll check again when I get the chance. And yes -j1 should kill all parallelism.

Thanks for testing! When building channel though I get:

error[E0599]: no method named `destroy` found for type `coco::epoch::Ptr<'_, flavors::list::Node<T>>` in the current scope
   --> src/flavors/list.rs:283:30
    |
283 |                         node.destroy();
    |                              ^^^^^^^

error: aborting due to previous error

Mind sharing the lockfile you’re using?

On distributary, a research prototype of a caching database:

$ cargo clean -p distributary
$ env | grep -i RUSTFLAGS
RUSTFLAGS=-C link-args=-fuse-ld=gold -C target-cpu=native
$ cargo b --features=binaries --bin=vote --release
...
    Finished release [optimized + debuginfo] target(s) in 333.32 secs
$ target/release/vote -r 30 -q --avg --stage | tail -n2
avg PUT: 852343.09
avg GET: 2021065.57
$ cargo clean -p distributary
$ env RUSTFLAGS="$RUSTFLAGS -C codegen-units=16 -Z thinlto'" \
  cargo b --features binaries --bin vote --release
...
    Finished release [optimized + debuginfo] target(s) in 232.18 secs
$ target/release/vote -r 30 -q --avg --stage | tail -n2
avg PUT: 827089.96
avg GET: 1884244.87

This is with a 4-core (8 HT) Intel® Xeon® CPU E3-1240 v5 @ 3.50GHz. Ran the same thing again and got approximately the same results.

So, compile time decreased by ~30% (\o/), runtime performance decreased by 3% for one benchmark (PUT; relatively complex) and 7% for another (GET; basically just hashmap lookups). Good work! :smiley:

EDIT: For completeness, ThinLTO without ld.gold compiles in 229s (so faster than with ld.gold!), and neither ThinLTO nor ld.gold compiles in 334s (so marginally slower than ld.gold). Maybe it’s time to ditch ld.gold from my RUSTFLAGS…?

Thanks! I’ve reported this as https://github.com/rust-lang/rust/issues/45195

Bah I can never seem to reproduce these results :frowning:

So checking out channel locally I get:

what time
release full build 4.91
touch flavors/mod.rs release build 0.83
release + 16 CGU + ThinLTO 4.33
touch flavors/mod.rs thinlto build 0.62

Just to confirm, you were measuring the time reported by Cargo, right?

Testing rustc 1.22.0-nightly (d6d711dd8 2017-10-10) on my lewton project, commit 0d3fc027c8fb7198072a164830709742e7328379, with the command cargo +nightly build --release and RUSTFLAGS='-C codegen-units=16 -Z thinlto' sometimes prepended, sometimes not, in the dev/cmp subdir:

what compilation time benchmark times
First run no ThinLTO 37.70s 3.4114s, 3.4178s
First run with ThinLTO 29.92s 3.4304s, 3.4247s
Second run no ThinLTO 38.59s 3.4271s, 3.4571s
Second run with ThinLTO 29.37s 3.4219s, 3.4747s

Here, the “benchmark time” is the reported “Overall time spent for decoding by us” in the output of cargo +nightly run --release bench. So a solid >20% speedup in compilation times while the runtime performance didn’t really suffer. Great job!

I’ve also ran a second benchmark, now not compiling the benchmark crate, which pulls in all of hyper and all its dependencies, but compiling only the lewton crate plus its dependencies. cargo +nightly build --release in the main directory of the project:

what compilation time
First run with ThinLTO 4.21s
First run no ThinLTO 6.66s
Second run with ThinLTO 4.20s
Second run no ThinLTO 6.66s

Again, a solid improvement! ThinLTO looks really nice, looking forward to it!

From the current version of slab-alloc from cargo clean before each compilation:

Summary

Compilation difference: 2.5% slower

Runtime difference: 5.5% slower

Commands

(output trimmed)

$ time cargo test --release --no-run
real    1m30.323s
user    1m32.598s
sys     0m5.703s
$ time cargo test --release
real   0m8.650s
user   0m13.695s
sys    0m5.665s
$ RUSTFLAGS='-C codegen-units=16 -Z thinlto' time cargo test --release --no-run
real   1m32.65s
user   3m4.69s
sys    0m8.18s
$ RUSTFLAGS='-C codegen-units=16 -Z thinlto' time cargo test --release
real   0m9.15s
user   0m15.88s
sys    0m5.53s

Tried this with rust-belt, a Piston game, on Windows 10 using MSVC toolchain and everything :fire:exploded :fire: :blush:

A normal nightly build worked fine, but after setting the RUSTFLAGS='-C codegen-units=16 -Z thinlto' environment variable:

PS > rustc +nightly --version
rustc 1.22.0-nightly (d6d711dd8 2017-10-10)
PS > Measure-Command {cargo +nightly build --release}
   Compiling num-traits v0.1.40
   Compiling piston-texture v0.5.0
   Compiling piston-float v0.3.0
   Compiling gdi32-sys v0.1.1
   Compiling rayon-core v1.2.1
   Compiling lazy_static v0.2.8
   Compiling byteorder v0.4.2
   Compiling khronos_api v1.0.1
   Compiling sdl2-sys v0.30.0
   Compiling winapi v0.2.8
   Compiling color_quant v1.0.0
   Compiling byteorder v1.1.0
   Compiling bitflags v0.8.2
   Compiling bitflags v0.7.0
   Compiling scoped_threadpool v0.1.7
   Compiling linked-hash-map v0.0.10
   Compiling shader_version v0.2.2
   Compiling futures v0.1.15
   Compiling either v1.1.0
   Compiling winapi-build v0.1.1
   Compiling libc v0.2.30
   Compiling log v0.3.8
   Compiling inflate v0.2.0
   Compiling bitflags v0.9.1
   Compiling unicode-xid v0.0.4
   Compiling quote v0.3.15
   Compiling fnv v1.0.5
   Compiling scopeguard v0.3.2
   Compiling current v0.1.2
   Compiling interpolation v0.1.0
   Compiling lzw v0.10.0
   Compiling read_color v0.1.0
   Compiling piston-shaders_graphics2d v0.3.1
   Compiling odds v0.2.25
   Compiling rustc-serialize v0.3.24
   Compiling adler32 v1.0.2
   Compiling piston-viewport v0.3.0
   Compiling vecmath v0.3.0
   Compiling stb_truetype v0.2.1
   Compiling num-integer v0.1.35
   Compiling enum_primitive v0.1.1
   Compiling draw_state v0.7.1
   Compiling itertools v0.5.10
   Compiling rand v0.3.16
   Compiling num_cpus v1.6.2
   Compiling shared_library v0.1.7
   Compiling shell32-sys v0.1.1
   Compiling user32-sys v0.1.2
   Compiling kernel32-sys v0.2.2
   Compiling dwmapi-sys v0.1.0
   Compiling xml-rs v0.6.1
   Compiling coco v0.1.1
   Compiling syn v0.10.8
   Compiling gif v0.9.2
   Compiling nodrop v0.1.9
   Compiling deflate v0.7.16
   Compiling piston2d-graphics v0.21.1
   Compiling num-iter v0.1.34
   Compiling num-rational v0.1.39
   Compiling pistoncore-input v0.18.0
   Compiling uuid v0.1.18
   Compiling arrayvec v0.3.23
   Compiling gl_generator v0.5.5
   Compiling png v0.9.0
   Compiling num v0.1.40
   Compiling pistoncore-window v0.27.0
   Compiling piston-ai_behavior v0.20.0
   Compiling rusttype v0.2.1
   Compiling rayon v0.8.2
   Compiling sdl2 v0.30.0
   Compiling gl v0.6.3
   Compiling glutin v0.9.2
   Compiling gfx_gl v0.3.1
error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-wi
ndows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.
build_script_build0-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-
663f376aa26c8e14.build_script_build1-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\bu
ild_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-66
3f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build11-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\rel
ease\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build12-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust
-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build13-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\Pyc
harmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build14-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:
\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build15-e87655a1e7641c6297b583d3fdf462d7-exe.
rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build2-e87655a1e7641c6297b5
83d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build3-e87
655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_
script_build4-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f37
6aa26c8e14.build_script_build5-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_sc
ript_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663f376aa
26c8e14\\build_script_build-663f376aa26c8e14.build_script_build7-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\bu
ild\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build8-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "C:\\Users\\User\\PycharmProjects\\rust-belt\\ta
rget\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.build_script_build9-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o" "/OUT:C:\\Users\\User\\PycharmP
rojects\\rust-belt\\target\\release\\build\\gl-663f376aa26c8e14\\build_script_build-663f376aa26c8e14.exe" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\build\\gl-663
f376aa26c8e14\\build_script_build-663f376aa26c8e14.crate.allocator.rust-cgu.o" "/OPT:REF,ICF" "/DEBUG" "/NATVIS:C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\
lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/LIBPATH:C:\\Users\\User\\Pycha
rmProjects\\rust-belt\\target\\release\\deps" "/LIBPATH:C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\U
ser\\PycharmProjects\\rust-belt\\target\\release\\deps\\libgl_generator-f52d9c6c7f101e41.rlib" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\deps\\libkhronos_api-f9b
b714cd9297f1e.rlib" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\deps\\libxml-ce6952d9a4f9ec8b.rlib" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\\release\\
deps\\liblog-c32f21934081144a.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-a91c2a6028cf1013.rlib" "C
:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-a9b1027d636a67d7.rlib" "C:\\Users\\User\\.rustup\\tool
chains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-d53c09992d33481a.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-m
svc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-9d16af57011a2f55.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-
msvc\\lib\\liballoc_system-65a37e54f8dfe20b.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-d9507359e
ef749d1.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_unicode-0d6934d38b730983.rlib" "C:\\Users\\User
\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-b7e12bf113e20b0c.rlib" "C:\\Users\\User\\PycharmProjects\\rust-belt\\target\
\release\\deps\\libbitflags-3c9e8172df8f96b0.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-19fcc2983
7703e22.rlib" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-4e0c1978d34828d3.rlib" "advapi32.
lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "msvcrt.lib"
  = note: build_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN3log20MAX_LOG_LEVEL
_FILTER17h7e1e02cdf1b46703E imported in function _ZN96_$LT$gl_generator..registry..parse..Remove$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert17h12cbc58d1cb8d7f2E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4049: locally defined symbol _ZN3log20MAX_LOG_LEVEL_
FILTER17h7e1e02cdf1b46703E imported
          build_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN96_$LT$gl_generator
..registry..parse..Remove$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert4_LOC17h2329dac46fe74024E imported in function _ZN96_$LT$gl_generator..registry..parse..Remove$
u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert17h12cbc58d1cb8d7f2E
          build_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN97_$LT$gl_generator
..registry..parse..Feature$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert4_LOC17h2c52d27d807b5a4bE imported in function _ZN97_$LT$gl_generator..registry..parse..Featur
e$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert17he72581d50300447eE
          build_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN97_$LT$gl_generator
..registry..parse..Feature$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert4_LOC17hdd8fdf6c9e901ed9E imported in function _ZN97_$LT$gl_generator..registry..parse..Featur
e$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert17he72581d50300447eE
          build_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN97_$LT$gl_generator
..registry..parse..Require$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert4_LOC17h7f2937e0c29d7856E imported in function _ZN97_$LT$gl_generator..registry..parse..Requir
e$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert17h4665ec258d691339E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4049: locally defined symbol _ZN97_$LT$gl_generator.
.registry..parse..Require$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert4_LOC17h7f2937e0c29d7856E imported
          build_script_build-663f376aa26c8e14.build_script_build10-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN99_$LT$gl_generator
..registry..parse..Extension$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert4_LOC17he764b83bf604d3a4E imported in function _ZN99_$LT$gl_generator..registry..parse..Exte
nsion$u20$as$u20$gl_generator..registry..parse..FromXml$GT$7convert17hed5e1a9c4332f291E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse11consume_two4_LOC17h44c9d48522a1d046E imported in function _ZN12gl_generator8registry5parse5Parse11consume_two17h94fcb028f01fb4a3E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse11consume_two4_LOC17h2a42e1609053f877E imported in function _ZN12gl_generator8registry5parse5Parse11consume_two17h94fcb028f01fb4a3E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse11consume_two4_LOC17h56a75189739a55f9E imported in function _ZN12gl_generator8registry5parse5Parse11consume_two17h94fcb028f01fb4a3E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse11consume_two4_LOC17h5f40d8cfdefe4c01E imported in function _ZN12gl_generator8registry5parse5Parse11consume_two17h94fcb028f01fb4a3E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse11consume_two4_LOC17h385a1d09a0f877eeE imported in function _ZN12gl_generator8registry5parse5Parse11consume_two17h94fcb028f01fb4a3E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse11consume_two4_LOC17h9ac2b50b434c29cbE imported in function _ZN12gl_generator8registry5parse5Parse11consume_two17h94fcb028f01fb4a3E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse5parse4_LOC17h692fcc489b8ff20bE imported in function _ZN12gl_generator8registry5parse5Parse5parse17h9fe1ef6ba0512132E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse5parse4_LOC17h98ebf5de72150018E imported in function _ZN12gl_generator8registry5parse5Parse5parse17h9fe1ef6ba0512132E
          build_script_build-663f376aa26c8e14.build_script_build6-e87655a1e7641c6297b583d3fdf462d7-exe.rs.rust-cgu.o : warning LNK4217: locally defined symbol _ZN12gl_generator8regis
try5parse5Parse5parse4_LOC17h183d20f64b04aed8E imported in function _ZN12gl_generator8registry5parse5Parse5parse17h9fe1ef6ba0512132E
          libgl_generator-f52d9c6c7f101e41.rlib(gl_generator-f52d9c6c7f101e41.gl_generator15-b1cc1ec29fa274365c43d8de1f2c5af.rs.rust-cgu.o) : error LNK2019: unresolved external symbo
l _ZN63_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h34bacf41d9423cd8E referenced in function _ZN53_$LT$core..option..Option$LT$$RF$$u27$a$u20$T$GT$$GT$6clo
ned17hadbbecd00a0d3c9dE
          C:\Users\User\PycharmProjects\rust-belt\target\release\build\gl-663f376aa26c8e14\build_script_build-663f376aa26c8e14.exe : fatal error LNK1120: 1 unresolved externals

error: aborting due to previous error

error: Could not compile `gl`.

crash

Could someone help me enable JIT in Rust as indicated in the helpful error pop up? :smile:

@johnthagen thanks for testing! I think you’ve run into a combination of https://github.com/rust-lang/rust/pull/45203 and https://github.com/rust-lang/rust/pull/45215, maybe best to come back and try again once those have landed?