Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile.common: add -fno-strict-aliasing #208

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

badochov
Copy link
Contributor

@badochov badochov commented Oct 1, 2024

Newer versions of GCC take advantage of strict aliasing rule that we break, without explicitely warning about it.

JIRA: RTOS-927

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

Copy link

github-actions bot commented Oct 1, 2024

Unit Test Results

7 725 tests  +2   7 010 ✅ +2   37m 9s ⏱️ - 1m 42s
  445 suites +2     715 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit a758162. ± Comparison against base commit 2dc9570.

♻️ This comment has been updated with latest results.

@badochov badochov marked this pull request as ready for review October 1, 2024 11:45
@badochov badochov requested a review from Darchiv October 1, 2024 11:45
Copy link
Member

@Darchiv Darchiv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the best "solution" for now, even though this applies to the whole build. @nalajcie Do you see any drawbacks?

Makefile.common Outdated
@@ -124,6 +124,8 @@ EXPORT_LDFLAGS := $(LDFLAGS)

# add our coding-style related options
CFLAGS += -Wall -Wstrict-prototypes -fno-common
# TODO: try not to break this rule outside of kernel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add comment regarding WHY this is needed, for example:
messages are commonly type-punned - avoid GCC optimizations that might break if strict aliasing rules are not adhered to (or something shorter)

probably the same option should be set in CXXFLAGS (compilation flags for C++ programs)

@Darchiv
Copy link
Member

Darchiv commented Oct 2, 2024

Shouldn't this commit be tagged with RTOS-932 (or in addition to the existing task)?

Newer versions of GCC take advantage of strict aliasing rule that we break, without explicitely warning about it.

JIRA: RTOS-927, RTOS-932
@badochov badochov force-pushed the badochov/no-strict-aliasing branch from abeffae to a758162 Compare October 2, 2024 13:52
@badochov badochov merged commit 68a2af8 into master Oct 8, 2024
34 checks passed
@badochov badochov deleted the badochov/no-strict-aliasing branch October 8, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants