lowRISC / lowRISC/opentitan

[sw, bazel] Passing `-fno-strict-aliasing` to SW targets

Open
#16,556 7 comments 0 reactions 1 assignee Claimed by @dmcardle View on GitHub
Component:Software Earlgrey-PROD Triaged
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

This is a spin-off from the thread https://github.com/lowRISC/opentitan/pull/16180#discussion_r1030827224.

Some parts of crytpolib (at least KMAC) are implemented in a way that they violate memory aliasing. There is an ongoing work to address this soon, but at the moment these violations slip by without any warning and they might break at some point. @dmcardle suggested that we can pass `-fno-strict-aliasing` as a temporary solution until we push further fixes.

Two follow-up questions:

1) What is the proper way of passing `-fno-strict-aliasing` in our bazel build files so that we can apply the rules at package level (e.g. cryptolib/drivers) instead of each target?
2) Does it make sense to apply this to all SW targets?

Please correct me if I misunderstood the idea here @dmcardle, @jadephilipoom.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.