Skip to content

A no-threads stdlib built at -O0 does not link: http_park_resume calls http_pool_submit_conn, which only threaded builds define #3121

Closed

Description

@nicolas-maman

What happens

A cooperative (no-threads) stdlib built at -O0 does not link the shared runtime:

make stdlib EXTRA_CFLAGS='-DAETHER_NO_THREADING -g -O0'
...
ld: build/libaether.a(aether_http_server.o): in function `http_park_resume':
std/net/aether_http_server.c:5491: undefined reference to `http_pool_submit_conn'
make: *** [Makefile:2014: build/shared/aether.dll] Error 1

Found on Windows (MinGW GCC 16.2), where the shared runtime is linked as part of make stdlib.

Why

std/net/aether_http_pool.c defines http_pool_submit_conn only under #if AETHER_HAS_THREADS && AETHER_HAS_NETWORKING. std/net/aether_http_server.c defines http_park_resume, which calls it, under no such guard. Only threaded paths reach http_park_resume. At -O2 the compiler drops the unused static function, and the reference goes with it. At -O0 the function and its reference stay, and the link fails.

Fix

Compile http_park_resume under the condition its only caller is compiled under (#if AETHER_HAS_THREADS, where the server creates its park lot), so the reference no longer depends on the optimizer.

Activity

  1. paul-hammant commented on Oct 25, 2026

    @paul-hammant
    Collaborator

    Already fixed on main by d2e8aee (merged in #3101, first released in v0.840.0): http_park_resume is now compiled under #if AETHER_HAS_THREADS, the same condition as its only caller. tests/integration/no_threads_refs/test_no_threads_refs.sh covers it. On 0.848.0 it passes, and with the guard removed it fails naming http_pool_submit_conn. The commit referenced the issue without a closing keyword, so it stayed open.

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

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