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

Nickez/support arm64 in docker #1284

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

NickeZ
Copy link
Collaborator

@NickeZ NickeZ commented Aug 20, 2024

No description provided.

@NickeZ NickeZ requested a review from benma August 20, 2024 11:32
@NickeZ NickeZ force-pushed the nickez/support-arm64-in-docker branch from a15e95a to 9247f24 Compare August 20, 2024 11:36
Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@NickeZ NickeZ force-pushed the nickez/support-arm64-in-docker branch from 9247f24 to 4357f21 Compare August 20, 2024 11:50
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 force-pushed the nickez/support-arm64-in-docker branch from a9e8ad2 to 2c57ea6 Compare August 22, 2024 11:17
linux/arm64 is the default on newer macbooks with the apple cpu.

The toolchain GCC 8 2018 q4 is not available for linux/arm64. So we go
with the latest available, which is GCC 13.3.
@NickeZ NickeZ force-pushed the nickez/support-arm64-in-docker branch from 2c57ea6 to a662e21 Compare August 22, 2024 11:20
@NickeZ
Copy link
Collaborator Author

NickeZ commented Aug 22, 2024

Rebased on master and made a change to releases/build.sh to enforce amd64.

@NickeZ NickeZ requested a review from benma August 22, 2024 11:22
Comment on lines 38 to 41
# The firmware is only reproducible with the same host compiler. For now we force linux/amd64.
# The file .containerversion does not exist in older versions of the project.
containerversion=$(2>/dev/null cat .containerversion || echo "latest")
docker build --pull --platform linux/amd64 --force-rm --no-cache -t bitbox02-firmware:${containerversion} .
Copy link
Collaborator

Choose a reason for hiding this comment

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

you don't need to tag anything here, it serves no purpose. the image is built here from scratch and used in the next line, not pulled, so the local image name/tag is irrelevant, and using .containerversion here is distracting/confusing, as it is unrelated to our shiftcrypto/firmware_v2 tagging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no problem, fixed!

Currently it is not posisble to reproducibly build the firmware due to
the toolchains we have, therefore we enforce amd64.
@NickeZ NickeZ force-pushed the nickez/support-arm64-in-docker branch from a662e21 to 7ba38b1 Compare August 22, 2024 12:09
@NickeZ NickeZ requested a review from benma August 22, 2024 12:15
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

@NickeZ NickeZ merged commit 73aa02f into BitBoxSwiss:master Aug 22, 2024
5 checks passed
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