Skip to content

Conversation

jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented May 9, 2025

This PR fixes the following compile errors with musl:

  1. crashpad includes glibc-specific <sys/cdefs.h> without appropriate __GLIBC__ guard

    In file included from sentry-native/external/crashpad/util/linux/scoped_ptrace_attach.cc:17:
    sentry-native/external/crashpad/compat/linux/sys/ptrace.h:20:10: fatal error: 
    sys/cdefs.h: No such file or directory
       20 | #include <sys/cdefs.h>
          |          ^~~~~~~~~~~~~
  2. crashpad uses pread64, off64_t etc. that are only available in musl when _LARGEFILE64_SOURCE is defined

    In file included from sentry-native/external/crashpad/util/process/process_memory_linux.cc:27:
    sentry-native/external/crashpad/util/process/process_memory_linux.cc: In lambda function:
    sentry-native/external/crashpad/util/process/process_memory_linux.cc:48:24: error: 'pread64' was not declared in this scope; did you mean 'pread'?
       48 |           HANDLE_EINTR(pread64(mem_fd_.get(), buffer, size, address));
          |                        ^~~~~~~
    
    In file included from sentry-native/external/crashpad/util/linux/memory_map.cc:15:
    sentry-native/external/crashpad/util/linux/memory_map.h:46:5: error: 'off64_t' does not name a type; did you mean 'off_t'?
       46 |     off64_t offset;
          |     ^~~~~~~
          |     off_t

These fixes are needed for getsentry/sentry-native#1233 to pass the CI on Alpine Linux with musl.

Ref: getsentry/sentry-native#1232

@jpnurmi jpnurmi force-pushed the fix/musl branch 4 times, most recently from 60cdd13 to 14489bf Compare May 12, 2025 10:32
@jpnurmi jpnurmi marked this pull request as ready for review May 12, 2025 13:27
@supervacuus supervacuus merged commit a17b30d into getsentry:getsentry May 13, 2025
16 checks passed
@jpnurmi jpnurmi deleted the fix/musl branch May 13, 2025 08:43
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