rlo
September 25, 2024, 3:53am
1
Just found that "-Zvirtual-function-elimination" option is very buggy, always generate a binary with "segmentation fault" when running it.
Maybe it need rework/reimplementation or just remove this option completely.
Compiled 16 different projects all failed to run on macOS. Not sure whether other OSes affected also.
Perhaps
opened 11:14AM - 15 Jun 22 UTC
I-crash
A-LLVM
T-compiler
I-unsound
C-bug
requires-nightly
```
cargo new foo
cd foo
rustc -Clto -Cembed-bitcode=yes -Zvirtual-function… -elimination src/main.rs
./main # this works
> Hello, world!
rustc -Clto -Cembed-bitcode=yes -Zvirtual-function-elimination src/main.rs -Copt-level=1
./main
> [1] 2203089 segmentation fault (core dumped) ./main
```
cc https://github.com/rust-lang/rust/pull/96285
````
rustc 1.63.0-nightly (389352c4b 2022-06-15)
binary: rustc
commit-hash: 389352c4bbd56024eefd1566e06dcba04d223f92
commit-date: 2022-06-15
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5
````
Or related.
Possibly, but that's not really an URLO topic. Note also that -Z options are unstable. (Unfortunately there's no real distinction between "unstable but reasonable to use" and "unstable and busted".)
alice
September 25, 2024, 12:07pm
4
Does it still happen if you also pass -Zbuild-std
?
rlo
September 25, 2024, 1:12pm
5
Tried build with -Zbuild-std
got the same error segmentation fault
.
system
Closed
December 24, 2024, 1:12pm
6
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.