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

update to SDK v0.29.0 #2730

Merged
merged 6 commits into from
Jan 12, 2023
Merged

update to SDK v0.29.0 #2730

merged 6 commits into from
Jan 12, 2023

Conversation

bcressey
Copy link
Contributor

Issue number:
N/A

Description of changes:
Update SDK to v0.29.0. Includes changes from bottlerocket-os/bottlerocket-sdk#87.

The major change in this update is to GCC 11, which initially miscompiled dbus-broker when built with -fstrict-aliasing (the default at the -O2 optimization level). I added a patch to address that, and also elevated aliasing warnings into build errors to try to catch similar errors in the future. This didn't actually flag the dbus-broker problem, but still feels like a useful change.

There was also an update to pahole via the dwarves package in Fedora 37 which caused problems with the older kernel 5.10 and 5.15 builds; that's been fixed by #2569.

Testing done:
Built variants for both target architectures on both host architectures. Verified aws, vmware, and metal builds were reasonably clean - no alarming warnings across all the build output in variants/target, and no strange behavior at runtime.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
The "variants" workspace is cleaned by the clean-packages target, and
should not be cleaned separately.

Additional crates exist in the "tools" workspace, and binaries other
than `buildsys` and `pubsys` are now installed, so clean those up as
well.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Our spec files do not have any entries in the %changelog section, so
disable %source_date_epoch_from_changelog to prevent warnings about a
"missing" changelog.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
The functions in the c-utf8 library have an aliasing rules violation,
and the resulting undefined behavior allows the compiler to ignore
the expected side effects under certain conditions. GCC 11 and beyond
will "optimize" this code in a way that breaks it, if possible.

Normally, the use of `-fPIC` to compile this code stops the compiler
from applying the optimization, since the function is called through
the PLT and could be interposed with some other implementation that
does not violate the rules.

However, we also pass `-fno-semantic-interposition` which tells the
compiler to optimize as though no interposition takes place, allowing
it to exploit the undefined behavior.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
GCC enables `-fstrict-aliasing` at the `-O2` optimization level, and
leverages any undefined behavior it finds. These "optimizations" are
not always desirable, and can result in emitted code that neglects
the expected side effects of function calls.

The use of `-fno-semantic-interposition` gives GCC room to apply more
such optimizations, since it can assume that any function calls will
resolve to the same function at runtime, with the same side effects,
and the same undefined behavior.

To help prevent unwanted optimizations in cases like this, treat any
alias warnings enabled by `-Wall` as errors, so that builds will fail
until the warnings are addressed somehow.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
@bcressey
Copy link
Contributor Author

Putting this out in draft until I can publish SDK images for the more recent changes in bottlerocket-os/bottlerocket-sdk#87, and do some additional testing.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
@jpculp jpculp marked this pull request as ready for review January 12, 2023 01:37
@bcressey bcressey merged commit b38073f into bottlerocket-os:develop Jan 12, 2023
@bcressey bcressey deleted the sdk-bump branch January 12, 2023 14:56
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.

None yet

3 participants