-
Notifications
You must be signed in to change notification settings - Fork 814
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
[toolchain] Enable LLD, LTO and minsize by default #26354
base: master
Are you sure you want to change the base?
Conversation
Fixes #26352 |
58a1d2c
to
c72b81b
Compare
Thanks for figuring this out, it will be very helpful. For posterity, those shift functions were removed because of concerns about the type punning in the |
c192769
to
926c1e0
Compare
I am not an expert on the C specification but my understanding is that type punning in C99 is a priori not undefined behaviour, although the standard is quite weak on that point. However, unless one knows what the actual representation of integers are, this is still UB. One could say that this is fixed by C23 that set the representation to two's complement but we are not compiling for C23. That being said, as you noted, we know that we are compiling for the Ibex so there is no ambiguity here about the representation. |
392d4cb
to
80c2e16
Compare
7714a04
to
47b6625
Compare
a951c11
to
11a4315
Compare
799a213
to
1e21e71
Compare
Now that many targets depend on the DT, LTO has become a lot more important. Since we already compile critical piece of software with it (test_rom, mask_rom), it makes sense to enable it for everything. Signed-off-by: Amaury Pouly <[email protected]>
Forcing the linker to keep all sections causes linking problem with the math polyfill and is also just bad practice. We still mark the entry point section as KEEP. Signed-off-by: Amaury Pouly <[email protected]>
The way the code is written can cause the compiler, with certain optimization settings, to call `__lshrdi3` instead of implementing the shifts with 32-bit operations. This commit rewrites the code so that all shifts on 64-bit values are by one so that any reasonable compiler will refrain from calling `__lshrdi3`. Signed-off-by: Amaury Pouly <[email protected]>
This partiall yreverts commit eb69eed, restoring the implementation of the shifts plus a tiny tweak to avoid a compiler warning. Signed-off-by: Amaury Pouly <[email protected]>
Those functions are called from assembly and will be discarded otherwise. Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Luís Marques <[email protected]>
Signed-off-by: Luís Marques <[email protected]>
Signed-off-by: Luís Marques <[email protected]>
Those can be optimized y the compiler in nontrivial ways in tests where they are only read but not written to for example. Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
27fb7f7
to
f1b0f86
Compare
Now that many targets depend on the DT, LTO has become a lot more important. Since we already compile critical piece of software with it (test_rom, mask_rom), it makes sense to enable it for everything.
NOTE: I don't know if this going to break stuff, our guardian CI will surely let us know.