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

Switch to GCC 13 #1273

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Switch to GCC 13 #1273

wants to merge 1 commit into from

Conversation

NickeZ
Copy link
Collaborator

@NickeZ NickeZ commented Aug 15, 2024

To reduce the size of the binary a bit we add -mno-unaligned-access because that made struct initialization generate quite a lot more code.

In the new toolchain assert is defined as a macro. That interferes with the ASF function called assert so we undefined it right before that function is defined.

We also have to provide the search path to the linker to our dummy files libssp and libssp_nonshared. The actual implementation of the stack protector functions are in common_main.c.

@NickeZ NickeZ requested a review from benma August 15, 2024 08:18
Copy link
Collaborator

@benma benma left a comment

Choose a reason for hiding this comment

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

utACK

CMakeLists.txt Outdated
@@ -224,7 +224,7 @@ configure_file(src/bootloader/bootloader_version.h.in src/bootloader/bootloader_
string(APPEND CMAKE_C_FLAGS " -std=c11 -pipe")
if(CMAKE_CROSSCOMPILING)
set(CMAKE_C_FLAGS "\
${CMAKE_C_FLAGS} -mcpu=cortex-m4 -mthumb -mlong-calls \
${CMAKE_C_FLAGS} -mcpu=cortex-m4 -mthumb -mlong-calls -mno-unaligned-access \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this safe, or does this introduce risk? If it's safer to not use this flag we could postpone using this trick until we need to save bytes more urgently.

Copy link
Collaborator Author

@NickeZ NickeZ Aug 19, 2024

Choose a reason for hiding this comment

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

Yeah, not sure what the impact is. I think unaligned accesses can be problematic on some platforms, so I would assume that no unaligned access would be safer than allowing it.

@NickeZ
Copy link
Collaborator Author

NickeZ commented Aug 19, 2024

I will wait this this PR until I have some other CI related things merged and I've tested the device.

@NickeZ NickeZ marked this pull request as draft August 27, 2024 08:12
@NickeZ
Copy link
Collaborator Author

NickeZ commented Aug 27, 2024

Firmware doesn't work. It doesn't pop up the "unlock" screen.

@NickeZ NickeZ self-assigned this Aug 27, 2024
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