Skip to content

Commit

Permalink
Merge pull request #6515 from roc-lang/compiler-rt-dce
Browse files Browse the repository at this point in the history
update some compiler-rt dce protection
  • Loading branch information
folkertdev authored Feb 8, 2024
2 parents d62cc0b + 738a3b5 commit 8592acc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/compiler/gen_llvm/src/llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,17 +1071,19 @@ pub fn module_from_builtins<'ctx>(
// Anything not depended on by a `roc_builtin.` function could already by DCE'd theoretically.
// That said, this workaround is good enough and fixes compilations times.

// Also, must_keep is the functions we depend on that would normally be provide by libc.
// Also, must_keep is the functions we depend on that would normally be provide by libc or compiler-rt.
// They are magically linked to by llvm builtins, so we must specify that they can't be DCE'd.
let must_keep = [
// Windows special required when floats are used
"_fltused",
// From libc
"floorf",
"memcpy",
"memset",
// I have no idea why this function is special.
// Without it, some tests hang on M1 mac outside of nix.
// From compiler-rt
"__divti3",
"__modti3",
"__muloti4",
// fixes `Undefined Symbol in relocation`
"__udivti3",
// Roc special functions
"__roc_force_longjmp",
Expand Down

0 comments on commit 8592acc

Please sign in to comment.