GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — meson: fix build failure on glibc >= 2.34 without standalone libanl by setarcos · Pull Request #2484 · yhirose/cpp-httplib

Conversation

@setarcos

@setarcos setarcos commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

On glibc >= 2.34, getaddrinfo_a is no longer provided by a standalone libanl shared library — it is built directly into libc. Newer architectures (e.g. loongarch64, riscv64) have never shipped a separate libanl, causing the meson build to fail with:

C++ shared or static library 'anl' not found

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
setarcos added a commit to lcpu-club/loongarch-packages that referenced this pull request Jul 1, 2026
@setarcos
addpatch: cpp-httplib, ver=0.48.0-2
a09c011
* Fix: C++ shared or static library 'anl' not found
* See also: yhirose/cpp-httplib#2484
@yhirose

yhirose commented Jul 1, 2026

Copy link
Copy Markdown
Owner

@Tachi107 could you please review this pull request for me?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Tachi107
Tachi107 reviewed Jul 1, 2026
View reviewed changes
Comment thread meson.build Outdated
Comment on lines +110 to +114
async_ns_dep = cxx.find_library('anl', required: false)
if not async_ns_dep.found()
# glibc >= 2.34 has getaddrinfo_a built into libc, no separate libanl needed
async_ns_dep = cxx.has_function('getaddrinfo_a') ? declare_dependency() : dependency('', required: async_ns_opt)
endif

@Tachi107 Tachi107 Jul 1, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I think it'd make more sense to invert the logic. i.e. look for getaddrinfo_a (since it's what we need), and if absent, require libanl.

Also, dependency('', found: false) is the usual way of having an "useless" dependency, as per meson docs.

Suggested change
async_ns_dep = cxx.find_library('anl', required: false)
if not async_ns_dep.found()
# glibc >= 2.34 has getaddrinfo_a built into libc, no separate libanl needed
async_ns_dep = cxx.has_function('getaddrinfo_a') ? declare_dependency() : dependency('', required: async_ns_opt)
endif
has_gai_a = cxx.has_function('getaddrinfo_a', args: '-D_GNU_SOURCE')
if not has_gai_a
async_ns_dep = cxx.find_library('anl', required: async_ns_opt)
else
async_ns_dep = dependency('', found: false)
fi

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@setarcos setarcos Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for the suggestion — inverting the logic does read much better. One small note: Instead dependency('', found: false), I used declare_dependency() instead, which creates an empty dependency that reports as found (so the -DCPPHTTPLIB_USE_NON_BLOCKING_GETADDRINFO flag still gets added when getaddrinfo_a is available in libc).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Tachi107

Tachi107 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@yhirose I think it'd make sense to add me as a "code owner" for the various meson.build files, so that I get automatically pinged for patches targetting them. I have never used this GitHub feature though, so can't suggest how to do that :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@setarcos
meson: fix build failure on glibc >= 2.34 without standalone libanl
6c1f60c
On glibc >= 2.34, getaddrinfo_a is no longer provided by a standalone
libanl shared library — it is built directly into libc.  Newer
architectures (e.g. loongarch64, riscv64) have never shipped a separate
libanl, causing the meson build to fail with:

    C++ shared or static library 'anl' not found

Signed-off-by: Pluto Yang <[email protected]>
@yhirose
yhirose merged commit 9a5321a into yhirose:master Jul 2, 2026
27 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@yhirose

yhirose commented Jul 2, 2026

Copy link
Copy Markdown
Owner

@setarcos @Tachi107 thanks all!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@Tachi107 Tachi107 Tachi107 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@setarcos @yhirose @Tachi107
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.