Skip to content

Fix compilation with picolibc#1

Open
maribu wants to merge 1 commit into
2xs:mainfrom
maribu:missing-include-stat
Open

Fix compilation with picolibc#1
maribu wants to merge 1 commit into
2xs:mainfrom
maribu:missing-include-stat

Conversation

@maribu
Copy link
Copy Markdown

@maribu maribu commented May 5, 2026

According to the stat man page an #include <sys/stat.h> is needed for access to the stat() function and the struct stat type. And indeed, adding this fixes the following compilation error when building with picolibc:

./include/xipfs.h:424:69: error: 'struct stat' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  424 | xipfs_fstat(xipfs_mount_t *mp, xipfs_file_desc_t *descp, struct stat *buf);
      |

According to the [stat man page][1] an `#include <sys/stat.h>` is needed
for access to the `stat()` function and the `struct stat` type. And
indeed, adding this fixes the following compilation error when building
with picolibc:

    ./include/xipfs.h:424:69: error: 'struct stat' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
      424 | xipfs_fstat(xipfs_mount_t *mp, xipfs_file_desc_t *descp, struct stat *buf);
          |

[1]: https://linux.die.net/man/2/stat
@maribu
Copy link
Copy Markdown
Author

maribu commented May 5, 2026

This can be tested with RIOT in the current master branch using:

FEATURES_REQUIRED=picolibc make BOARD=same54-xpro -C examples/advanced/xipfs 

Applying the following patch (to make use of the change in this PR) fixes the compilation issue:

diff --git a/pkg/xipfs/Makefile b/pkg/xipfs/Makefile
index ce59cdc807..a505d4a1ee 100644
--- a/pkg/xipfs/Makefile
+++ b/pkg/xipfs/Makefile
@@ -1,6 +1,6 @@
 PKG_NAME=xipfs
 PKG_URL=https://github.com/2xs/xipfs.git
-PKG_VERSION=75536def8c040074f5ae43a89dbb30893fd92618
+PKG_VERSION=f127bf88f034c4ef37a39a6f7e75b8b2d07d58cb
 PKG_LICENSE=CeCILL-2.1
 
 include $(RIOTBASE)/pkg/pkg.mk

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.

1 participant