rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.65k stars 12.75k forks source link

Calling a function pointer from llvm_asm no longer compiles in recent nightlies #72798

Closed IsaacWoods closed 4 years ago

IsaacWoods commented 4 years ago

In recent nightlies (first detected in rustc 1.45.0-nightly (4bd32c980 2020-05-29), but likely before that but went untested due to unavailable components), this no longer compiles:

#![feature(llvm_asm)]

extern "C" fn foo() {}

fn main() {
    unsafe { llvm_asm!("call $0"
    :
    : "i"(foo as extern "C" fn())
    :
    : "intel"
    );
    }
}

with the error:

   Compiling playground v0.0.1 (/playground)
error: <inline asm>:2:2: error: invalid operand for instruction
        call offset _ZN10playground3foo17h8f57d96aabe40932E
        ^

  --> src/main.rs:6:14
   |
6  |       unsafe { llvm_asm!("call $0"
   |  ______________^
7  | |     :
8  | |     : "i"(foo as extern "C" fn())
9  | |     :
10 | |     : "intel"
11 | |     );
   | |______^

error: aborting due to previous error

error: could not compile `playground`.

Worse, this incorrect version seems to outright crash LLVM:

#![feature(llvm_asm)]

extern "C" fn foo() {}

fn main() {
    unsafe { llvm_asm!("call $0"
    :
    : "i"(foo)
    :
    : "intel"
    );
    }
}

with the output (complete):

   Compiling playground v0.0.1 (/playground)
error: could not compile `playground`.

Caused by:
  process didn't exit successfully: `rustc --crate-name playground --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -Cembed-bitcode=no -C codegen-units=1 -C debuginfo=2 -C metadata=d7d87bff5be65f09 -C extra-filename=-d7d87bff5be65f09 --out-dir /playground/target/debug/deps -L dependency=/playground/target/debug/deps --extern addr2line=/playground/target/debug/deps/libaddr2line-adf7aea1e20cc3ae.rlib --extern adler32=/playground/target/debug/deps/libadler32-2fe68bff4d089a26.rlib --extern aho_corasick=/playground/target/debug/deps/libaho_corasick-27f3ea226cff8fcc.rlib --extern ansi_term_0_11_0=/playground/target/debug/deps/libansi_term-c8534287de1c3d4e.rlib --extern ansi_term=/playground/target/debug/deps/libansi_term-4f64c70ad284671e.rlib --extern approx=/playground/target/debug/deps/libapprox-a8152ffaee424e36.rlib --extern arc_swap=/playground/target/debug/deps/libarc_swap-3a56e4a5770e4847.rlib --extern arrayvec=/playground/target/debug/deps/libarrayvec-bcab38492809a44e.rlib --extern async_trait=/playground/target/debug/deps/libasync_trait-0d7d0f7f6f8629f8.so --extern atty=/playground/target/debug/deps/libatty-ad8ae03d67494eb5.rlib --extern autocfg_0_1_7=/playground/target/debug/deps/libautocfg-e73498f65bda1b25.rlib --extern autocfg=/playground/target/debug/deps/libautocfg-73381350060d504f.rlib --extern backtrace=/playground/target/debug/deps/libbacktrace-ab13ac2cf9fdd507.rlib --extern backtrace_sys=/playground/target/debug/deps/libbacktrace_sys-a5c372281d81be3b.rlib --extern base64_0_11_0=/playground/target/debug/deps/libbase64-aaba320b5e40231d.rlib --extern base64=/playground/target/debug/deps/libbase64-c8d04988c2973358.rlib --extern bit_set=/playground/target/debug/deps/libbit_set-045c78ec5b1a188a.rlib --extern bit_vec=/playground/target/debug/deps/libbit_vec-7168a09b7602a52c.rlib --extern bitflags=/playground/target/debug/deps/libbitflags-f42abdc0e70afba8.rlib --extern block_buffer=/playground/target/debug/deps/libblock_buffer-6a4763a4ad3657ff.rlib --extern block_padding=/playground/target/debug/deps/libblock_padding-3e19f5c7f364ce82.rlib --extern bstr=/playground/target/debug/deps/libbstr-fcc559893c7193fd.rlib --extern byte_tools=/playground/target/debug/deps/libbyte_tools-686bbfa0312ea43a.rlib --extern bytemuck=/playground/target/debug/deps/libbytemuck-32e08c6f36f1a181.rlib --extern byteorder=/playground/target/debug/deps/libbyteorder-2aad4d181d433147.rlib --extern bytes=/playground/target/debug/deps/libbytes-193217c876cec333.rlib --extern cc=/playground/target/debug/deps/libcc-a2a0bee1ecec6c5c.rlib --extern cfg_if=/playground/target/debug/deps/libcfg_if-d4ba00f546f387f4.rlib --extern chrono=/playground/target/debug/deps/libchrono-1bf0f16f6f3ed618.rlib --extern clap=/playground/target/debug/deps/libclap-817ab53e0738c137.rlib --extern color_quant=/playground/target/debug/deps/libcolor_quant-db1b7a5cffbb68ab.rlib --extern crc32fast=/playground/target/debug/deps/libcrc32fast-099ca00e89e54f56.rlib --extern crossbeam=/playground/target/debug/deps/libcrossbeam-8b203564191de985.rlib --extern crossbeam_channel=/playground/target/debug/deps/libcrossbeam_channel-fb10a6e28866d252.rlib --extern crossbeam_deque=/playground/target/debug/deps/libcrossbeam_deque-063654b467007c7f.rlib --extern crossbeam_epoch=/playground/target/debug/deps/libcrossbeam_epoch-ea3272ba9c6af7f1.rlib --extern crossbeam_queue=/playground/target/debug/deps/libcrossbeam_queue-7c46ba838f35508e.rlib --extern crossbeam_utils=/playground/target/debug/deps/libcrossbeam_utils-b0c9420a849811d3.rlib --extern crypto_mac=/playground/target/debug/deps/libcrypto_mac-fb768ef0fe3d0fd2.rlib --extern csv=/playground/target/debug/deps/libcsv-bddaadbe024f288b.rlib --extern csv_core=/playground/target/debug/deps/libcsv_core-fe10c5cab7298e6a.rlib --extern data_encoding=/playground/target/debug/deps/libdata_encoding-705f0024064d5b2d.rlib --extern deflate=/playground/target/debug/deps/libdeflate-c442f653a6e3979b.rlib --extern digest=/playground/target/debug/deps/libdigest-f0768f4ddfc2c63f.rlib --extern dtoa=/playground/target/debug/deps/libdtoa-3c6e432c82ce5e8d.rlib --extern either=/playground/target/debug/deps/libeither-111226c79e736bb5.rlib --extern encoding_rs=/playground/target/debug/deps/libencoding_rs-c6289ce6f6d40a2e.rlib --extern env_logger=/playground/target/debug/deps/libenv_logger-029a5fc8cd869bff.rlib --extern error_chain=/playground/target/debug/deps/liberror_chain-9d7efd2cac1cbe92.rlib --extern failure=/playground/target/debug/deps/libfailure-b2d506ea2542c337.rlib --extern failure_derive=/playground/target/debug/deps/libfailure_derive-d9d854f1ea57f924.so --extern fake_simd=/playground/target/debug/deps/libfake_simd-f9498d0254c28cba.rlib --extern fallible_iterator=/playground/target/debug/deps/libfallible_iterator-df10359196731746.rlib --extern fallible_streaming_iterator=/playground/target/debug/deps/libfallible_streaming_iterator-15a2067aed6d9788.rlib --extern filetime=/playground/target/debug/deps/libfiletime-75a364398acdff82.rlib --extern fixedbitset=/playground/target/debug/deps/libfixedbitset-6d8039314ff70772.rlib --extern flate2=/playground/target/debug/deps/libflate2-66990ffb054a7de7.rlib --extern fnv=/playground/target/debug/deps/libfnv-788d4efe34f585a1.rlib --extern foreign_types=/playground/target/debug/deps/libforeign_types-3f18b4c5fafa1975.rlib --extern foreign_types_shared=/playground/target/debug/deps/libforeign_types_shared-69dea419f1b9a04b.rlib --extern futf=/playground/target/debug/deps/libfutf-8cff30b85b156183.rlib --extern futures=/playground/target/debug/deps/libfutures-2483620752958c5a.rlib --extern futures_channel=/playground/target/debug/deps/libfutures_channel-d281c2941305c8d9.rlib --extern futures_core=/playground/target/debug/deps/libfutures_core-cbc8d6c40ed001b8.rlib --extern futures_executor=/playground/target/debug/deps/libfutures_executor-a60a18b78e1d3bfa.rlib --extern futures_io=/playground/target/debug/deps/libfutures_io-3e0572517b694d08.rlib --extern futures_macro=/playground/target/debug/deps/libfutures_macro-b55490faa6436c74.so --extern futures_sink=/playground/target/debug/deps/libfutures_sink-e61130df3d371474.rlib --extern futures_task=/playground/target/debug/deps/libfutures_task-2d33cb6eba129f13.rlib --extern futures_util=/playground/target/debug/deps/libfutures_util-65b6a90e418a5524.rlib --extern generic_array_0_12_3=/playground/target/debug/deps/libgeneric_array-cda2cdbd75e7affb.rlib --extern generic_array=/playground/target/debug/deps/libgeneric_array-24c25087d39000e1.rlib --extern getrandom=/playground/target/debug/deps/libgetrandom-d3f175b0d3564d4b.rlib --extern gif=/playground/target/debug/deps/libgif-c639db25ad9a6c86.rlib --extern gimli=/playground/target/debug/deps/libgimli-dc79b57bd968ce98.rlib --extern glob=/playground/target/debug/deps/libglob-a53ecfead96f4380.rlib --extern h2=/playground/target/debug/deps/libh2-a063d698f49d190d.rlib --extern hmac=/playground/target/debug/deps/libhmac-909a43f697dbf30c.rlib --extern html5ever=/playground/target/debug/deps/libhtml5ever-c2f3fc973c89e459.rlib --extern http=/playground/target/debug/deps/libhttp-2f9295eb1e24e56d.rlib --extern http_body=/playground/target/debug/deps/libhttp_body-c50973cd022c8639.rlib --extern httparse=/playground/target/debug/deps/libhttparse-15bbf0e1020f2b6d.rlib --extern humantime=/playground/target/debug/deps/libhumantime-c7e021f1ab5674c5.rlib --extern hyper=/playground/target/debug/deps/libhyper-d9528a58deb6a305.rlib --extern hyper_tls=/playground/target/debug/deps/libhyper_tls-85337dfd5af63606.rlib --extern idna=/playground/target/debug/deps/libidna-285a139125cd7e37.rlib --extern image=/playground/target/debug/deps/libimage-72b0b70677306351.rlib --extern indexmap=/playground/target/debug/deps/libindexmap-010cc2664109d005.rlib --extern inflate=/playground/target/debug/deps/libinflate-0aba927ddd91c511.rlib --extern iovec=/playground/target/debug/deps/libiovec-241098c85557195e.rlib --extern itertools=/playground/target/debug/deps/libitertools-dc9fb052df634210.rlib --extern itoa=/playground/target/debug/deps/libitoa-d6c3915b8ff556de.rlib --extern jpeg_decoder=/playground/target/debug/deps/libjpeg_decoder-7453b66d90c9e89f.rlib --extern kernel32=/playground/target/debug/deps/libkernel32-eeacdd86936b9cf4.rlib --extern lazy_static=/playground/target/debug/deps/liblazy_static-f2235a54445ea06a.rlib --extern libc=/playground/target/debug/deps/liblibc-5cac198bcc9f20ec.rlib --extern libm=/playground/target/debug/deps/liblibm-9469f5d1c8388124.rlib --extern libsqlite3_sys=/playground/target/debug/deps/liblibsqlite3_sys-2e5854187a45902c.rlib --extern linked_hash_map=/playground/target/debug/deps/liblinked_hash_map-cb78c3d8c12ff973.rlib --extern lock_api=/playground/target/debug/deps/liblock_api-122fd723e8434c8a.rlib --extern log=/playground/target/debug/deps/liblog-6e1793aaf782f825.rlib --extern log_mdc=/playground/target/debug/deps/liblog_mdc-e05a0aadc83a94d1.rlib --extern log4rs=/playground/target/debug/deps/liblog4rs-56be8ad5d848654c.rlib --extern lru_cache=/playground/target/debug/deps/liblru_cache-848f1ae1607c2b13.rlib --extern lzw=/playground/target/debug/deps/liblzw-dc331b486ef90a61.rlib --extern mac=/playground/target/debug/deps/libmac-1cfc481fb42aa364.rlib --extern markup5ever=/playground/target/debug/deps/libmarkup5ever-c220604f2c315996.rlib --extern matches=/playground/target/debug/deps/libmatches-cede3278c78141a8.rlib --extern matrixmultiply=/playground/target/debug/deps/libmatrixmultiply-dd9eb342a32a4e86.rlib --extern maybe_uninit=/playground/target/debug/deps/libmaybe_uninit-fb4fb023bb3832e3.rlib --extern md5=/playground/target/debug/deps/libmd5-2ab867250fd74203.rlib --extern memchr=/playground/target/debug/deps/libmemchr-dc49999d9cee4a33.rlib --extern memmap=/playground/target/debug/deps/libmemmap-65214209d99e1092.rlib --extern memoffset=/playground/target/debug/deps/libmemoffset-da57bac864322454.rlib --extern mime=/playground/target/debug/deps/libmime-a1440bf6f9bf3332.rlib --extern mime_guess=/playground/target/debug/deps/libmime_guess-bb047b2726215216.rlib --extern miniz_oxide=/playground/target/debug/deps/libminiz_oxide-7cd089b127af1056.rlib --extern mio_0_6_22=/playground/target/debug/deps/libmio-5578bc78c9d8ef53.rlib --extern mio=/playground/target/debug/deps/libmio-59d4afa931095052.rlib --extern mio_uds=/playground/target/debug/deps/libmio_uds-016eb2a2f7179682.rlib --extern nalgebra=/playground/target/debug/deps/libnalgebra-eaa5e260797a596e.rlib --extern native_tls=/playground/target/debug/deps/libnative_tls-e807663daa3bdc28.rlib --extern ndarray=/playground/target/debug/deps/libndarray-89c7518d2a95aa38.rlib --extern net2=/playground/target/debug/deps/libnet2-aba3cd2492755c0e.rlib --extern debug_unreachable=/playground/target/debug/deps/libdebug_unreachable-98d04bec30b12c51.rlib --extern nodrop=/playground/target/debug/deps/libnodrop-b0431af20c502f15.rlib --extern num=/playground/target/debug/deps/libnum-3dc1ae76cf004c0c.rlib --extern num_bigint=/playground/target/debug/deps/libnum_bigint-96e0725f673cf2a7.rlib --extern num_complex=/playground/target/debug/deps/libnum_complex-264fb9dd8be0ccb6.rlib --extern num_integer=/playground/target/debug/deps/libnum_integer-b1634eacb796e683.rlib --extern num_iter=/playground/target/debug/deps/libnum_iter-0fa792689fc80120.rlib --extern num_rational=/playground/target/debug/deps/libnum_rational-3a487d61dd2477c1.rlib --extern num_traits=/playground/target/debug/deps/libnum_traits-75aa92fd11400428.rlib --extern num_cpus=/playground/target/debug/deps/libnum_cpus-9fd758579c50eff2.rlib --extern object=/playground/target/debug/deps/libobject-b5200afa5521ea90.rlib --extern once_cell=/playground/target/debug/deps/libonce_cell-e4bd2236e3498696.rlib --extern opaque_debug=/playground/target/debug/deps/libopaque_debug-4249c1eb8e67fd4f.rlib --extern openssl=/playground/target/debug/deps/libopenssl-429c9f3f3fce04dc.rlib --extern openssl_probe=/playground/target/debug/deps/libopenssl_probe-93fe86b79752ac72.rlib --extern openssl_sys=/playground/target/debug/deps/libopenssl_sys-200260475737a621.rlib --extern ordered_float=/playground/target/debug/deps/libordered_float-d9e3f9f6a0301100.rlib --extern parking_lot=/playground/target/debug/deps/libparking_lot-9998b4ed048c30e1.rlib --extern parking_lot_core=/playground/target/debug/deps/libparking_lot_core-bc3dfec156d08f58.rlib --extern paste=/playground/target/debug/deps/libpaste-ef18ee563ce560b2.rlib --extern paste_impl=/playground/target/debug/deps/libpaste_impl-63c1de0c586109db.so --extern percent_encoding=/playground/target/debug/deps/libpercent_encoding-43793e425984c92e.rlib --extern petgraph=/playground/target/debug/deps/libpetgraph-ec5c923c2c1fee2b.rlib --extern phf_0_7_24=/playground/target/debug/deps/libphf-b3c35b785e600e3a.rlib --extern phf=/playground/target/debug/deps/libphf-c419aabe99800a82.rlib --extern phf_codegen=/playground/target/debug/deps/libphf_codegen-e5a001f26896b9e0.rlib --extern phf_generator=/playground/target/debug/deps/libphf_generator-2d73d3a71da228c3.rlib --extern phf_shared_0_7_24=/playground/target/debug/deps/libphf_shared-5c32080ddba93409.rlib --extern phf_shared=/playground/target/debug/deps/libphf_shared-aa4424ac6a08f0d4.rlib --extern pin_project=/playground/target/debug/deps/libpin_project-2650496cbb83f7e9.rlib --extern pin_project_internal=/playground/target/debug/deps/libpin_project_internal-c775366eeaf41aeb.so --extern pin_project_lite=/playground/target/debug/deps/libpin_project_lite-65c112462c47064a.rlib --extern pin_utils=/playground/target/debug/deps/libpin_utils-6dcf2b9c555692e6.rlib --extern pkg_config=/playground/target/debug/deps/libpkg_config-0a3b94c61998b947.rlib --extern png=/playground/target/debug/deps/libpng-4485a6e5a3fb4f8a.rlib --extern postgres=/playground/target/debug/deps/libpostgres-679529f3f1884c35.rlib --extern postgres_protocol=/playground/target/debug/deps/libpostgres_protocol-ad069d001c21e63b.rlib --extern postgres_types=/playground/target/debug/deps/libpostgres_types-15177d25e18e2630.rlib --extern ppv_lite86=/playground/target/debug/deps/libppv_lite86-f6355626a8252b65.rlib --extern precomputed_hash=/playground/target/debug/deps/libprecomputed_hash-d1f2a8a82c31f26f.rlib --extern proc_macro_hack=/playground/target/debug/deps/libproc_macro_hack-cf719c8ee2efaef1.so --extern proc_macro_nested=/playground/target/debug/deps/libproc_macro_nested-b4d7489b0b22d489.rlib --extern proc_macro2_0_4_30=/playground/target/debug/deps/libproc_macro2-0b2dd4d7ac877095.rlib --extern proc_macro2=/playground/target/debug/deps/libproc_macro2-d9089e0ba5ddb97b.rlib --extern quick_error=/playground/target/debug/deps/libquick_error-acba400db14759c6.rlib --extern quote_0_6_13=/playground/target/debug/deps/libquote-ca8012ecf0e923b6.rlib --extern quote=/playground/target/debug/deps/libquote-c164b3f5fcc3f72e.rlib --extern rand_0_6_5=/playground/target/debug/deps/librand-5e44187cafe15b81.rlib --extern rand=/playground/target/debug/deps/librand-92b1323741d7277d.rlib --extern rand_chacha_0_1_1=/playground/target/debug/deps/librand_chacha-eadb4ba197366503.rlib --extern rand_chacha=/playground/target/debug/deps/librand_chacha-3d550d309726c29f.rlib --extern rand_core_0_3_1=/playground/target/debug/deps/librand_core-94d9f99aad81ed55.rlib --extern rand_core_0_4_2=/playground/target/debug/deps/librand_core-ae1e4a30baa10a0a.rlib --extern rand_core=/playground/target/debug/deps/librand_core-61ace61fb09fcf1b.rlib --extern rand_distr=/playground/target/debug/deps/librand_distr-8ca949319abe7472.rlib --extern rand_hc_0_1_0=/playground/target/debug/deps/librand_hc-7fba6dec81a79bb6.rlib --extern rand_hc=/playground/target/debug/deps/librand_hc-89742f0d3bd15095.rlib --extern rand_isaac=/playground/target/debug/deps/librand_isaac-264adaa8d11a5925.rlib --extern rand_jitter=/playground/target/debug/deps/librand_jitter-aed497bee571ea5d.rlib --extern rand_os=/playground/target/debug/deps/librand_os-ce0fc3d605c12cf6.rlib --extern rand_pcg_0_1_2=/playground/target/debug/deps/librand_pcg-05d8edf6fe58bdf5.rlib --extern rand_pcg=/playground/target/debug/deps/librand_pcg-b6393371d1a8bfc0.rlib --extern rand_xorshift_0_1_1=/playground/target/debug/deps/librand_xorshift-7ae60e1bfb9c5a59.rlib --extern rand_xorshift=/playground/target/debug/deps/librand_xorshift-3c861edd1da12a4d.rlib --extern rawpointer=/playground/target/debug/deps/librawpointer-b0a645781a9cf241.rlib --extern rayon=/playground/target/debug/deps/librayon-aa697652c0eab474.rlib --extern rayon_core=/playground/target/debug/deps/librayon_core-cfdf70357b44f6ed.rlib --extern regex=/playground/target/debug/deps/libregex-8b65daf338d00fd2.rlib --extern regex_automata=/playground/target/debug/deps/libregex_automata-d440bae39dca5def.rlib --extern regex_syntax=/playground/target/debug/deps/libregex_syntax-b5a1cec9fd82660e.rlib --extern remove_dir_all=/playground/target/debug/deps/libremove_dir_all-707ccc6e5be35877.rlib --extern reqwest=/playground/target/debug/deps/libreqwest-bba6cc0ea758b1b4.rlib --extern ring=/playground/target/debug/deps/libring-ed2842397ec7d5f2.rlib --extern rusqlite=/playground/target/debug/deps/librusqlite-c8ee3f4da67d194d.rlib --extern rustc_demangle=/playground/target/debug/deps/librustc_demangle-25bb002b9fae6b5e.rlib --extern rustc_serialize=/playground/target/debug/deps/librustc_serialize-aa4576771ace52d1.rlib --extern rustc_version=/playground/target/debug/deps/librustc_version-3facd6ba2ce3f306.rlib --extern ryu=/playground/target/debug/deps/libryu-4440a659a3a056ad.rlib --extern same_file=/playground/target/debug/deps/libsame_file-3f63bba2deb30f5e.rlib --extern scoped_threadpool=/playground/target/debug/deps/libscoped_threadpool-a68a99eb8fb9e4e1.rlib --extern scopeguard=/playground/target/debug/deps/libscopeguard-e8d3c59daf897e42.rlib --extern select=/playground/target/debug/deps/libselect-cf88804b9b42bbfd.rlib --extern semver_0_9_0=/playground/target/debug/deps/libsemver-e14a713af33bfce7.rlib --extern semver=/playground/target/debug/deps/libsemver-0bf4479453db640a.rlib --extern semver_parser_0_7_0=/playground/target/debug/deps/libsemver_parser-e60c724b40ac31cc.rlib --extern semver_parser=/playground/target/debug/deps/libsemver_parser-ba67f8699e8b23e7.rlib --extern serde=/playground/target/debug/deps/libserde-b117599edc5261de.rlib --extern serde_value=/playground/target/debug/deps/libserde_value-07520a5041a8ca10.rlib --extern serde_derive=/playground/target/debug/deps/libserde_derive-47c8970e6cf52ff2.so --extern serde_json=/playground/target/debug/deps/libserde_json-70a04effaff3368a.rlib --extern serde_urlencoded=/playground/target/debug/deps/libserde_urlencoded-b0e405090e5ae7f5.rlib --extern serde_yaml=/playground/target/debug/deps/libserde_yaml-40a4b067a2a863a3.rlib --extern sha2=/playground/target/debug/deps/libsha2-d6256cbfa887a1ff.rlib --extern simba=/playground/target/debug/deps/libsimba-9decd2ef376a44b6.rlib --extern siphasher_0_2_3=/playground/target/debug/deps/libsiphasher-ffaae43099d02c3c.rlib --extern siphasher=/playground/target/debug/deps/libsiphasher-097245d2e2b261ae.rlib --extern slab=/playground/target/debug/deps/libslab-6e12296f6668b971.rlib --extern smallvec=/playground/target/debug/deps/libsmallvec-c69ca9825159c11d.rlib --extern spin=/playground/target/debug/deps/libspin-38e7f15ec356120c.rlib --extern standback=/playground/target/debug/deps/libstandback-4b9a6f123a548a77.rlib --extern string_cache=/playground/target/debug/deps/libstring_cache-d0ddc75e0606f104.rlib --extern string_cache_codegen=/playground/target/debug/deps/libstring_cache_codegen-1c9bd0f4d17d5a38.rlib --extern string_cache_shared=/playground/target/debug/deps/libstring_cache_shared-794dfc2e22abdcfd.rlib --extern stringprep=/playground/target/debug/deps/libstringprep-00f0fde52719c627.rlib --extern strsim_0_8_0=/playground/target/debug/deps/libstrsim-f609ca05f6e5fdaa.rlib --extern strsim=/playground/target/debug/deps/libstrsim-2c14d9bffc940fa0.rlib --extern subtle=/playground/target/debug/deps/libsubtle-c1a9c3179b61d77e.rlib --extern syn_0_15_44=/playground/target/debug/deps/libsyn-7d04a589f1e7f2f7.rlib --extern syn=/playground/target/debug/deps/libsyn-96c0d7d05eaf6702.rlib --extern synstructure=/playground/target/debug/deps/libsynstructure-f656bb43c8b46509.rlib --extern tar=/playground/target/debug/deps/libtar-9dfa08902c5a2f25.rlib --extern tempfile=/playground/target/debug/deps/libtempfile-141882a12e8f176d.rlib --extern tendril=/playground/target/debug/deps/libtendril-ca270579779b4550.rlib --extern termcolor=/playground/target/debug/deps/libtermcolor-ba7fb2916ae8392f.rlib --extern textwrap=/playground/target/debug/deps/libtextwrap-144e57334e6b8e2b.rlib --extern thread_id=/playground/target/debug/deps/libthread_id-9f7336a3774abe66.rlib --extern thread_local=/playground/target/debug/deps/libthread_local-d11021b0f08cc104.rlib --extern threadpool=/playground/target/debug/deps/libthreadpool-c0abae296d6c75c9.rlib --extern tiff=/playground/target/debug/deps/libtiff-f05441bf1b3c2852.rlib --extern time_0_1_43=/playground/target/debug/deps/libtime-4069d58f0ced58be.rlib --extern time=/playground/target/debug/deps/libtime-04b7798ac7183d6a.rlib --extern time_macros=/playground/target/debug/deps/libtime_macros-34d18d68e0aa8844.rlib --extern time_macros_impl=/playground/target/debug/deps/libtime_macros_impl-fe05ff076d0aea23.so --extern tokio=/playground/target/debug/deps/libtokio-ab7b4747fee53a3b.rlib --extern tokio_postgres=/playground/target/debug/deps/libtokio_postgres-5bd3fe932bba95dd.rlib --extern tokio_tls=/playground/target/debug/deps/libtokio_tls-f77f9570279c761c.rlib --extern tokio_util=/playground/target/debug/deps/libtokio_util-d81bb45d3f7a2927.rlib --extern toml=/playground/target/debug/deps/libtoml-b9d07684880f686e.rlib --extern tower_service=/playground/target/debug/deps/libtower_service-a273280fe8ab0926.rlib --extern traitobject=/playground/target/debug/deps/libtraitobject-3a909cdecc14612f.rlib --extern try_lock=/playground/target/debug/deps/libtry_lock-4b925af73963cf90.rlib --extern typemap=/playground/target/debug/deps/libtypemap-735dbbfe27e62a32.rlib --extern typenum=/playground/target/debug/deps/libtypenum-91535be011b36960.rlib --extern unicase=/playground/target/debug/deps/libunicase-ba571056430635b3.rlib --extern unicode_bidi=/playground/target/debug/deps/libunicode_bidi-14bd8e062e0455ab.rlib --extern unicode_normalization=/playground/target/debug/deps/libunicode_normalization-1b7a29ea32cbaeaa.rlib --extern unicode_segmentation=/playground/target/debug/deps/libunicode_segmentation-3a409dac160fecf4.rlib --extern unicode_width=/playground/target/debug/deps/libunicode_width-3ccbe6eab2d3e9fa.rlib --extern unicode_xid_0_1_0=/playground/target/debug/deps/libunicode_xid-29d697d420ebfc90.rlib --extern unicode_xid=/playground/target/debug/deps/libunicode_xid-ca50202de28f86c8.rlib --extern unsafe_any=/playground/target/debug/deps/libunsafe_any-fba7065ede067a44.rlib --extern untrusted=/playground/target/debug/deps/libuntrusted-6609d5cb4022c7c2.rlib --extern url=/playground/target/debug/deps/liburl-a9ad64f9c48ddc88.rlib --extern utf8=/playground/target/debug/deps/libutf8-3a1c05d58c8ae705.rlib --extern utf8_ranges=/playground/target/debug/deps/libutf8_ranges-ad8a033305b31f97.rlib --extern uuid=/playground/target/debug/deps/libuuid-e1f5fce1c375e681.rlib --extern vec_map=/playground/target/debug/deps/libvec_map-ec2888cc58cfc5e2.rlib --extern version_check=/playground/target/debug/deps/libversion_check-8343aabdb9607129.rlib --extern void=/playground/target/debug/deps/libvoid-56f8e0419497cd8e.rlib --extern walkdir=/playground/target/debug/deps/libwalkdir-5d18c0e34a4809d3.rlib --extern want=/playground/target/debug/deps/libwant-98175a25e920be4a.rlib --extern winapi_0_2_8=/playground/target/debug/deps/libwinapi-e1b7ecbd8b050019.rlib --extern winapi=/playground/target/debug/deps/libwinapi-21794b8c4d33cd9d.rlib --extern build=/playground/target/debug/deps/libbuild-077ba1b056c44750.rlib --extern xattr=/playground/target/debug/deps/libxattr-9bfd933e1fd0eadf.rlib --extern yaml_rust=/playground/target/debug/deps/libyaml_rust-b1d26a790f6b3681.rlib -L native=/playground/target/debug/build/backtrace-sys-d322078bf90a2cdc/out -L native=/playground/target/debug/build/libsqlite3-sys-285e15ac2a135198/out -L native=/playground/target/debug/build/ring-48ee295c30b0932e/out` (signal: 11, SIGSEGV: invalid memory reference)

@rustbot modify labels: +A-inline-assembly and +A-LLVM

Mark-Simulacrum commented 4 years ago

I suspect this is probably due to the LLVM upgrade, but would be good to confirm. Regardless I believe we're in "not supporting llvm_asm" mode right now, right @Amanieu?

Amanieu commented 4 years ago

This has never worked since foo is a ZST function type. You need to cast foo to a usize before passing it to the asm.

Amanieu commented 4 years ago

Oh wait I see you're casting it to a function pointer first, so that's not the issue.

Yes this is probably due to the LLVM upgrade. You need to use the P or c modifier (${0:c}) to prevent LLVM from adding offset in front of the function name. I believe this change came from LLVM 10.

However as @Mark-Simulacrum said, we're not really planning on supporting llvm_asm! any more, you should migrate to the new asm!.

Amanieu commented 4 years ago

Closing as WONTFIX.