Add PreservedSymbols from LLVM to LTO.

When building with LTO, builtin functions that are defined but whose calls have not been inserted yet, get internalized.
We need to prevent these symbols from being internalized at LTO time.

Refer to https://reviews.llvm.org/D49434.
This commit is contained in:
DianQK 2023-08-19 16:10:49 +08:00
parent 6762d64063
commit a6f7596fb9
No known key found for this signature in database
GPG key ID: 46BDB1AC96C48912
4 changed files with 105 additions and 3 deletions

View file

@ -8,7 +8,7 @@ fn my_panic(_info: &core::panic::PanicInfo) -> ! {
#[no_mangle]
pub fn multer(a: i128, b: i128) -> i128 {
// Trigger usage of the __multi3 compiler intrinsic which then leads to an imported
// panic function in case of a bug. We verify that no imports exist in our verifier.
// Trigger usage of the __multi3 compiler intrinsic which then leads to an imported function
// such as panic or __multi3 in case of a bug. We verify that no imports exist in our verifier.
a * b
}