disable LTO for libunwind #297

Closed
srenblad wants to merge 1 commits from srenblad/artiq-zynq:fix_linking_issue into master
Contributor

Disable LTO in libunwind/build.rs

LTO causes unresolved symbol errors when building firmware. Appears to be caused by Clang/LLVM v14 upgrade.

LTO flag is not set for other libraries (libc, libksupport etc).

Fixes #245.

Testing:

  • Firmware build completes successfully with nix build .#build_soc-demo-firmware.
  • Smoke tested on firmware.

Performance:

Based on the #161 PR I recreated the micro benchmark (1000 nested try-excepts) and compared with an old firmware build both using the demo.json variant.

Mean time (s), n=10:

Old firmware (35ea0ed2ca): 0.005817
This commit: 0.006256

Note the ~7.5% slowdown in performance for this benchmark. Is this acceptable @sb10q?

I have attached the benchmark code I used for reference.

### Disable LTO in libunwind/build.rs LTO causes unresolved symbol errors when building firmware. Appears to be caused by Clang/LLVM v14 upgrade. LTO flag is not set for other libraries (libc, libksupport etc). Fixes #245. ### Testing: + Firmware build completes successfully with `nix build .#build_soc-demo-firmware`. + Smoke tested on firmware. ### Performance: Based on the #161 PR I recreated the micro benchmark (1000 nested try-excepts) and compared with an old firmware build both using the `demo.json` variant. Mean time (s), n=10: Old firmware (35ea0ed2ca): 0.005817 This commit: 0.006256 Note the ~7.5% slowdown in performance for this benchmark. Is this acceptable @sb10q? I have attached the benchmark code I used for reference.
srenblad added 1 commit 2024-05-14 14:24:35 +08:00
Author
Contributor

LTO was added in #161 with the justification:

Enabling LTO improves the performance a bit, I thought this is a separate thing to do so I separated it into another commit.

LTO was added in #161 with the justification: > Enabling LTO improves the performance a bit, I thought this is a separate thing to do so I separated it into another commit.
Owner

Solution is keep LLVM to the same version used by rustc.

Solution is keep LLVM to the same version used by rustc.
sb10q closed this pull request 2024-05-20 19:37:58 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#297
No description provided.