Fix cross-compile issue with newlib on Ubuntu 24.04 #3360
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a cross-compile issue of PicoRuby.
Problem
I'm trying to build PicoRuby, which uses Prism, on Ubuntu 24.04. But it causes the following build error.
Cause
The Raspberry Pi Pico SDK had the same problem. raspberrypi/pico-examples#520
This issue describes the problem. In short, it looks like a bug of newlib.
Reproduce
I reproduced it on the R2P2 repository, which is a .
https://github.com/picoruby/R2P2
BTW, R2P2 requires setting
PICO_SDK_PATH
environment variable, but it is not necessary for this reproduction because it fails before usingPICO_SDK_PATH
.Sorry for the lack of minimum reproduction. I'm not very familiar with PicoRuby and the building system, so I'm not sure how to minimize the reproduction process. 🙇
Solution
Add
#include <sys/types.h>
before#include <inttypes.h>
.This solution is based on raspberrypi/pico-sdk#1863.
I've confirmed that this patch fixes the error in my environment.