Skip to content

Conversation

@maxgerhardt
Copy link
Contributor

@maxgerhardt maxgerhardt commented Nov 10, 2024

For logs and artefacts see https://github.com/maxgerhardt/arduino-pico/actions/workflows/build-libpico.yml

Motivation: Build the libpico*.a files in CI, so that:

Open points of discussion:

Artefact output: libpico.zip
grafik
grafik

Just for reference, non working with ARM toolchain from pico-quick-toolchain

            # ARM toolchain
            wget -O "$GITHUB_WORKSPACE/arm.tar.gz" "https://github.com/earlephilhower/pico-quick-toolchain/releases/download/4.0.1/x86_64-linux-gnu.arm-none-eabi-8ec9d6f.240929.tar.gz"
            tar xf "$GITHUB_WORKSPACE/arm.tar.gz"
            echo "$GITHUB_WORKSPACE/arm-none-eabi/bin" >> "$GITHUB_PATH"

- name: Install dependencies
run: |
sudo apt update
sudo apt install cmake make build-essential wget gcc-arm-none-eabi
Copy link
Owner

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

Copy link
Owner

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...

Copy link
Contributor Author

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.

Copy link
Contributor Author

@maxgerhardt maxgerhardt Nov 11, 2024

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.

Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Thx!

@earlephilhower earlephilhower merged commit db4b167 into earlephilhower:master Nov 11, 2024
26 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.

2 participants