Skip to content

Picotool does not build against musl libc on linux #171

@dasimmet

Description

@dasimmet

I have set up a build of picotool using the zig toolchain here

when linking picotool hermetically against musl libc, it failed because musl does not have a sys/cdefs.h

/home/dasimmet/repos/zig/raspi-pico-sdk/src/host/pico_platform/include/pico/platform.h:16:10: error: 'sys/cdefs.h' file not found
#include <sys/cdefs.h>
         ^~~~~~~~~~~~~~
/home/dasimmet/.cache/zig/p/122071e1ba857e67739c7e737c413e5d2e3ccb13cb9bdc28a1adc682d8c80e7d8178/bintool/bintool.cpp:10:10: note: in file included from /home/dasimmet/.cache/zig/p/122071e1ba857e67739c7e737c413e5d2e3ccb13cb9bdc28a1adc682d8c80e7d8178/bintool/bintool.cpp:10:
#include "boot/picobin.h"
         ^
/home/dasimmet/repos/zig/raspi-pico-sdk/src/common/boot_picobin_headers/include/boot/picobin.h:11:10: note: in file included from /home/dasimmet/repos/zig/raspi-pico-sdk/src/common/boot_picobin_headers/include/boot/picobin.h:11:
#include "pico/platform.h"

without it, it builds fine. according to musl, this is an internal glibc header that should not be included directly:
https://wiki.musl-libc.org/faq#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions