Skip to content

src: Fix builds with musl (instead of glibc) on Linux#104

Merged
aras-p merged 1 commit intoaras-p:mainfrom
moha-gh:mh/fix-musl-alpine-build
Mar 21, 2025
Merged

src: Fix builds with musl (instead of glibc) on Linux#104
aras-p merged 1 commit intoaras-p:mainfrom
moha-gh:mh/fix-musl-alpine-build

Conversation

@moha-gh
Copy link
Contributor

@moha-gh moha-gh commented Mar 19, 2025

As 'ftello64' is a glibc-only extension, the build fails when using musl. Here,
the plain 'ftello' is sufficient for 64-bit support.

Fixes #103

As 'ftello64' is a glibc-only extension, the build fails when using musl. Here,
the plain 'ftello' is sufficient for 64-bit support.

Fixes aras-p#103
#ifdef _MSC_VER
#define ftello64 _ftelli64
#elif defined(__APPLE__) || defined(__FreeBSD__)
#elif defined(__APPLE__) || defined(__FreeBSD__) || (defined(__linux__) && !defined(__GLIBC__))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be advisable to move this check somewhere else (like a dedicated header), as right now ftello64() is used not only in BuildEvents.cpp, but also in main.cpp. At the latter place, compilation only succeeds since BuildEvents.h gets included (which is a kind of a hidden dependency).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is a bit of a mess, I'll try to remember to do something about it.

@moha-gh moha-gh marked this pull request as ready for review March 19, 2025 08:15
@aras-p aras-p merged commit 5544775 into aras-p:main Mar 21, 2025
3 checks passed
@moha-gh moha-gh deleted the mh/fix-musl-alpine-build branch March 21, 2025 05:52
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.

Build using musl (on Alpine Linux) fails

2 participants