rust-lang / rustc_codegen_gcc

libgccjit AOT codegen for rustc
Apache License 2.0
906 stars 60 forks source link

Do not emit .eh_frame section if using -Cpanic=abort #374

Closed antoyo closed 10 months ago

bjorn3 commented 10 months ago

.eh_frame is necessary once exceptions reaching into panic=abort rust code starts to abort the program rather than being UB.

antoyo commented 10 months ago

@bjorn3: This is necessary for Rust for Linux. How do you suggest we handle this?

bjorn3 commented 10 months ago

It may be that this change is fine and once unwinding into panic=abort rust code will abort the presence of the landingpad will cause .eh_frame to be emitted by both cg_llvm and cg_gcc. When that happens whatever solution is chosen for cg_llvm may work for cg_gcc too.

antoyo commented 10 months ago

@bjorn3: Do you think this should instead be set/unset depending on the value of -Cforce-unwind-tables?