-
Notifications
You must be signed in to change notification settings - Fork 506
Build libpico in CI #2596
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
Build libpico in CI #2596
Conversation
.github/workflows/build-libpico.yml
Outdated
| - name: Install dependencies | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install cmake make build-essential wget gcc-arm-none-eabi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little worried that the gcc-arm-none-eabi and this core's GCC (12 or 14) are compatible because of different Newlib/libc configuration options. I'm particularly thinking about the locking/multithread options. Things may build, but they may not work properly. Other bits of Newlib probably won't come into play (i.e. printf nano/FP and DP implementations, etc.) since they'd be linked only in the final stage using the core toolchain.
If we're manually installing the R5 from the toolchain repo, then why not pull in the 2.0.3 version (last GCC12.4 build) from https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.3.0/x86_64-linux-gnu.arm-none-eabi-dfd82b2.240919.tar.gz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I think I confirmed this ain't gonna work since GCC12.4's SDK can't be used with this core. I've got a patch in newlib and in the core to align the locks for FILEs.
There's no way the generic version has allocated the proper space (8 bytes, not 4) or is using the proper lock calls (nor did the GCC12).
You could wget https://patch-diff.githubusercontent.com/raw/raspberrypi/pico-sdk/pull/2000.patch and apply it, and then just use get.py to install the normal toolchain and no hard-coding needed. Once we move to 2.0.1 SDK, this patch can be dropped...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that's a good idea! With get.py, the toolchain should always be right. I can store the .patch file locally and git apply it before compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! Latest commit now builds with the toolchains from get.py and downloads and applies the 2000.patch file dynamically.
Sadly the commits must be squashed, the merges messed up the history.. Never mind, I rebased it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
For logs and artefacts see https://github.com/maxgerhardt/arduino-pico/actions/workflows/build-libpico.yml
Motivation: Build the
libpico*.afiles in CI, so that:CYW43_PIO_CLOCK_DIV_DYNAMICper Wifi on Pico W board doesn't work when the system frequency is too high, the program remains in an infinite loop #2590)Open points of discussion:
ubuntu-latest, which can compile the SDK files normallyhttps://github.com/earlephilhower/pico-quick-toolchain/releases/download/4.0.1/x86_64-linux-gnu.riscv32-unknown-elf-8ec9d6f.240929.tar.gzbuild-rp2040/libpico-rp2040.ain the ZIP filelib/rp2040/libpico.a, no CPU prefixArtefact output:


libpico.zipJust for reference, non working with ARM toolchain from pico-quick-toolchain