From a0eb2adec0d43a7ad161550d88894fdd2e6db824 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:45:49 +0000 Subject: [PATCH] [WIP] Test non-uniquely named subsections on Windows --- Cargo.lock | 176 ++++++++++++++++++---------------------------- Cargo.toml | 12 ++-- src/driver/aot.rs | 7 +- 3 files changed, 76 insertions(+), 119 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d81e72149..b215f1a74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,22 +3,16 @@ version = 4 [[package]] -name = "ahash" -version = "0.8.11" +name = "allocator-api2" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "arbitrary" @@ -37,6 +31,9 @@ name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +dependencies = [ + "allocator-api2", +] [[package]] name = "cfg-if" @@ -46,24 +43,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cranelift-bforest" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba4f80548f22dc9c43911907b5e322c5555544ee85f785115701e6a28c9abe1" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-bitset" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005884e3649c3e5ff2dc79e8a94b138f11569cc08a91244a292714d2a86e9156" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" [[package]] name = "cranelift-codegen" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4036255ec33ce9a37495dfbcfc4e1118fd34e693eff9a1e106336b7cd16a9b" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "bumpalo", "cranelift-bforest", @@ -74,7 +68,7 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli", - "hashbrown", + "hashbrown 0.14.5", "log", "regalloc2", "rustc-hash", @@ -85,42 +79,37 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7ca74f4b68319da11d39e894437cb6e20ec7c2e11fbbda823c3bf207beedff7" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897e54f433a0269c4187871aa06d452214d5515d228d5bdc22219585e9eef895" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" [[package]] name = "cranelift-control" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29cb4018f5bf59fb53f515fa9d80e6f8c5ce19f198dc538984ebd23ecf8965ec" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "arbitrary", ] [[package]] name = "cranelift-entity" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305399fd781a2953ac78c1396f02ff53144f39c33eb7fc7789cf4e8936d13a96" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "cranelift-bitset", ] [[package]] name = "cranelift-frontend" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9230b460a128d53653456137751d27baf567947a3ab8c0c4d6e31fd08036d81e" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "cranelift-codegen", "log", @@ -130,15 +119,13 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b961e24ae3ec9813a24a15ae64bbd2a42e4de4d79a7f3225a412e3b94e78d1c8" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" [[package]] name = "cranelift-jit" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62699329d4ced20fe281fbaef45e11b473b7ab310491b4bdebcd8b818a8ef7fe" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "anyhow", "cranelift-codegen", @@ -156,9 +143,8 @@ dependencies = [ [[package]] name = "cranelift-module" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f20b0b51ba962dac30fc7e812b86e4390d908acd4f59bcc8ac7610a8f3e0977" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "anyhow", "cranelift-codegen", @@ -167,9 +153,8 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5bd76df6c9151188dfa428c863b33da5b34561b67f43c0cf3f24a794f9fa1f" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "cranelift-codegen", "libc", @@ -178,9 +163,8 @@ dependencies = [ [[package]] name = "cranelift-object" -version = "0.114.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee231640a7ecceedd0f1f2782d9288db6a6908cc70675ed9427e3bf0ea6daacd" +version = "0.116.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "anyhow", "cranelift-codegen", @@ -212,6 +196,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "gimli" version = "0.31.1" @@ -228,8 +218,14 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ - "ahash", + "foldhash", ] [[package]] @@ -239,7 +235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -281,27 +277,21 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "object" -version = "0.36.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "crc32fast", - "hashbrown", + "hashbrown 0.15.2", "indexmap", "memchr", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -317,14 +307,15 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12908dbeb234370af84d0579b9f68258a0f67e201412dd9a2814e6f45b2fc0f0" +checksum = "145c1c267e14f20fb0f88aa76a1c5ffec42d592c1d28b3cd9148ae35916158d3" dependencies = [ - "hashbrown", + "allocator-api2", + "bumpalo", + "hashbrown 0.15.2", "log", "rustc-hash", - "slice-group-by", "smallvec", ] @@ -366,30 +357,24 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "smallvec" version = "1.13.2" @@ -404,9 +389,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "syn" -version = "2.0.70" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -425,17 +410,10 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "wasmtime-jit-icache-coherence" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b218a92866f74f35162f5d03a4e0f62cd0e1cc624285b1014275e5d4575fad" +version = "29.0.0" +source = "git+https://github.com/bjorn3/wasmtime.git?branch=subsection_improvements#cdd8300916bdc46cf0720884b050e26280a00a92" dependencies = [ "anyhow", "cfg-if", @@ -524,23 +502,3 @@ name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index b2fed3c49..86a26b0c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,12 @@ crate-type = ["dylib"] [dependencies] # These have to be in sync with each other -cranelift-codegen = { version = "0.114.0", default-features = false, features = ["std", "unwind", "all-native-arch"] } -cranelift-frontend = { version = "0.114.0" } -cranelift-module = { version = "0.114.0" } -cranelift-native = { version = "0.114.0" } -cranelift-jit = { version = "0.114.0", optional = true } -cranelift-object = { version = "0.114.0" } +cranelift-codegen = { git = "https://github.com/bjorn3/wasmtime.git", branch = "subsection_improvements", version = "0.116.0", default-features = false, features = ["std", "unwind", "all-native-arch"] } +cranelift-frontend = { git = "https://github.com/bjorn3/wasmtime.git", branch = "subsection_improvements", version = "0.116.0" } +cranelift-module = { git = "https://github.com/bjorn3/wasmtime.git", branch = "subsection_improvements", version = "0.116.0" } +cranelift-native = { git = "https://github.com/bjorn3/wasmtime.git", branch = "subsection_improvements", version = "0.116.0" } +cranelift-jit = { git = "https://github.com/bjorn3/wasmtime.git", branch = "subsection_improvements", version = "0.116.0", optional = true } +cranelift-object = { git = "https://github.com/bjorn3/wasmtime.git", branch = "subsection_improvements", version = "0.116.0" } target-lexicon = "0.12.0" gimli = { version = "0.31", default-features = false, features = ["write"] } object = { version = "0.36", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] } diff --git a/src/driver/aot.rs b/src/driver/aot.rs index 5bbcfc2cd..677078fe0 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -333,10 +333,9 @@ fn make_module(sess: &Session, name: String) -> UnwindModule { let mut builder = ObjectBuilder::new(isa, name + ".o", cranelift_module::default_libcall_names()).unwrap(); - // Unlike cg_llvm, cg_clif defaults to disabling -Zfunction-sections. For cg_llvm binary size - // is important, while cg_clif cares more about compilation times. Enabling -Zfunction-sections - // can easily double the amount of time necessary to perform linking. - builder.per_function_section(sess.opts.unstable_opts.function_sections.unwrap_or(false)); + builder + .per_function_section(sess.opts.unstable_opts.function_sections.unwrap_or(true)) + .per_data_object_section(sess.opts.unstable_opts.function_sections.unwrap_or(true)); UnwindModule::new(ObjectModule::new(builder), true) }