Skip to content

Gloo won't compile on Alpine Linux, and how to fix it. #501

@CVFA1

Description

@CVFA1

Summary

Fix build failure on Alpine Linux (musl libc) due to use of non-portable type.

Problem

When compiling Gloo on Alpine Linux (which uses musl libc), the build fails in gloo/common/linux.cc due to the use of __caddr_t:

ifr->ifr_data = (__caddr_t)&ecmd;
ifr->ifr_data = (__caddr_t)&edata;

__caddr_t is not portable and causes issues on musl-based systems.

Proposed fix

Replace __caddr_t with char*, which is compatible across libc implementations:

ifr->ifr_data = (char*)&ecmd;
ifr->ifr_data = (char*)&edata;

Notes

This change allows successful compilation on Alpine Linux without affecting behavior on glibc-based systems.

This change does not break compatibility either; it is a subtle change that does not alter how Glibc performs the operation.

__caddr_t is effectively an alias for char* on glibc-based systems, so replacing it with char* preserves behavior while improving portability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions